ddt
0.1
|
Functions | |
def | generate_sources (project_path, module_dir, module_name, include_directories, use_pyside=False) |
Generate source files using shiboken2. More... | |
def | find_binding_files (dir) |
Finds the files necessary for the bindings. More... | |
def | get_project_includes (project_root, directories) |
Gets a list of paths to include directories. More... | |
def | find_project_includes (root_dir) |
Find include directories in the given directory. More... | |
def | run_shiboken (header_file, typesystem_file, include_paths, project_root, module_dir, use_pyside) |
Calls shiboken2 to generate the python bindings. More... | |
def | get_generated_sources (directory, subdirectory) |
Gets the generated '.cpp' files. More... | |
Variables | |
def | binding_files = find_binding_files("./src") |
list | include_roots = ["datatransfer", "datavisualisation", "imagehandling", "utils"] |
list | include_dirs = [] |
string | seperator = ":" |
string | includes = seperator.join(include_dirs) |
def shiboken_helper.find_binding_files | ( | dir | ) |
Finds the files necessary for the bindings.
Searches the given directory for files ending with '.h' or '.xml'. Only the first occurences are returned!
def shiboken_helper.find_project_includes | ( | root_dir | ) |
Find include directories in the given directory.
Searches the given directory for directories called 'include'. Returns a list of paths to the directories found.
def shiboken_helper.generate_sources | ( | project_path, | |
module_dir, | |||
module_name, | |||
include_directories, | |||
use_pyside = False |
|||
) |
Generate source files using shiboken2.
This triggers the shiboken process to generate source files for python bindings. Therefore the include paths of the project are gathered, so that they can be included in the shiboken command. Next, the paths to the necessary header and xml files for the bindings are gathered. After then running the shiboken2 process a list containing the generated sources is created and returnd as a string.
def shiboken_helper.get_generated_sources | ( | directory, | |
subdirectory | |||
) |
Gets the generated '.cpp' files.
Searches in '<directory>/generated/<subdirectory>' for '.cpp' files.
def shiboken_helper.get_project_includes | ( | project_root, | |
directories | |||
) |
Gets a list of paths to include directories.
For each directory in the list of directories the method 'find_project_includes' is called. Returns a string containing the paths to the include directories seperated by ':'.
def shiboken_helper.run_shiboken | ( | header_file, | |
typesystem_file, | |||
include_paths, | |||
project_root, | |||
module_dir, | |||
use_pyside | |||
) |
Calls shiboken2 to generate the python bindings.
This method calles the shiboken command. The project root path is needed because some pre- viously generated header files, contained in the build directory, need to be added to the include paths. Otherwise clang will throw an error.
def shiboken_helper.binding_files = find_binding_files("./src") |
list shiboken_helper.include_dirs = [] |
list shiboken_helper.include_roots = ["datatransfer", "datavisualisation", "imagehandling", "utils"] |
string shiboken_helper.includes = seperator.join(include_dirs) |
string shiboken_helper.seperator = ":" |