Makeprojects
Loading...
Searching...
No Matches
makeprojects.python Namespace Reference

Module the handles python script execution. More...

Classes

class  BuildPythonFile
 Class to build with python scripts. More...

Functions

 match (file_name)
 Check if the filename is a type that this module supports.
 create_simple_script_object (file_name, entry=None, verbose=False)
 Create a BuildPythonFile for a script with a single entry point.
 create_build_rules_objects (file_name, build_rules, parms=None, verbose=False)
 Create BuildObjects from a loaded build_rules.py file.
 create_clean_rules_objects (file_name, build_rules, parms=None, verbose=False)
 Create BuildObjects from a loaded build_rules.py file.

Variables

tuple BUILD_LIST
 Default build_rules.py command list, priority / entrypoint.
tuple CUSTOM_SCRIPTS
 Names of custom scripts and their priorities.

Detailed Description

Module the handles python script execution.

Manages, and creates BuildObjects that are tailored for executing python scripts.

See also
makeprojects.cleanme
makeprojects.buildme

Function Documentation

◆ create_build_rules_objects()

makeprojects.python.create_build_rules_objects ( file_name,
build_rules,
parms = None,
verbose = False )

Create BuildObjects from a loaded build_rules.py file.

After loading a build_rules.py module, this function will check for all entry points used by buildme such as prebuild and postbuild and it will create BuildPythonFile objects for every entry point found.

If there are no entry points in the module, this function will return an empty list.

Parameters
file_nameName of the loaded file
build_rulesLoaded python module, usually build_rules.py
parmsDictionary of parameters for the function call
verboseTrue if verbose output is required
Returns
List of BuildPythonFile objects, can be empty

◆ create_clean_rules_objects()

makeprojects.python.create_clean_rules_objects ( file_name,
build_rules,
parms = None,
verbose = False )

Create BuildObjects from a loaded build_rules.py file.

After loading a build_rules.py module, this function will check for the entry point used by cleanme clean and it will create a BuildPythonFile objects for the entry point found.

If there are no entry point in the module, this function will return an empty list.

Parameters
file_nameName of the loaded file
build_rulesLoaded python module, usually build_rules.py
parmsDictionary of parameters for the function call
verboseTrue if verbose output is required
Returns
List of BuildPythonFile objects, can be empty

◆ create_simple_script_object()

makeprojects.python.create_simple_script_object ( file_name,
entry = None,
verbose = False )

Create a BuildPythonFile for a script with a single entry point.

Given a filename and an name to an entry point, create and return a single BuildPythonFile entry in a list. The entry point must accept a single parameter of the directory that the script resides in and the function returns an integer error code or None.

If entry is None, the function will assume the entry point is named main.

Parameters
file_namePathname to the *.py to build
entryName of the function to call in the python file
verboseTrue if verbose output
Returns
List of a single BuildPythonFile object, can be empty

◆ match()

makeprojects.python.match ( file_name)

Check if the filename is a type that this module supports.

Parameters
file_nameFilename to match
Returns
False if not a match, True if supported

Variable Documentation

◆ BUILD_LIST

tuple makeprojects.python.BUILD_LIST
Initial value:
1= (
2 (1, "prebuild"),
3 (40, "build"),
4 (99, "postbuild")
5)

Default build_rules.py command list, priority / entrypoint.

◆ CUSTOM_SCRIPTS

tuple makeprojects.python.CUSTOM_SCRIPTS
Initial value:
1= (
2 (1, "prebuild.py"),
3 (40, "custombuild.py"),
4 (99, "postbuild.py")
5)

Names of custom scripts and their priorities.