read_fct module

Created on Mon Nov 17 11:18:59 2014 @author: pierre_b

read_all(path)[source]

Read every csv files in a directory and subdirectory and create a structure for the code generation

Parameters:path (str) – path to the root folder with the csv files
Returns:gen_dict – Dict with key = class name and value = class dict (name, package, properties, methods…)
Return type:dict
read_file(path)[source]

Read a csv file and create a dict for the class code generation

Parameters:path (str) – path to the class csv file to read
Returns:class_dict – Dict containing all the class informations (properties, package, methods…)
Return type:dict
get_value_str(value, type_val)[source]

Convert the value from the csv file to the correct str according to the type

Parameters:
  • value (str) – value to convert
  • type_val (str) – Type to convert to
Returns:

value – Value updated to match the type

Return type:

str

find_import_type(gen_dict, class_dict, pyleecan_type=[])[source]

Find all the Pyleecan type used by the class of class_dict

Parameters:
  • gen_dict (dict) – Dict with key = class name and value = class_dict
  • class_dict (dict) – Dict of the class to find the import
  • pyleecan_type (list) – Existing type to import (Default value = [])
Returns:

type_list – List of pyleecan type (as str) to import

Return type:

list

is_list_pyleecan_type(type_name)[source]

Check if the type is a list of Pyleecan type ([name])

Parameters:type_name (str) – Type of the property
Returns:is_list – True if the type is a list of pyleecan type
Return type:bool
exception NotAFile[source]

Bases: Exception

Raised when the code generator is call on a wrong path