def get_snapshot(self, mode): ''' get the snapshot depending on the mode i.e. input, output''' dict = self.get_current_aux_data() output_snapshots = input_snapshots = None # the check for key is needed since snapshot can be None if dict and dict.has_key('%s_snapshots' % mode): if mode == 'output': output_snapshots = dict.get('%s_snapshots' % mode) else: input_snapshots = dict.get('%s_snapshots' % mode) else: sobject = self.get_current_sobject() context = self.get_context() loader = ProdLoaderContext() output_snapshots = loader.get_output_snapshots(sobject, context) input_snapshots = loader.get_input_snapshots(sobject, context) # this is for sharing with AssetLoaderWdg # should only be called once per sobject self.append_aux_data({'output_snapshots': output_snapshots, \ 'input_snapshots': input_snapshots}) if mode == 'output': return output_snapshots else: return input_snapshots
def get_snapshot(my, mode): ''' get the snapshot depending on the mode i.e. input, output''' dict = my.get_current_aux_data() output_snapshots = input_snapshots = None # the check for key is needed since snapshot can be None if dict and dict.has_key('%s_snapshots' %mode): if mode == 'output': output_snapshots = dict.get('%s_snapshots' %mode) else: input_snapshots = dict.get('%s_snapshots' %mode) else: sobject = my.get_current_sobject() context = my.get_context() loader = ProdLoaderContext() output_snapshots = loader.get_output_snapshots(sobject, context) input_snapshots = loader.get_input_snapshots(sobject, context) # this is for sharing with AssetLoaderWdg # should only be called once per sobject my.append_aux_data({'output_snapshots': output_snapshots, \ 'input_snapshots': input_snapshots}) if mode == 'output': return output_snapshots else: return input_snapshots
def get_snapshot(my, mode): ''' get the snapshot depending on the mode i.e. input, output''' dict = my.get_current_aux_data() output_snapshots = input_snapshots = None # the check for key is needed since snapshot can be None if dict and dict.has_key('%s_snapshots' %mode): if mode == 'output': output_snapshots = dict.get('%s_snapshots' %mode) else: input_snapshots = dict.get('%s_snapshots' %mode) else: sobject = my.get_current_sobject() process = my.get_process() loader = ProdLoaderContext() if my.shot_search_type: loader.set_shot_search_type(my.shot_search_type) output_snapshots = loader.get_output_snapshots(sobject, process) input_snapshots = loader.get_input_snapshots(sobject, process) # this is for sharing with AssetLoaderWdg # should only be called once per sobject idx = my.get_current_index() my.insert_aux_data(idx, {'output_snapshots': output_snapshots, \ 'input_snapshots': input_snapshots}) if mode == 'output': return output_snapshots else: return input_snapshots
def execute(my): if my.project_code: Project.set_project(project_code) snapshot = Snapshot.get_by_code(my.snapshot_code) # get the loader implementation from pyasm.prod.load import ProdLoaderContext loader_context = ProdLoaderContext() loader_context.set_context(snapshot.get_value("context")) # pass on any message options for the loader #if options != "": # loader_context.set_options(options) loader = loader_context.get_loader(snapshot) loader.execute() my.execute_xml = loader.get_execute_xml().to_string()
def execute(my): if my.project_code: Project.set_project(project_code) snapshot = Snapshot.get_by_code(my.snapshot_code) # get the loader implementation from pyasm.prod.load import ProdLoaderContext loader_context = ProdLoaderContext() loader_context.set_context(snapshot.get_value("context")) # pass on any message options for the loader # if options != "": # loader_context.set_options(options) loader = loader_context.get_loader(snapshot) loader.execute() my.execute_xml = loader.get_execute_xml().to_string()
def get_snapshot(my, mode): ''' get the snapshot depending on the mode i.e. input, output''' dict = my.get_current_aux_data() output_snapshots = input_snapshots = None # the check for key is needed since snapshot can be None if dict and dict.has_key('%s_snapshots' % mode): if mode == 'output': output_snapshots = dict.get('%s_snapshots' % mode) else: input_snapshots = dict.get('%s_snapshots' % mode) else: sobject = my.get_current_sobject() process = my.get_process() loader = ProdLoaderContext() if my.shot_search_type: loader.set_shot_search_type(my.shot_search_type) output_snapshots = loader.get_output_snapshots(sobject, process) input_snapshots = loader.get_input_snapshots(sobject, process) # this is for sharing with AssetLoaderWdg # should only be called once per sobject idx = my.get_current_index() my.insert_aux_data(idx, {'output_snapshots': output_snapshots, \ 'input_snapshots': input_snapshots}) if mode == 'output': return output_snapshots else: return input_snapshots