6Triple-use minimum working example for PyXMake. This script can be
7executed in three different ways in varying levels of accessibility
9@note: Compile a stand-alone application using PyInstaller
13----------------------------------------------------------------------------------------------
18 - Requires PyCODAC in PYTHONPATH.
20@author: garb_ma [DLR-FA,STM Braunschweig]
21----------------------------------------------------------------------------------------------
30 sys.path.insert(0,os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
34 __pyx_src_path = PyXMake.PyXMakePath
42 source=__pyx_src_path,
46 exclude = [
".git",
".svn",
"__pycache__"],
50 Main function to execute the script.
53 Utility.CreateArchive(os.path.join(output,BuildID), source=source, exclude=exclude)
56if __name__ ==
"__main__":
61 parser = argparse.ArgumentParser(description=
'CLI wrapper options for archive generator.')
62 parser.add_argument(
'name', type=str, nargs=1, help=
"Name of the archive")
63 parser.add_argument(
'source', type=str, nargs=1, help=
"Absolute path to source directory.")
64 parser.add_argument(
"--output", type=str, nargs=1, help=
"Absolute path to output directory. Defaults to the current workspace.")
65 parser.add_argument(
"--exclude", nargs=
'+', default=[], help=
"File extensions to be ignored during the process")
70 args, _ = parser.parse_known_args()
72 project = args.name[0] ;
74 source = args.source[0] ;
76 try: output = args.output[0]
77 except: output = os.path.abspath(os.getcwd())
79 try: excludes = args.exclude
80 except: excludes = [
".git",
".svn",
"__pycache__"]
82 except Exception
as _:
84 if AllowDefaultMakeOption: main(
"pyx_core-master.zip")
86 else: main(project, source, output, exclude=excludes)
88 print(
"==================================")
89 print(
"Finished creating archive")
90 print(
"==================================")
Create a make object to define the building environment.
main(BuildID, source=__pyx_src_path, output=os.getcwd(), exclude=[".git", ".svn", "__pycache__"], **kwargs)