File tree Expand file tree Collapse file tree 3 files changed +16
-21
lines changed
Expand file tree Collapse file tree 3 files changed +16
-21
lines changed Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ def setup():
151151
152152 print ('Creating Driver Program: {}/{}.py' .format (app_root , app_name ))
153153 with open ('{}/{}.py' .format (app_root , app_name ), 'w' ) as main_file :
154- main_file .write (constants .DRIVER_TEMPLATE )
154+ main_file .write (constants .DRIVER_TEMPLATE . format ( app_name = app_name ) )
155155
156156 os .chmod ('{}/{}.py' .format (app_root , app_name ), 0o744 )
157157
Original file line number Diff line number Diff line change 3636
3737ROOT_NODE_NAME = 'PyRunnerRootNode'
3838
39- DRIVER_TEMPLATE = """
40- #!/usr/bin/env python3
39+ DRIVER_TEMPLATE = """#!/usr/bin/env python3
4140
42- import sys
41+ import os, sys
4342from pyrunner import PyRunner
4443from pathlib import Path
4544
46- def main():
47- app = PyRunner()
48-
49- # Assign default config and .lst file
50- app.source_config_file(Path('{}/app_profile'.format(app.config['config_dir'])))
51- app.load_from_file(Path('{}/{}.lst'.format(app.config['config_dir'], app.config['app_name'])))
52-
53- # Parse command line args
54- app.parse_args()
55-
56- # Initiate job
57- exit_status = app.execute()
58-
59- # Ensure job exit status is passed to the caller
60- sys.exit(exit_status)
45+ abs_dir_path = os.path.dirname(os.path.realpath(__file__))
46+
47+ app = PyRunner()
48+
49+ # Assign default config and .lst file
50+ app.config_file = '{{}}/config/app_profile'.format(abs_dir_path)
51+ app.proc_file = '{{}}/config/{app_name}.lst'.format(abs_dir_path)
52+
53+ # Parse command line args
54+ app.parse_args()
6155
6256if __name__ == '__main__':
63- main()
57+ # Initiate job and exit driver with return code
58+ sys.exit(app.execute())
6459"""
Original file line number Diff line number Diff line change 1- __version__ = '4.1.1 '
1+ __version__ = '4.1.2 '
You can’t perform that action at this time.
0 commit comments