pyleecan.Generator.gui_generator module

generate_gui(ui_folder_path, gen_dict, is_gen_resource=True, IS_SDT=False)[source]

Generate all the needed file for the GUI

Parameters:
  • ui_folder_path (str) – Path to the folder to scan recursively for ui files

  • gen_dict (dict) – Dict with key = class name and value = class_dict

  • is_gen_resource (bool) – True to genrate the resources as well

gen_gui_edit_file(path, class_name, gen_dict, gen_list)[source]

Generate the “Gen_” class for editing the gui according to gen_list

Parameters:
  • path (str) – Path to the class folder

  • class_name (str) – Name of the class to generate

  • gen_dict (dict) – Dict with key = class name and value = class_dict

  • gen_list (list) – List of widget to edit

gen_gui_class_file(path, class_name, gen_dict, gen_list)[source]

Generate the Main class file according to the gen_list (should be run only once)

Parameters:
  • path (str) – Path to the class folder

  • class_name (str) – Name of the class to generate

  • gen_dict (dict) – Dict with key = class name and value = class_dict

  • gen_list (list) – List of widget to edit

gen_edit_widget_code(widget_name, data)[source]

Generate the code lines to setup the widget according to data :param widget_name: Name of the widget to edit :type widget_name: str :param data: A dict with the main information about the corresponding variable :type data: dict

Returns:

gen_str – The generated code lines

Return type:

str

gen_whats_this(data)[source]

Generate the “What’s this” text for the variable discribed in data @param[in] data A dictionary with the caracteristics of the variable @param[out] WhatThis String with the “What’s this” texte from data

gen_tooltips(data)[source]

Generate the Tooltips text for the variable discribed in data @param[in] data A dictionary with the caracteristics of the variable @param[out] Tooltips String with the Tooltips texte from data

find_prop(prop_list, prop_name)[source]

Find the property “prop_name” in the list “prop_list” @param[in] prop_list List of properties @param[in] prop_name Name of the property we’re looking for @param[out] prop_dict Dictionary of the property (description, max, min…)

exception NotFoundError[source]

Bases: Exception

Raised when a property can’t be found in the property list in which it must be

qrc_to_py(path, file_name)[source]

Convert a .qrc file in a .py file @param[in] path Path to the file folder @param[in] file_name Name of the file to convert

ui_to_py(path, file_name)[source]

Convert a .ui file in a .py file @param[in] path Path to the file folder @param[in] file_name Name of the file to convert

find_ui_files(ui_folder_path)[source]

Find all the .ui files in a directory

Parameters:

ui_folder_path (str) – Path to the folder to scan recursively for ui file

Returns:

file_list – List of tuple (folder_path, file_name.ui)

Return type:

list

find_py_files()[source]

Find all the .py files (except __init__) in a directory @param[out] file_list List of tuple (path, file_name.py)

gen_pro_file()[source]