Peano
Loading...
Searching...
No Matches
peano4.api.output.Helper Namespace Reference

Functions

 write_file (overwrite, overwrite_is_default, full_qualified_filename)
 overwrite is of type Overwrite and is what the user passes in overwrite_is_default is a boolean
 
 shortened_class_name (class_name, max_length=MAX_CLASS_NAME_LENGTH)
 Class name of a generated observer or action set which is short enough to serve as file name.
 

Variables

str WARNING_BANNER
 
int MAX_CLASS_NAME_LENGTH = 200
 
dict _shortened_class_names = {}
 

Function Documentation

◆ shortened_class_name()

peano4.api.output.Helper.shortened_class_name (   class_name,
  max_length = MAX_CLASS_NAME_LENGTH 
)

Class name of a generated observer or action set which is short enough to serve as file name.

Names up to max_length characters are returned unchanged. Longer names are cut off and get a consecutive number appended, e.g. ..._1, ..._2. The cut-off names carry no meaning anymore, but every call with the same long name and the same max_length yields the same short name, so the generated files can refer to each other.

Parameters
class_namestr The full class name.
max_lengthint Longest admissible class name.

Definition at line 45 of file Helper.py.

◆ write_file()

peano4.api.output.Helper.write_file (   overwrite,
  overwrite_is_default,
  full_qualified_filename 
)

overwrite is of type Overwrite and is what the user passes in overwrite_is_default is a boolean

Definition at line 15 of file Helper.py.

Variable Documentation

◆ _shortened_class_names

dict peano4.api.output.Helper._shortened_class_names = {}
protected

Definition at line 42 of file Helper.py.

◆ MAX_CLASS_NAME_LENGTH

int peano4.api.output.Helper.MAX_CLASS_NAME_LENGTH = 200

Definition at line 39 of file Helper.py.

◆ WARNING_BANNER

str peano4.api.output.Helper.WARNING_BANNER
Initial value:
1= """// **********************************************************************************************
2// *** !!!WARNING!!! ***
3// *** WARNING: AUTO GENERATED FILE! DO NOT MODIFY BY HAND! YOUR CHANGES WILL BE OVERWRITTEN! ***
4// *** !!!WARNING!!! ***
5// *** Generated by Peano's Python API: www.peano-framework.org ***
6// **********************************************************************************************
7"""

Definition at line 7 of file Helper.py.