def execute(self, _context): try: config = pman.get_config(os.path.dirname(bpy.data.filepath) if bpy.data.filepath else None) if config['run']['auto_save']: bpy.ops.wm.save_mainfile() pman.run(config) return {'FINISHED'} except pman.PManException as err: self.report({'ERROR'}, str(err)) return {'CANCELLED'}
def test_run_args(projectdir): with open('main.py', 'w') as main_file: main_file.write(EXTRA_ARGS_MAIN) config = pman.get_config() config['run']['extra_args'] = "--test 'hello world'" config.write() pman.run() with open('tmp', 'r') as tmpfile: assert tmpfile.read() == "['--test', 'hello world']"
def execute(self, _context): try: config = pman.get_config( os.path.dirname(bpy.data.filepath) if bpy.data. filepath else None) if config['run']['auto_save']: bpy.ops.wm.save_mainfile() pman.run(config) return {'FINISHED'} except pman.PManException as err: self.report({'ERROR'}, str(err)) return {'CANCELLED'}
def run(_, config): pman.run(config)
def run(_): pman.run()