rem
stringlengths 1
322k
| add
stringlengths 0
2.05M
| context
stringlengths 4
228k
| meta
stringlengths 156
215
|
---|---|---|---|
def push_vistrail_to_repository(self): | def push_vistrail_to_repository(self, branching=False): | def push_vistrail_to_repository(self): """ uploads current VisTrail to web repository """ | 97c0ec7cbaf4d750ca0b818712380d001b34e55d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/97c0ec7cbaf4d750ca0b818712380d001b34e55d/repository.py |
'repository_vt_id': repository_vt_id, | 'repository_vt_id': repository_vt_id if not branching else -1, | def push_vistrail_to_repository(self): """ uploads current VisTrail to web repository """ | 97c0ec7cbaf4d750ca0b818712380d001b34e55d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/97c0ec7cbaf4d750ca0b818712380d001b34e55d/repository.py |
""" | controller.recompute_terse_graph() controller.invalidate_version_tree() | def push_vistrail_to_repository(self): """ uploads current VisTrail to web repository """ | 97c0ec7cbaf4d750ca0b818712380d001b34e55d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/97c0ec7cbaf4d750ca0b818712380d001b34e55d/repository.py |
""" | def push_vistrail_to_repository(self): """ uploads current VisTrail to web repository """ | 97c0ec7cbaf4d750ca0b818712380d001b34e55d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/97c0ec7cbaf4d750ca0b818712380d001b34e55d/repository.py |
|
self.dialog.cookiejar = cookielib.CookieJar() | self.dialog.cookiejar = cookielib.CookieJar() self.dialog.cookie_url = self.config.webRepositoryURL | def clicked_on_login(self): """ Attempts to log into web repository stores auth cookie for session """ from gui.application import VistrailsApplication | 97c0ec7cbaf4d750ca0b818712380d001b34e55d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/97c0ec7cbaf4d750ca0b818712380d001b34e55d/repository.py |
self._push_tab = self.create_push_tab() | def __init__(self, parent): QtGui.QDialog.__init__(self, parent) self._status_bar = QtGui.QStatusBar(self) self.setWindowTitle('Web Repository Options') layout = QtGui.QHBoxLayout(self) layout.setMargin(0) layout.setSpacing(0) self.setLayout(layout) | 97c0ec7cbaf4d750ca0b818712380d001b34e55d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/97c0ec7cbaf4d750ca0b818712380d001b34e55d/repository.py |
|
def handle_missing_module(m_name, m_namespace): | def handle_missing_module(*args, **kwargs): | def handle_missing_module(m_name, m_namespace): global webServicesmodulesDict def get_wsdl_from_namespace(m_namespace): try: wsdl = m_namespace.split("|") return wsdl[0] except: print "invalid namespace" return None wsdl = get_wsdl_from_namespace(m_namespace) if wsdl: outdated_list = [] updated_list = [] error_list = [] print "Downloading %s and adding to the Module list..."%wsdl pathfile = os.path.join(core.system.default_dot_vistrails(), "webServices", "modules.conf") if os.path.isfile(pathfile): #Verify if there is a need to update the modules configuration #file (modules.conf) (outdated_list, updated_list, error_list) = verify_wsdl([wsdl]) #print "verified: createconfig file is %s"%createconfigfile else: #If the modules configuration file doesn't exist, create it outdated_list = [wsdl] #If the stub files are not updated or there is not information in # the header about the modification date of the web service, the # stubs files and a modules configuration file will be created # otherwise the information of the modules will be obtained from # the modules.conf files that contains serialized data of the methods # and the complex types of the web services # print outdated_list, updated_list, error_list if os.path.isfile(pathfile): try: inf = open(pathfile) webServicesmodulesDict = cPickle.load(inf) inf.close() except: print "Error loading configuration file" return False try: (res,not_loaded) = load_wsdl_no_config(updated_list) #print "done loading_no_config" if not res: outdated_list.extend([wsdl]) (res, not_loaded) = load_wsdl_with_config(outdated_list) #print "done loading_with_config" if res: #add new url to package config file wsdlList = [] if configuration.check('wsdlList'): wsdlList = configuration.wsdlList.split(";") if wsdl not in wsdlList: wsdlList.append(wsdl) swsdlList = ";".join(wsdlList) configuration.wsdlList = swsdlList print "done." return True else: msg = """ There were problems loading the webservice. | c1f2f8599b539d65ccebe6ec507680ba3f507273 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/c1f2f8599b539d65ccebe6ec507680ba3f507273/init.py |
m = pipeline.modules[m_id] m_namespace = m.namespace | def get_wsdl_from_namespace(m_namespace): try: wsdl = m_namespace.split("|") return wsdl[0] except: print "invalid namespace" return None | c1f2f8599b539d65ccebe6ec507680ba3f507273 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/c1f2f8599b539d65ccebe6ec507680ba3f507273/init.py |
|
if not cellWidget.label.hasScaledContents(): | if (not cellWidget.label.hasScaledContents() and not cellWidget._playing): | def updateStatus(self, info): """ updateStatus(info: tuple) -> None Updates the status of the button based on the input info """ (sheet, row, col, cellWidget) = info if cellWidget: if not cellWidget.label.hasScaledContents(): self.setEnabled(True) originalWidth = cellWidget.originalPix.width() self.setValue(cellWidget.label.pixmap().width()*100/originalWidth) else: self.setEnabled(False) self.setValue(100) | d96b63cb396a2915af62ff39127f0fc0aa595749 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/d96b63cb396a2915af62ff39127f0fc0aa595749/imageviewer.py |
self.flush_move_actions() | self.flush_delayed_actions() | def create_group(self, module_ids, connection_ids): self.flush_move_actions() (group, connections) = \ BaseController.create_group(self, self.current_pipeline, module_ids, connection_ids) op_list = [] op_list.extend(('delete', self.current_pipeline.connections[c_id]) for c_id in connection_ids) op_list.extend(('delete', self.current_pipeline.modules[m_id]) for m_id in module_ids) op_list.append(('add', group)) op_list.extend(('add', c) for c in connections) action = core.db.action.create_action(op_list) self.add_new_action(action) | 79dd982e6cefb84d959fc7a4fd17507a2c038301 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/79dd982e6cefb84d959fc7a4fd17507a2c038301/vistrail_controller.py |
self.flush_move_actions() | self.flush_delayed_actions() | def create_abstraction(self, module_ids, connection_ids, name): self.flush_move_actions() (abstraction, connections) = \ BaseController.create_abstraction(self, self.current_pipeline, module_ids, connection_ids, name) op_list = [] op_list.extend(('delete', self.current_pipeline.connections[c_id]) for c_id in connection_ids) op_list.extend(('delete', self.current_pipeline.modules[m_id]) for m_id in module_ids) op_list.append(('add', abstraction)) op_list.extend(('add', c) for c in connections) action = core.db.action.create_action(op_list) self.add_new_action(action) result = self.perform_action(action) return abstraction | 79dd982e6cefb84d959fc7a4fd17507a2c038301 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/79dd982e6cefb84d959fc7a4fd17507a2c038301/vistrail_controller.py |
self.flush_move_actions() | self.flush_delayed_actions() | def create_abstraction_from_group(self, group_id, name=""): self.flush_move_actions() name = self.get_abstraction_name(name) (abstraction, connections) = \ BaseController.create_abstraction_from_group(self, self.current_pipeline, group_id, name) | 79dd982e6cefb84d959fc7a4fd17507a2c038301 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/79dd982e6cefb84d959fc7a4fd17507a2c038301/vistrail_controller.py |
self.flush_move_actions() | self.flush_delayed_actions() | def ungroup_set(self, module_ids): self.flush_move_actions() for m_id in module_ids: self.create_ungroup(m_id) | 79dd982e6cefb84d959fc7a4fd17507a2c038301 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/79dd982e6cefb84d959fc7a4fd17507a2c038301/vistrail_controller.py |
self.flush_move_actions() | self.flush_delayed_actions() | def update_notes(self, notes): """ Parameters ---------- | 79dd982e6cefb84d959fc7a4fd17507a2c038301 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/79dd982e6cefb84d959fc7a4fd17507a2c038301/vistrail_controller.py |
self.flush_move_actions() | self.flush_delayed_actions() | def execute_current_workflow(self, custom_aliases=None): """ execute_current_workflow() -> None Execute the current workflow (if exists) """ self.flush_move_actions() if self.current_pipeline: locator = self.get_locator() if locator: locator.clean_temporaries() locator.save_temporary(self.vistrail) self.execute_workflow_list([(self.locator, self.current_version, self.current_pipeline, self.current_pipeline_view, custom_aliases, None)]) | 79dd982e6cefb84d959fc7a4fd17507a2c038301 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/79dd982e6cefb84d959fc7a4fd17507a2c038301/vistrail_controller.py |
self.flush_move_actions() | self.flush_delayed_actions() | def update_current_tag(self,tag): """ update_current_tag(tag: str) -> Bool Update the current vistrail tag and return success predicate """ self.flush_move_actions() try: if self.vistrail.hasTag(self.current_version): self.vistrail.changeTag(tag, self.current_version) else: self.vistrail.addTag(tag, self.current_version) except TagExists: show_warning('Name Exists', "There is already another version named '%s'.\n" "Please enter a different one." % tag) return False self.set_changed(True) self.recompute_terse_graph() self.invalidate_version_tree(False) return True | 79dd982e6cefb84d959fc7a4fd17507a2c038301 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/79dd982e6cefb84d959fc7a4fd17507a2c038301/vistrail_controller.py |
self.flush_move_actions() | self.flush_delayed_actions() | def copy_modules_and_connections(self, module_ids, connection_ids): """copy_modules_and_connections(module_ids: [long], connection_ids: [long]) -> str Serializes a list of modules and connections """ self.flush_move_actions() | 79dd982e6cefb84d959fc7a4fd17507a2c038301 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/79dd982e6cefb84d959fc7a4fd17507a2c038301/vistrail_controller.py |
self.flush_move_actions() | self.flush_delayed_actions() | def paste_modules_and_connections(self, str, center): """ paste_modules_and_connections(str, center: (float, float)) -> [id list] Paste a list of modules and connections into the current pipeline. | 79dd982e6cefb84d959fc7a4fd17507a2c038301 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/79dd982e6cefb84d959fc7a4fd17507a2c038301/vistrail_controller.py |
def perform_operation(self, op): # print "doing %s %s %s" % (op.id, op.vtType, op.what) if op.db_what == 'abstraction' or op.db_what == 'group': what = 'module' else: what = op.db_what funname = '%s_%s' % (op.vtType, what) | b5c3650e5ca6e90a88141bb0bb0d6f102203f909 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/b5c3650e5ca6e90a88141bb0bb0d6f102203f909/pipeline.py |
||
if op.vtType == 'add': f(op.data, op.parentObjId, op.parentObjType) elif op.vtType == 'delete': f(op.objectId, op.parentObjId, op.parentObjType) elif op.vtType == 'change': f(op.oldObjId, op.data, op.parentObjId, op.parentObjType) | def perform_operation(self, op): # print "doing %s %s %s" % (op.id, op.vtType, op.what) if op.db_what == 'abstraction' or op.db_what == 'group': what = 'module' else: what = op.db_what funname = '%s_%s' % (op.vtType, what) | b5c3650e5ca6e90a88141bb0bb0d6f102203f909 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/b5c3650e5ca6e90a88141bb0bb0d6f102203f909/pipeline.py |
|
if op.vtType == 'add': f(op.data, op.parentObjType, op.parentObjId) elif op.vtType == 'delete': f(op.objectId, op.what, op.parentObjType, op.parentObjId) elif op.vtType == 'change': f(op.oldObjId, op.data, op.parentObjType, op.parentObjId) | def perform_operation(self, op): # print "doing %s %s %s" % (op.id, op.vtType, op.what) if op.db_what == 'abstraction' or op.db_what == 'group': what = 'module' else: what = op.db_what funname = '%s_%s' % (op.vtType, what) | b5c3650e5ca6e90a88141bb0bb0d6f102203f909 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/b5c3650e5ca6e90a88141bb0bb0d6f102203f909/pipeline.py |
|
msg = "Pipeline cannot execute '%s' operation" % op.vtType | msg = "Pipeline cannot execute '%s %s' operation" % \ (op.vtType, op.what) | def perform_operation(self, op): # print "doing %s %s %s" % (op.id, op.vtType, op.what) if op.db_what == 'abstraction' or op.db_what == 'group': what = 'module' else: what = op.db_what funname = '%s_%s' % (op.vtType, what) | b5c3650e5ca6e90a88141bb0bb0d6f102203f909 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/b5c3650e5ca6e90a88141bb0bb0d6f102203f909/pipeline.py |
raise VistrailsInternalError("duplicate module id") | raise VistrailsInternalError("duplicate module id: %d" % m.id ) | def add_module(self, m, *args): """add_module(m: Module) -> None Add new module to pipeline """ if self.has_module_with_id(m.id): raise VistrailsInternalError("duplicate module id") | b5c3650e5ca6e90a88141bb0bb0d6f102203f909 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/b5c3650e5ca6e90a88141bb0bb0d6f102203f909/pipeline.py |
def add_parameter(self, param, parent_id, parent_type=ModuleFunction.vtType): | def add_parameter(self, param, parent_type, parent_id): | def add_parameter(self, param, parent_id, parent_type=ModuleFunction.vtType): self.db_add_object(param, parent_type, parent_id) if not self.has_alias(param.alias): self.change_alias(param.alias, param.vtType, param.real_id, parent_type, parent_id, None) | b5c3650e5ca6e90a88141bb0bb0d6f102203f909 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/b5c3650e5ca6e90a88141bb0bb0d6f102203f909/pipeline.py |
def delete_parameter(self, param_id, parent_id, parent_type=ModuleFunction.vtType): | def delete_parameter(self, param_id, param_type, parent_type, parent_id): | def delete_parameter(self, param_id, parent_id, parent_type=ModuleFunction.vtType): self.db_delete_object(param_id, ModuleParam.vtType, parent_type, parent_id) self.remove_alias(ModuleParam.vtType, param_id, parent_type, parent_id, None) | b5c3650e5ca6e90a88141bb0bb0d6f102203f909 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/b5c3650e5ca6e90a88141bb0bb0d6f102203f909/pipeline.py |
self.remove_alias(ModuleParam.vtType, param_id, parent_type, parent_id, None) def change_parameter(self, old_param_id, param, parent_id, parent_type=ModuleFunction.vtType): | self.remove_alias(ModuleParam.vtType, param_id, parent_type, parent_id, None) def change_parameter(self, old_param_id, param, parent_type, parent_id): | def delete_parameter(self, param_id, parent_id, parent_type=ModuleFunction.vtType): self.db_delete_object(param_id, ModuleParam.vtType, parent_type, parent_id) self.remove_alias(ModuleParam.vtType, param_id, parent_type, parent_id, None) | b5c3650e5ca6e90a88141bb0bb0d6f102203f909 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/b5c3650e5ca6e90a88141bb0bb0d6f102203f909/pipeline.py |
def add_port(self, port, parent_id, parent_type=Connection.vtType): | def add_port(self, port, parent_type, parent_id): | def add_port(self, port, parent_id, parent_type=Connection.vtType): self.db_add_object(port, parent_type, parent_id) connection = self.connections[parent_id] if connection.source is not None and \ connection.destination is not None: self.graph.add_edge(connection.sourceId, connection.destinationId, connection.id) | b5c3650e5ca6e90a88141bb0bb0d6f102203f909 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/b5c3650e5ca6e90a88141bb0bb0d6f102203f909/pipeline.py |
def delete_port(self, port_id, parent_id, parent_type=Connection.vtType): | def delete_port(self, port_id, port_type, parent_type, parent_id): | def delete_port(self, port_id, parent_id, parent_type=Connection.vtType): connection = self.connections[parent_id] if len(connection.ports) >= 2: self.graph.delete_edge(connection.sourceId, connection.destinationId, connection.id) self.db_delete_object(port_id, Port.vtType, parent_type, parent_id) | b5c3650e5ca6e90a88141bb0bb0d6f102203f909 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/b5c3650e5ca6e90a88141bb0bb0d6f102203f909/pipeline.py |
def change_port(self, old_port_id, port, parent_id, parent_type=Connection.vtType): | def change_port(self, old_port_id, port, parent_type, parent_id): | def change_port(self, old_port_id, port, parent_id, parent_type=Connection.vtType): connection = self.connections[parent_id] if len(connection.ports) >= 2: source_list = self.graph.adjacency_list[connection.sourceId] source_list.remove((connection.destinationId, connection.id)) dest_list = \ self.graph.inverse_adjacency_list[connection.destinationId] dest_list.remove((connection.sourceId, connection.id)) self.db_change_object(old_port_id, port, parent_type, parent_id) if len(connection.ports) >= 2: source_list = self.graph.adjacency_list[connection.sourceId] source_list.append((connection.destinationId, connection.id)) dest_list = \ self.graph.inverse_adjacency_list[connection.destinationId] dest_list.append((connection.sourceId, connection.id)) | b5c3650e5ca6e90a88141bb0bb0d6f102203f909 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/b5c3650e5ca6e90a88141bb0bb0d6f102203f909/pipeline.py |
def add_portSpec(self, port_spec, parent_id, parent_type=Module.vtType): | def add_portSpec(self, port_spec, parent_type, parent_id): | def add_portSpec(self, port_spec, parent_id, parent_type=Module.vtType): # self.db_add_object(port_spec, parent_type, parent_id) self.add_port_to_registry(port_spec, parent_id) | b5c3650e5ca6e90a88141bb0bb0d6f102203f909 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/b5c3650e5ca6e90a88141bb0bb0d6f102203f909/pipeline.py |
def delete_portSpec(self, spec_id, parent_id, parent_type=Module.vtType): | def delete_portSpec(self, spec_id, portSpec_type, parent_type, parent_id): | def delete_portSpec(self, spec_id, parent_id, parent_type=Module.vtType): self.delete_port_from_registry(spec_id, parent_id) # self.db_delete_object(spec_id, PortSpec.vtType, parent_type, parent_id) | b5c3650e5ca6e90a88141bb0bb0d6f102203f909 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/b5c3650e5ca6e90a88141bb0bb0d6f102203f909/pipeline.py |
def change_portSpec(self, old_spec_id, port_spec, parent_id, parent_type=Module.vtType): | def change_portSpec(self, old_spec_id, port_spec, parent_type, parent_id): | def change_portSpec(self, old_spec_id, port_spec, parent_id, parent_type=Module.vtType): self.delete_port_from_registry(old_spec_id, parent_id) # self.db_change_object(old_spec_id, port_spec, parent_type, parent_id) self.add_port_to_registry(port_spec, parent_id) | b5c3650e5ca6e90a88141bb0bb0d6f102203f909 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/b5c3650e5ca6e90a88141bb0bb0d6f102203f909/pipeline.py |
striplen = len("<paramexps>") xmlString = xmlString[striplen:-(striplen+1)].strip() self.setParameterExploration(xmlString) | if xmlString is not None: striplen = len("<paramexps>") xmlString = xmlString[striplen:-(striplen+1)].strip() self.setParameterExploration(xmlString) | def showEvent(self, event): """ showEvent(event: QShowEvent) -> None Update the tab when it is shown """ if self.currentVersion!=self.controller.current_version: self.currentVersion = self.controller.current_version # Update the virtual cell pipeline = self.controller.current_pipeline self.virtualCell.updateVirtualCell(pipeline) | 4366e52c39cf6d792b58b30906139f544ef43f61 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/4366e52c39cf6d792b58b30906139f544ef43f61/pe_tab.py |
cmdline = ['unzip', '-q','-o','-d', vt_save_dir, shell_quote(filename)] | cmdline = ['unzip', '-q','-o','-d', vt_save_dir, mkarg(filename).strip()] | def open_vistrail_bundle_from_zip_xml(filename): """open_vistrail_bundle_from_zip_xml(filename) -> SaveBundle Open a vistrail from a zip compressed format. It expects that the vistrail file inside archive has name 'vistrail', the log inside archive has name 'log', abstractions inside archive have prefix 'abstraction_', and thumbnails inside archive are '.png' files in 'thumbs' dir """ core.requirements.require_executable('unzip') vt_save_dir = tempfile.mkdtemp(prefix='vt_save') output = [] cmdline = ['unzip', '-q','-o','-d', vt_save_dir, shell_quote(filename)] result = execute_cmdline(cmdline, output) if result != 0 and len(output) != 0: raise VistrailsDBException("Unzip of '%s' failed" % filename) vistrail = None log = None log_fname = None abstraction_files = [] unknown_files = [] thumbnail_files = [] try: for root, dirs, files in os.walk(vt_save_dir): for fname in files: if fname == 'vistrail' and root == vt_save_dir: vistrail = open_vistrail_from_xml(os.path.join(root, fname)) elif fname == 'log' and root == vt_save_dir: # FIXME read log to get execution info # right now, just ignore the file log = None log_fname = os.path.join(root, fname) # log = open_log_from_xml(os.path.join(root, fname)) # objs.append(DBLog.vtType, log) elif fname.startswith('abstraction_'): abstraction_file = os.path.join(root, fname) abstraction_files.append(abstraction_file) elif (fname.endswith('.png') and root == os.path.join(vt_save_dir,'thumbs')): thumbnail_file = os.path.join(root, fname) thumbnail_files.append(thumbnail_file) else: unknown_files.append(os.path.join(root, fname)) except OSError, e: raise VistrailsDBException("Error when reading vt file") if len(unknown_files) > 0: raise VistrailsDBException("Unknown files in vt file: %s" % \ unknown_files) if vistrail is None: raise VistrailsDBException("vt file does not contain vistrail") vistrail.db_log_filename = log_fname save_bundle = SaveBundle(DBVistrail.vtType, vistrail, log, abstractions=abstraction_files, thumbnails=thumbnail_files) return (save_bundle, vt_save_dir) | 7f4d8fcbc6191b00fb95a0fa20060349f7a2485a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/7f4d8fcbc6191b00fb95a0fa20060349f7a2485a/io.py |
def create_action_from_ops(ops): | def create_action_from_ops(ops, simplify=False): | def create_action_from_ops(ops): if len(ops) > 0: from core.vistrail.action import Action action = db.services.action.create_action_from_ops(ops) Action.convert(action) return action return None | dacb793e5081be065f6080315858093206b51e91 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/dacb793e5081be065f6080315858093206b51e91/action.py |
action = db.services.action.create_action_from_ops(ops) | action = db.services.action.create_action_from_ops(ops, simplify) | def create_action_from_ops(ops): if len(ops) > 0: from core.vistrail.action import Action action = db.services.action.create_action_from_ops(ops) Action.convert(action) return action return None | dacb793e5081be065f6080315858093206b51e91 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/dacb793e5081be065f6080315858093206b51e91/action.py |
self.server_logger.debug(4) | def get_vt_graph_png(self, host, port, db_name, vt_id): """get_vt_graph_png(host:str, port: str, db_name: str, vt_id:str) -> str Returns the relative url of the generated image """ | efa5ade4b1450c9b6f190d7df7bbfc31f460f007 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/efa5ade4b1450c9b6f190d7df7bbfc31f460f007/application_server.py |
|
except ImportError, e: self._init_module = self._module | def initialize(self, existing_paths=None): self._override_import(existing_paths) try: try: name = self.prefix + self.codepath + '.init' __import__(name, globals(), locals(), []) self._init_module = sys.modules[name] self._imported_paths.add(name) # Copy attributes (shallow) from _module into _init_module's namespace and point _module to _init_module module_attributes = ['identifier', 'name', 'version', 'configuration', 'package_dependencies', 'package_requirements'] for attr in module_attributes: if hasattr(self._module, attr): setattr(self._init_module, attr, getattr(self._module, attr)) self._module = self._init_module except ImportError, e: self._init_module = self._module | 5ef6eaca617ce7d40d2caf68a0277f6901a9e251 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/5ef6eaca617ce7d40d2caf68a0277f6901a9e251/package.py |
|
self.display(RichTextCellWidget, (fileValue,)) | self.cellWidget = self.displayAndWait(RichTextCellWidget, (fileValue,)) | def compute(self): """ compute() -> None Dispatch the HTML contents to the spreadsheet """ if self.hasInputFromPort("File"): fileValue = self.getInputFromPort("File") else: fileValue = None self.display(RichTextCellWidget, (fileValue,)) | 316ddc1302b89bc589aa677ecaef12e7dad20405 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/316ddc1302b89bc589aa677ecaef12e7dad20405/richtext.py |
if m1.db_tag != m2.db_tag: return True | def module_text_has_changed(self, m1, m2): # 2008-06-25 cscheid # This is a hot-path for QPipelineView.setupScene, so we cut # some corners # # 2008-07-08 cscheid # Can't use direct __dict__ lookup because both groups and # modules end up here. if m1.db_tag != m2.db_tag: return True m1_has = '__desc__' in m1.db_annotations_key_index if (m1_has != '__desc__' in m2.db_annotations_key_index): return True if (m1_has and # m2_has, since m1_has and previous condition m1.db_annotations_key_index['__desc__'].value.strip()!= m2.db_annotations_key_index['__desc__'].value.strip()): return True return False | f7a680e15dda9f47233cfaf9fa4617e16c9dda6f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/f7a680e15dda9f47233cfaf9fa4617e16c9dda6f/pipeline_view.py |
|
if (m1_has != '__desc__' in m2.db_annotations_key_index): | if m1_has != ('__desc__' in m2.db_annotations_key_index): | def module_text_has_changed(self, m1, m2): # 2008-06-25 cscheid # This is a hot-path for QPipelineView.setupScene, so we cut # some corners # # 2008-07-08 cscheid # Can't use direct __dict__ lookup because both groups and # modules end up here. if m1.db_tag != m2.db_tag: return True m1_has = '__desc__' in m1.db_annotations_key_index if (m1_has != '__desc__' in m2.db_annotations_key_index): return True if (m1_has and # m2_has, since m1_has and previous condition m1.db_annotations_key_index['__desc__'].value.strip()!= m2.db_annotations_key_index['__desc__'].value.strip()): return True return False | f7a680e15dda9f47233cfaf9fa4617e16c9dda6f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/f7a680e15dda9f47233cfaf9fa4617e16c9dda6f/pipeline_view.py |
print str(e) | debug.critical(str(e)) | def check_user_projects(self): # are we logged in? if not self.dialog.cookiejar: self._repository_status['support_status'] = "Please login" self._repository_status['details'] = "" self.update_push_information() self._push_button.setEnabled(False) self._branch_button.hide() else: server_url = "%s/projects/get_user_projects/" % \ self.config.webRepositoryURL register_openers(cookiejar=self.dialog.cookiejar) try: request = urllib2.Request(server_url) get_servers = urllib2.urlopen(request) except urllib2.HTTPError, e: self._repository_status['support_status'] = "" self._repository_status['details'] = "" if e.code == 500: self._repository_status['support_status'] = \ ("Error connecting to repository (server side issues)") else: print str(e) | f2c524b1f99dd206d3cc04ebfb6cb554feee2d88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/f2c524b1f99dd206d3cc04ebfb6cb554feee2d88/repository.py |
self.serverCombo.addItem("%s (%s)" % (prj, srvr), srvr) | self.serverCombo.addItem("%s (%s)" % (prj, srvr), [prj, srvr]) | def check_user_projects(self): # are we logged in? if not self.dialog.cookiejar: self._repository_status['support_status'] = "Please login" self._repository_status['details'] = "" self.update_push_information() self._push_button.setEnabled(False) self._branch_button.hide() else: server_url = "%s/projects/get_user_projects/" % \ self.config.webRepositoryURL register_openers(cookiejar=self.dialog.cookiejar) try: request = urllib2.Request(server_url) get_servers = urllib2.urlopen(request) except urllib2.HTTPError, e: self._repository_status['support_status'] = "" self._repository_status['details'] = "" if e.code == 500: self._repository_status['support_status'] = \ ("Error connecting to repository (server side issues)") else: print str(e) | f2c524b1f99dd206d3cc04ebfb6cb554feee2d88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/f2c524b1f99dd206d3cc04ebfb6cb554feee2d88/repository.py |
server = self.serverCombo.itemData(index).toString() | server = self.serverCombo.itemData(index).toList()[1].toString() | def check_dependencies(self, index): """ determines if current VisTrail will be supported by the repository's VisTrail server """ | f2c524b1f99dd206d3cc04ebfb6cb554feee2d88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/f2c524b1f99dd206d3cc04ebfb6cb554feee2d88/repository.py |
print str(e) | debug.critical(str(e)) | def check_dependencies(self, index): """ determines if current VisTrail will be supported by the repository's VisTrail server """ | f2c524b1f99dd206d3cc04ebfb6cb554feee2d88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/f2c524b1f99dd206d3cc04ebfb6cb554feee2d88/repository.py |
server_packages = get_supported_packages.read().split("||") | server_packages = json.loads(get_supported_packages.read()) | def check_dependencies(self, index): """ determines if current VisTrail will be supported by the repository's VisTrail server """ | f2c524b1f99dd206d3cc04ebfb6cb554feee2d88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/f2c524b1f99dd206d3cc04ebfb6cb554feee2d88/repository.py |
def check_dependencies(self, index): """ determines if current VisTrail will be supported by the repository's VisTrail server """ | f2c524b1f99dd206d3cc04ebfb6cb554feee2d88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/f2c524b1f99dd206d3cc04ebfb6cb554feee2d88/repository.py |
||
""" self._default_perm_label.setText(("Default Global Permissions " "(only applicable to branching):")) """ | def check_dependencies(self, index): """ determines if current VisTrail will be supported by the repository's VisTrail server """ | f2c524b1f99dd206d3cc04ebfb6cb554feee2d88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/f2c524b1f99dd206d3cc04ebfb6cb554feee2d88/repository.py |
|
print "the vistrail has been deleted or doesn't exist" | def check_dependencies(self, index): """ determines if current VisTrail will be supported by the repository's VisTrail server """ | f2c524b1f99dd206d3cc04ebfb6cb554feee2d88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/f2c524b1f99dd206d3cc04ebfb6cb554feee2d88/repository.py |
|
project = self.serverCombo.itemData(self.serverCombo.currentIndex()).toList()[0].toString() if project == "Default": project = "" | def push_vistrail_to_repository(self, branching=False): """ uploads current VisTrail to web repository """ | f2c524b1f99dd206d3cc04ebfb6cb554feee2d88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/f2c524b1f99dd206d3cc04ebfb6cb554feee2d88/repository.py |
|
print "before check" | def push_vistrail_to_repository(self, branching=False): """ uploads current VisTrail to web repository """ | f2c524b1f99dd206d3cc04ebfb6cb554feee2d88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/f2c524b1f99dd206d3cc04ebfb6cb554feee2d88/repository.py |
|
print "getting version from web" | debug.log("getting version from web") | def push_vistrail_to_repository(self, branching=False): """ uploads current VisTrail to web repository """ | f2c524b1f99dd206d3cc04ebfb6cb554feee2d88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/f2c524b1f99dd206d3cc04ebfb6cb554feee2d88/repository.py |
print e | debug.critical(str(e)) | def push_vistrail_to_repository(self, branching=False): """ uploads current VisTrail to web repository """ | f2c524b1f99dd206d3cc04ebfb6cb554feee2d88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/f2c524b1f99dd206d3cc04ebfb6cb554feee2d88/repository.py |
print "repo login is %s" % self.config.webRepositoryLogin | def __init__(self, parent, status_bar, dialog): QtGui.QWidget.__init__(self, parent) self._status_bar = status_bar self.dialog = dialog | f2c524b1f99dd206d3cc04ebfb6cb554feee2d88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/f2c524b1f99dd206d3cc04ebfb6cb554feee2d88/repository.py |
|
print self.saveLogin.checkState() | print "save login state: ", self.saveLogin.checkState() | def clicked_on_login(self): """ Attempts to log into web repository stores auth cookie for session """ from gui.application import VistrailsApplication | f2c524b1f99dd206d3cc04ebfb6cb554feee2d88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/f2c524b1f99dd206d3cc04ebfb6cb554feee2d88/repository.py |
print "settings repo login" | print "setting repo login" | def clicked_on_login(self): """ Attempts to log into web repository stores auth cookie for session """ from gui.application import VistrailsApplication | f2c524b1f99dd206d3cc04ebfb6cb554feee2d88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/f2c524b1f99dd206d3cc04ebfb6cb554feee2d88/repository.py |
debug.critical("Couldn't start the instance on display: %s port: %s" % (virtual_display, port) | debug.critical("Couldn't start the instance on display: %s port: %s" % (virtual_display, port)) | def start_other_instances(self, number): self.others = [] host = self.temp_xml_rpc_options.server port = self.temp_xml_rpc_options.port virtual_display = 5 script = '/server/vistrails/trunk/scripts/start_vistrails_xvfb.sh' for x in xrange(number): port += 1 virtual_display += 1 args = [script,":%s"%virtual_display,host,str(port),'0', '0'] try: p = subprocess.Popen(args) time.sleep(20) self.others.append("http://%s:%s"%(host,port)) except Exception, e: debug.critical("Couldn't start the instance on display: %s port: %s" % (virtual_display, port) debug.critical("Exception: %s" % str(e)) | 2330702614f8f850a3f4996bc5a414af67312ad6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/2330702614f8f850a3f4996bc5a414af67312ad6/application_server.py |
try: self.updateFunctionPort() except ModuleError, e: raise ModuleErrors([e, ModuleError(self, "Error inside map: " + e.msg)]) | self.updateFunctionPort() | def compute(self): """The compute method for the Fold.""" | 4351b3f0102ff57fbab18c9de9fda1df6697ae0d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/4351b3f0102ff57fbab18c9de9fda1df6697ae0d/fold.py |
'int' : core.modules.basic_modules.Integer, 'short' : core.modules.basic_modules.Integer, 'byte' : core.modules.basic_modules.Integer, 'nonNegativeInteger' : core.modules.basic_modules.Integer, 'long' : core.modules.basic_modules.Integer, 'unsignedLong' : core.modules.basic_modules.Integer, | def addPortsToMethods(w): """ Add input and output ports to the VisTrails complex type modules. """ reg = core.modules.module_registry.get_module_registry() dictkey = w + "|Methods" complexsdict = webServicesmodulesDict[dictkey] keys = complexsdict.keys() for dictkey in keys: obj = complexsdict[dictkey] objtype = reg.get_module_by_name(identifier = identifier, name = obj.name, namespace = obj.namespace) #Add input ports for port in obj.ports[0]: try: nameport = str(port.name) Type = str(port.type[1]) if isArray(Type): Type = 'Array' Type = wsdlTypesDict[Type] reg.add_input_port(objtype,nameport,(Type, '')) except KeyError: try: modname = str(port.type[1]) dictkey = w + "|Types" typedict = webServicesmodulesDict[dictkey] dictkey = w + "." + modname typeObj = typedict[dictkey] Type = reg.get_module_by_name(identifier=identifier, name=typeObj.name, namespace=typeObj.namespace) reg.add_input_port(objtype,str(port.name),(Type, '')) except KeyError: pass #Add output ports for port in obj.ports[1]: try: nameport = str(port.name) Type = str(port.type[1]) if isArray(Type): Type = 'Array' Type = wsdlTypesDict[Type] reg.add_output_port(objtype,nameport,(Type, '')) except KeyError: try: modname = str(port.type[1]) dictkey = w + "|Types" typedict = webServicesmodulesDict[dictkey] dictkey = w + "." + modname typeObj = typedict[dictkey] Type = reg.get_module_by_name(identifier=identifier, name=typeObj.name, namespace=typeObj.namespace) reg.add_output_port(objtype,str(port.name),(Type, '')) except KeyError: pass | b1ea3ee5761e2f708792ea5cad2d54278c976040 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/b1ea3ee5761e2f708792ea5cad2d54278c976040/__init__.py |
|
'IDREFS': core.modules.basic_modules.String, 'ID': core.modules.basic_modules.String, | def addPortsToMethods(w): """ Add input and output ports to the VisTrails complex type modules. """ reg = core.modules.module_registry.get_module_registry() dictkey = w + "|Methods" complexsdict = webServicesmodulesDict[dictkey] keys = complexsdict.keys() for dictkey in keys: obj = complexsdict[dictkey] objtype = reg.get_module_by_name(identifier = identifier, name = obj.name, namespace = obj.namespace) #Add input ports for port in obj.ports[0]: try: nameport = str(port.name) Type = str(port.type[1]) if isArray(Type): Type = 'Array' Type = wsdlTypesDict[Type] reg.add_input_port(objtype,nameport,(Type, '')) except KeyError: try: modname = str(port.type[1]) dictkey = w + "|Types" typedict = webServicesmodulesDict[dictkey] dictkey = w + "." + modname typeObj = typedict[dictkey] Type = reg.get_module_by_name(identifier=identifier, name=typeObj.name, namespace=typeObj.namespace) reg.add_input_port(objtype,str(port.name),(Type, '')) except KeyError: pass #Add output ports for port in obj.ports[1]: try: nameport = str(port.name) Type = str(port.type[1]) if isArray(Type): Type = 'Array' Type = wsdlTypesDict[Type] reg.add_output_port(objtype,nameport,(Type, '')) except KeyError: try: modname = str(port.type[1]) dictkey = w + "|Types" typedict = webServicesmodulesDict[dictkey] dictkey = w + "." + modname typeObj = typedict[dictkey] Type = reg.get_module_by_name(identifier=identifier, name=typeObj.name, namespace=typeObj.namespace) reg.add_output_port(objtype,str(port.name),(Type, '')) except KeyError: pass | b1ea3ee5761e2f708792ea5cad2d54278c976040 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/b1ea3ee5761e2f708792ea5cad2d54278c976040/__init__.py |
|
'DBAction': {'annotations': update_annotations}} | 'DBAction': {'annotations': update_annotations}, 'DBParameter': {'type': update_type}, } | def update_workflow(old_obj, translate_dict): return DBWorkflow.update_version(old_obj.db_workflow, translate_dict) | 7fc79c75c3a8f49144f4369992292f2df0076e87 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/7fc79c75c3a8f49144f4369992292f2df0076e87/v1_0_1.py |
def perform_operation(self, op): # print "doing %s %s" % (op.vtType, op.what) if op.db_what == 'abstraction' or op.db_what == 'group': what = 'module' else: what = op.db_what funname = '%s_%s' % (op.vtType, what) | ac2974ce2bb1d8b18111f4c6d64b74f2d43f26d4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/ac2974ce2bb1d8b18111f4c6d64b74f2d43f26d4/pipeline.py |
||
module_version = module.version.split('.') | def find_descriptors(pipeline, module_ids=None): registry = get_module_registry() conf = get_vistrails_configuration() if module_ids == None: module_ids = pipeline.modules.iterkeys() exceptions = set() for mid in module_ids: module = pipeline.modules[mid] try: descriptor = registry.get_similar_descriptor( module.package, module.name, module.namespace, module.version, module.internal_version) pkg = registry.get_package_by_name(module.package) pkg_version = pkg.version.split('.') module_version = module.version.split('.') # FIXME: this split('.') should be a function somewhere. # The goal is to be able to compare them lexicographically | ac2974ce2bb1d8b18111f4c6d64b74f2d43f26d4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/ac2974ce2bb1d8b18111f4c6d64b74f2d43f26d4/pipeline.py |
|
if pkg_version < module_version: | if versions_increasing(pkg_version, module_version): | def find_descriptors(pipeline, module_ids=None): registry = get_module_registry() conf = get_vistrails_configuration() if module_ids == None: module_ids = pipeline.modules.iterkeys() exceptions = set() for mid in module_ids: module = pipeline.modules[mid] try: descriptor = registry.get_similar_descriptor( module.package, module.name, module.namespace, module.version, module.internal_version) pkg = registry.get_package_by_name(module.package) pkg_version = pkg.version.split('.') module_version = module.version.split('.') # FIXME: this split('.') should be a function somewhere. # The goal is to be able to compare them lexicographically | ac2974ce2bb1d8b18111f4c6d64b74f2d43f26d4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/ac2974ce2bb1d8b18111f4c6d64b74f2d43f26d4/pipeline.py |
if pkg_version > module_version: | elif versions_increasing(module_version, pkg_version): | def find_descriptors(pipeline, module_ids=None): registry = get_module_registry() conf = get_vistrails_configuration() if module_ids == None: module_ids = pipeline.modules.iterkeys() exceptions = set() for mid in module_ids: module = pipeline.modules[mid] try: descriptor = registry.get_similar_descriptor( module.package, module.name, module.namespace, module.version, module.internal_version) pkg = registry.get_package_by_name(module.package) pkg_version = pkg.version.split('.') module_version = module.version.split('.') # FIXME: this split('.') should be a function somewhere. # The goal is to be able to compare them lexicographically | ac2974ce2bb1d8b18111f4c6d64b74f2d43f26d4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/ac2974ce2bb1d8b18111f4c6d64b74f2d43f26d4/pipeline.py |
new_version = \ | (new_version, new_pipeline) = \ | def add_abstraction_to_registry(self, abs_vistrail, abs_fname, name, namespace=None, module_version=None, is_global=True, avail_fnames=[]): reg = core.modules.module_registry.get_module_registry() if namespace is None: namespace = \ abs_vistrail.get_annotation('__abstraction_uuid__').value | dd3b22f5f5d79fbbbfe29bca49c9a691f9fa5554 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/dd3b22f5f5d79fbbbfe29bca49c9a691f9fa5554/controller.py |
new_version) | new_version, new_pipeline) | def add_abstraction_to_registry(self, abs_vistrail, abs_fname, name, namespace=None, module_version=None, is_global=True, avail_fnames=[]): reg = core.modules.module_registry.get_module_registry() if namespace is None: namespace = \ abs_vistrail.get_annotation('__abstraction_uuid__').value | dd3b22f5f5d79fbbbfe29bca49c9a691f9fa5554 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/dd3b22f5f5d79fbbbfe29bca49c9a691f9fa5554/controller.py |
migrate_tags = get_vistrails_configuration().check("migrateTags") | should_migrate_tags = get_vistrails_configuration().check("migrateTags") | def flush_delayed_actions(self): start_version = self.current_version desc_key = Action.ANNOTATION_DESCRIPTION added_upgrade = False migrate_tags = get_vistrails_configuration().check("migrateTags") for action in self._delayed_actions: self.vistrail.add_action(action, start_version, self.current_session) # HACK to populate upgrade information if (action.has_annotation_with_key(desc_key) and action.get_annotation_by_key(desc_key).value == 'Upgrade'): self.vistrail.set_upgrade(start_version, str(action.id)) if migrate_tags: tag = self.vistrail.get_tag(start_version) if tag: self.vistrail.set_tag(start_version, "") self.vistrail.set_tag(action.id, tag) notes = self.vistrail.get_notes(start_version) if notes: self.vistrail.set_notes(start_version, "") self.vistrail.set_notes(action.id, notes) self.current_version = action.id start_version = action.id added_upgrade = True | 9c49285269ca706c8d38d0119e48b4cba5aa5d75 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/9c49285269ca706c8d38d0119e48b4cba5aa5d75/controller.py |
if migrate_tags: tag = self.vistrail.get_tag(start_version) if tag: self.vistrail.set_tag(start_version, "") self.vistrail.set_tag(action.id, tag) notes = self.vistrail.get_notes(start_version) if notes: self.vistrail.set_notes(start_version, "") self.vistrail.set_notes(action.id, notes) | if should_migrate_tags: self.migrate_tags(start_version, action.id) | def flush_delayed_actions(self): start_version = self.current_version desc_key = Action.ANNOTATION_DESCRIPTION added_upgrade = False migrate_tags = get_vistrails_configuration().check("migrateTags") for action in self._delayed_actions: self.vistrail.add_action(action, start_version, self.current_session) # HACK to populate upgrade information if (action.has_annotation_with_key(desc_key) and action.get_annotation_by_key(desc_key).value == 'Upgrade'): self.vistrail.set_upgrade(start_version, str(action.id)) if migrate_tags: tag = self.vistrail.get_tag(start_version) if tag: self.vistrail.set_tag(start_version, "") self.vistrail.set_tag(action.id, tag) notes = self.vistrail.get_notes(start_version) if notes: self.vistrail.set_notes(start_version, "") self.vistrail.set_notes(action.id, notes) self.current_version = action.id start_version = action.id added_upgrade = True | 9c49285269ca706c8d38d0119e48b4cba5aa5d75 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/9c49285269ca706c8d38d0119e48b4cba5aa5d75/controller.py |
ops.append(('add', new_module)) | def replace_generic(controller, pipeline, old_module, new_module, function_remap={}, src_port_remap={}, dst_port_remap={}, annotation_remap={}): ops = [] ops.extend(controller.delete_module_list_ops(pipeline, [old_module.id])) ops.append(('add', new_module)) for annotation in old_module.annotations: if annotation.key not in annotation_remap: annotation_key = annotation.key else: remap = annotation_remap[annotation.key] if remap is None: # don't add the annotation back in continue elif type(remap) != type(""): ops.extend(remap(annotation)) continue else: annotation_key = remap | a86f147e8adf8765e48f01a4a74e983d518ae3a3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/a86f147e8adf8765e48f01a4a74e983d518ae3a3/upgradeworkflow.py |
|
ops.extend( controller.update_annotation_ops(new_module, [(annotation_key, annotation.value)])) local_port_specs = {} | new_annotation = \ Annotation(id=controller.id_scope.getNewId(Annotation.vtType), key=annotation_key, value=annotation.value) new_module.add_annotation(new_annotation) | def replace_generic(controller, pipeline, old_module, new_module, function_remap={}, src_port_remap={}, dst_port_remap={}, annotation_remap={}): ops = [] ops.extend(controller.delete_module_list_ops(pipeline, [old_module.id])) ops.append(('add', new_module)) for annotation in old_module.annotations: if annotation.key not in annotation_remap: annotation_key = annotation.key else: remap = annotation_remap[annotation.key] if remap is None: # don't add the annotation back in continue elif type(remap) != type(""): ops.extend(remap(annotation)) continue else: annotation_key = remap | a86f147e8adf8765e48f01a4a74e983d518ae3a3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/a86f147e8adf8765e48f01a4a74e983d518ae3a3/upgradeworkflow.py |
local_port_specs[(new_spec.name, new_spec.type)] = new_spec ops.append(('add', new_spec, 'module', new_module.id)) print local_port_specs | new_module.add_port_spec(new_spec) | def replace_generic(controller, pipeline, old_module, new_module, function_remap={}, src_port_remap={}, dst_port_remap={}, annotation_remap={}): ops = [] ops.extend(controller.delete_module_list_ops(pipeline, [old_module.id])) ops.append(('add', new_module)) for annotation in old_module.annotations: if annotation.key not in annotation_remap: annotation_key = annotation.key else: remap = annotation_remap[annotation.key] if remap is None: # don't add the annotation back in continue elif type(remap) != type(""): ops.extend(remap(annotation)) continue else: annotation_key = remap | a86f147e8adf8765e48f01a4a74e983d518ae3a3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/a86f147e8adf8765e48f01a4a74e983d518ae3a3/upgradeworkflow.py |
ops.extend(controller.update_function_ops(new_module, | new_function = controller.create_function(new_module, | def replace_generic(controller, pipeline, old_module, new_module, function_remap={}, src_port_remap={}, dst_port_remap={}, annotation_remap={}): ops = [] ops.extend(controller.delete_module_list_ops(pipeline, [old_module.id])) ops.append(('add', new_module)) for annotation in old_module.annotations: if annotation.key not in annotation_remap: annotation_key = annotation.key else: remap = annotation_remap[annotation.key] if remap is None: # don't add the annotation back in continue elif type(remap) != type(""): ops.extend(remap(annotation)) continue else: annotation_key = remap | a86f147e8adf8765e48f01a4a74e983d518ae3a3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/a86f147e8adf8765e48f01a4a74e983d518ae3a3/upgradeworkflow.py |
new_param_vals)) | new_param_vals) new_module.add_function(new_function) ops.append(('add', new_module)) | def replace_generic(controller, pipeline, old_module, new_module, function_remap={}, src_port_remap={}, dst_port_remap={}, annotation_remap={}): ops = [] ops.extend(controller.delete_module_list_ops(pipeline, [old_module.id])) ops.append(('add', new_module)) for annotation in old_module.annotations: if annotation.key not in annotation_remap: annotation_key = annotation.key else: remap = annotation_remap[annotation.key] if remap is None: # don't add the annotation back in continue elif type(remap) != type(""): ops.extend(remap(annotation)) continue else: annotation_key = remap | a86f147e8adf8765e48f01a4a74e983d518ae3a3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/a86f147e8adf8765e48f01a4a74e983d518ae3a3/upgradeworkflow.py |
if ((src_port, 'output')) in local_port_specs: output_port_spec = local_port_specs[(src_port, 'output')] else: output_port_spec = \ src_module.get_port_spec(src_port, 'output') | output_port_spec = src_module.get_port_spec(src_port, 'output') | def create_new_connection(src_module, src_port, dst_module, dst_port): # spec -> name, type, signature output_port_id = controller.id_scope.getNewId(Port.vtType) if type(src_port) == type(""): if ((src_port, 'output')) in local_port_specs: output_port_spec = local_port_specs[(src_port, 'output')] else: output_port_spec = \ src_module.get_port_spec(src_port, 'output') output_port = Port(id=output_port_id, spec=output_port_spec, moduleId=src_module.id, moduleName=src_module.name) else: output_port = Port(id=output_port_id, name=src_port.name, type=src_port.type, signature=src_port.signature, moduleId=src_module.id, moduleName=src_module.name) | a86f147e8adf8765e48f01a4a74e983d518ae3a3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/a86f147e8adf8765e48f01a4a74e983d518ae3a3/upgradeworkflow.py |
if ((dst_port, 'input')) in local_port_specs: input_port_spec = local_port_specs[(dst_port, 'input')] else: input_port_spec = \ dst_module.get_port_spec(dst_port, 'input') | input_port_spec = dst_module.get_port_spec(dst_port, 'input') | def create_new_connection(src_module, src_port, dst_module, dst_port): # spec -> name, type, signature output_port_id = controller.id_scope.getNewId(Port.vtType) if type(src_port) == type(""): if ((src_port, 'output')) in local_port_specs: output_port_spec = local_port_specs[(src_port, 'output')] else: output_port_spec = \ src_module.get_port_spec(src_port, 'output') output_port = Port(id=output_port_id, spec=output_port_spec, moduleId=src_module.id, moduleName=src_module.name) else: output_port = Port(id=output_port_id, name=src_port.name, type=src_port.type, signature=src_port.signature, moduleId=src_module.id, moduleName=src_module.name) | a86f147e8adf8765e48f01a4a74e983d518ae3a3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/a86f147e8adf8765e48f01a4a74e983d518ae3a3/upgradeworkflow.py |
self._tf = pickle.loads(param.strValue.decode('hex')) | self._tf = TransferFunction.parse(param.strValue) | def __init__(self, param, parent=None): QtGui.QWidget.__init__(self, parent) ConstantWidgetMixin.__init__(self, param.strValue) if not param.strValue: self._tf = copy.copy(default_tf) else: self._tf = pickle.loads(param.strValue.decode('hex')) self._scene = TransferFunctionScene(self._tf, self) layout = QtGui.QVBoxLayout() self.setLayout(layout) self._view = TransferFunctionView() self._view.setScene(self._scene) self._view.setMinimumSize(200,200) self._view.show() self._view.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) self._view.setMatrix(QtGui.QMatrix(180, 0, 0, -180, 0, 0)) self.setMinimumSize(200,200) caption = QtGui.QLabel("Double-click on the line to add a point") font = QtGui.QFont('Arial', 11) font.setItalic(True) caption.setFont(font) layout.addWidget(self._view) layout.addWidget(caption) | 4d34e53c4d49b7601ed33bcc0a2bfa1bf42e8bb8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/4d34e53c4d49b7601ed33bcc0a2bfa1bf42e8bb8/tf_widget.py |
self._view = TransferFunctionView() | self._view = TransferFunctionView(self) | def __init__(self, param, parent=None): QtGui.QWidget.__init__(self, parent) ConstantWidgetMixin.__init__(self, param.strValue) if not param.strValue: self._tf = copy.copy(default_tf) else: self._tf = pickle.loads(param.strValue.decode('hex')) self._scene = TransferFunctionScene(self._tf, self) layout = QtGui.QVBoxLayout() self.setLayout(layout) self._view = TransferFunctionView() self._view.setScene(self._scene) self._view.setMinimumSize(200,200) self._view.show() self._view.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) self._view.setMatrix(QtGui.QMatrix(180, 0, 0, -180, 0, 0)) self.setMinimumSize(200,200) caption = QtGui.QLabel("Double-click on the line to add a point") font = QtGui.QFont('Arial', 11) font.setItalic(True) caption.setFont(font) layout.addWidget(self._view) layout.addWidget(caption) | 4d34e53c4d49b7601ed33bcc0a2bfa1bf42e8bb8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/4d34e53c4d49b7601ed33bcc0a2bfa1bf42e8bb8/tf_widget.py |
return pickle.dumps(self._scene.get_transfer_function()).encode('hex') | return self._scene.get_transfer_function().serialize() | def contents(self): return pickle.dumps(self._scene.get_transfer_function()).encode('hex') | 4d34e53c4d49b7601ed33bcc0a2bfa1bf42e8bb8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/4d34e53c4d49b7601ed33bcc0a2bfa1bf42e8bb8/tf_widget.py |
self._tf = pickle.loads(strValue.decode('hex')) | self._tf = TransferFunction.parse(strValue) | def setContents(self, strValue, silent=True): if not strValue: self._tf = copy.copy(default_tf) else: self._tf = pickle.loads(strValue.decode('hex')) self._scene.reset_transfer_function(self._tf) if not silent: self.update_parent() | 4d34e53c4d49b7601ed33bcc0a2bfa1bf42e8bb8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/4d34e53c4d49b7601ed33bcc0a2bfa1bf42e8bb8/tf_widget.py |
string_conversion = staticmethod(lambda x: pickle.dumps(x).encode('hex')) conversion = staticmethod(lambda x: pickle.loads(x.decode('hex'))) | string_conversion = staticmethod(lambda x: x.serialize()) conversion = staticmethod(lambda x: TransferFunction.parse(x)) | def compute(self): tf = self.getInputFromPort('TransferFunction') new_tf = copy.copy(tf) if self.hasInputFromPort('Input'): port = self.getInputFromPort('Input') algo = port.vtkInstance.GetProducer() output = algo.GetOutput(port.vtkInstance.GetIndex()) (new_tf._min_range, new_tf._max_range) = output.GetScalarRange() elif self.hasInputFromPort('Dataset'): algo = self.getInputFromPort('Dataset').vtkInstance output = algo (new_tf._min_range, new_tf._max_range) = output.GetScalarRange() else: (new_tf._min_range, new_tf._max_range) = self.getInputFromPort('Range') self.setResult('TransferFunction', new_tf) | 4d34e53c4d49b7601ed33bcc0a2bfa1bf42e8bb8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/4d34e53c4d49b7601ed33bcc0a2bfa1bf42e8bb8/tf_widget.py |
vp = '_%s_void_p' % (hex(display)[2:]) | vp = '_%s_void_p\0x00' % (hex(display)[2:]) | def SetRenderWindow(self,w): """ SetRenderWindow(w: vtkRenderWindow) Set a new render window to QVTKWidget and initialize the interactor as well """ if w == self.mRenWin: return if self.mRenWin: if system.systemType!='Linux': self.mRenWin.SetInteractor(None) if self.mRenWin.GetMapped(): self.mRenWin.Finalize() self.mRenWin = w if self.mRenWin: self.mRenWin.Register(None) if self.mRenWin.GetMapped(): self.mRenWin.Finalize() if system.systemType=='Linux': try: vp = '_%s_void_p' % (hex(int(QtGui.QX11Info.display()))[2:]) except TypeError: #This was change for PyQt4.2 if isinstance(QtGui.QX11Info.display(),QtGui.Display): display = sip.unwrapinstance(QtGui.QX11Info.display()) vp = '_%s_void_p' % (hex(display)[2:]) self.mRenWin.SetDisplayId(vp) self.resizeWindow(1,1) self.mRenWin.SetWindowInfo(str(int(self.winId()))) if self.isVisible(): self.mRenWin.Start() | b751a0fa8cd98dab593f99486f175be76568e1f9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/b751a0fa8cd98dab593f99486f175be76568e1f9/vtkcell.py |
def download(url,filename): """download(url:string, filename: string) -> Boolean Downloads a binary file from url to filename and returns True (success) or False (failure) """ try: furl = urllib2.urlopen(url) f = file(filename,'wb') f.write(furl.read()) f.close() return True except: return False def download_as_text(url): """download_as_text(url: string) -> string Downloads a url as text. It will return None if it failed. """ try: furl = urllib2.urlopen(url) s = furl.read() return s except: return None def _download_content(url, request, path_to_figures): """_download_images(url:string, request:string, path_to_figures:string) -> (Boolean, message) Downloads all images and pdf files listed in url and saves them to path_to_figures """ website = url url = request try: page = download_as_text(url) re_imgs = re.compile('<img[^>]*/>') re_src = re.compile('(.*src=")([^"]*)"') re_a = re.compile('<a[^>]*>[^<]*</a>') re_href = re.compile('(.*href=")([^"]*)"') images = re_imgs.findall(page) files = re_a.findall(page) failed = False msg = '' if len(images) > 0 or len(files) > 0: for i in images: pngfile = re_src.match(i).groups()[1] if not check_url(pngfile): img = website + pngfile else: img = pngfile if not download(img, os.path.join(path_to_figures, os.path.basename(img))): msg += "Error when downloading image: %s. <return>" %img failed = True for f in files: otherfile = re_href.match(f).groups()[1] if not check_url(otherfile): filename = website + otherfile else: filename = otherfile if not download(filename, os.path.join(path_to_figures, os.path.basename(filename))): msg += "Error when downloading file: %s. <return>"%filename failed = True if not failed : return (True, "") else: return (False, msg) else: msg = "Web server returned: %s" % page return (False, msg) except Exception, e: return (False, str(e)) | def path_exists_and_not_empty(path): """path_exists_and_not_empty(path:str) -> boolean Returns True if given path exists and it's not empty, otherwise returns False. """ if os.path.exists(path): for root, dirs, file_names in os.walk(path): break if len(file_names) > 0: return True return False | 3123297d6a1b374a7b720af850b6ee46e7955b16 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/3123297d6a1b374a7b720af850b6ee46e7955b16/includevistrail.py |
|
port, path_to_figures): | port, path_to_figures, pdf=False, graph=False): | def build_vistrails_cmd_line(path_to_vistrails, host, db_name, vt_id, version, port, path_to_figures): """ build_vistrails_cmd_line(path_to_vistrails: str, host: str, db_name: str, vt_id: str, version: str, path_to_figures: str) -> str Build the command line to run vistrails with the given parameters. """ cmd_line = 'python "%s" -b -e "%s" -t %s -f %s -r %s -u %s "%s:%s" > \ | 3123297d6a1b374a7b720af850b6ee46e7955b16 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/3123297d6a1b374a7b720af850b6ee46e7955b16/includevistrail.py |
cmd_line = 'python "%s" -b -e "%s" -t %s -f %s -r %s -u %s "%s:%s" > \ vistrails.log' % (vt_user, path_to_vistrails, | if pdf: pdfoption = "-p" else: pdfoption = "" if graph: graphoption = '-I %s'%path_to_figures else: graphoption = "" if version is not None: voption = ":%s"%version else: voption = '' cmd_line = 'python "%s" -b -e "%s" -t %s -f %s -r %s %s %s "%s%s" > \ vistrails.log' % (path_to_vistrails, | def build_vistrails_cmd_line(path_to_vistrails, host, db_name, vt_id, version, port, path_to_figures): """ build_vistrails_cmd_line(path_to_vistrails: str, host: str, db_name: str, vt_id: str, version: str, path_to_figures: str) -> str Build the command line to run vistrails with the given parameters. """ cmd_line = 'python "%s" -b -e "%s" -t %s -f %s -r %s -u %s "%s:%s" > \ | 3123297d6a1b374a7b720af850b6ee46e7955b16 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/3123297d6a1b374a7b720af850b6ee46e7955b16/includevistrail.py |
version) | voption) | def build_vistrails_cmd_line(path_to_vistrails, host, db_name, vt_id, version, port, path_to_figures): """ build_vistrails_cmd_line(path_to_vistrails: str, host: str, db_name: str, vt_id: str, version: str, path_to_figures: str) -> str Build the command line to run vistrails with the given parameters. """ cmd_line = 'python "%s" -b -e "%s" -t %s -f %s -r %s -u %s "%s:%s" > \ | 3123297d6a1b374a7b720af850b6ee46e7955b16 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/3123297d6a1b374a7b720af850b6ee46e7955b16/includevistrail.py |
def generate_latex(host, db_name, vt_id, version, port, tag, execute, showspreadsheetonly, path_to_figures, graphics_options): | def generate_latex(download_url, host, db_name, vt_id, version, port, tag, execute, showspreadsheetonly, path_to_figures, graphics_options): | def generate_latex(host, db_name, vt_id, version, port, tag, execute, showspreadsheetonly, path_to_figures, graphics_options): """generate_latex(host: str, db_name:str, vt_id: str, version: str, port:str, tag: str, execute: bool, showspreadsheetonly: bool, path_to_figures: str, graphics_options: str) -> str This generates a piece of latex code containing the \href command and a \includegraphics command for each image generated. """ url_params = "getvt=%s&version=%s&db=%s&host=%s&port=%s&tag=%s&\ | 3123297d6a1b374a7b720af850b6ee46e7955b16 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/3123297d6a1b374a7b720af850b6ee46e7955b16/includevistrail.py |
url_params = "getvt=%s&version=%s&db=%s&host=%s&port=%s&tag=%s&\ | if download_url is not None and download_url != "": url_params = "getvt=%s&db=%s&host=%s&port=%s&tag=%s&\ | def generate_latex(host, db_name, vt_id, version, port, tag, execute, showspreadsheetonly, path_to_figures, graphics_options): """generate_latex(host: str, db_name:str, vt_id: str, version: str, port:str, tag: str, execute: bool, showspreadsheetonly: bool, path_to_figures: str, graphics_options: str) -> str This generates a piece of latex code containing the \href command and a \includegraphics command for each image generated. """ url_params = "getvt=%s&version=%s&db=%s&host=%s&port=%s&tag=%s&\ | 3123297d6a1b374a7b720af850b6ee46e7955b16 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/3123297d6a1b374a7b720af850b6ee46e7955b16/includevistrail.py |
urllib2.quote(version), | def generate_latex(host, db_name, vt_id, version, port, tag, execute, showspreadsheetonly, path_to_figures, graphics_options): """generate_latex(host: str, db_name:str, vt_id: str, version: str, port:str, tag: str, execute: bool, showspreadsheetonly: bool, path_to_figures: str, graphics_options: str) -> str This generates a piece of latex code containing the \href command and a \includegraphics command for each image generated. """ url_params = "getvt=%s&version=%s&db=%s&host=%s&port=%s&tag=%s&\ | 3123297d6a1b374a7b720af850b6ee46e7955b16 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/3123297d6a1b374a7b720af850b6ee46e7955b16/includevistrail.py |
|
url_params = url_params.replace("%","\%") url = "http://www.vistrails.org/extensions/download.php?%s"% url_params href = "\href{%s}{" % url | if version is not None: url_params += "&version=%s"%urllib2.quote(version) url_params = url_params.replace("%","\%") url = "%s?%s"%(download_url, url_params) href = "\href{%s}{" % url | def generate_latex(host, db_name, vt_id, version, port, tag, execute, showspreadsheetonly, path_to_figures, graphics_options): """generate_latex(host: str, db_name:str, vt_id: str, version: str, port:str, tag: str, execute: bool, showspreadsheetonly: bool, path_to_figures: str, graphics_options: str) -> str This generates a piece of latex code containing the \href command and a \includegraphics command for each image generated. """ url_params = "getvt=%s&version=%s&db=%s&host=%s&port=%s&tag=%s&\ | 3123297d6a1b374a7b720af850b6ee46e7955b16 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/3123297d6a1b374a7b720af850b6ee46e7955b16/includevistrail.py |
s += "}" return href+s | if download_url is not None and download_url != "": return href + s + "}" else: return s | def generate_latex(host, db_name, vt_id, version, port, tag, execute, showspreadsheetonly, path_to_figures, graphics_options): """generate_latex(host: str, db_name:str, vt_id: str, version: str, port:str, tag: str, execute: bool, showspreadsheetonly: bool, path_to_figures: str, graphics_options: str) -> str This generates a piece of latex code containing the \href command and a \includegraphics command for each image generated. """ url_params = "getvt=%s&version=%s&db=%s&host=%s&port=%s&tag=%s&\ | 3123297d6a1b374a7b720af850b6ee46e7955b16 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/3123297d6a1b374a7b720af850b6ee46e7955b16/includevistrail.py |
tag='', execute=False, showspreadsheetonly=False): | tag='', execute=False, showspreadsheetonly=False, pdf=False): | def run_vistrails_locally(path_to_vistrails, host, db_name, vt_id, version, port, path_to_figures, build_always=False, tag='', execute=False, showspreadsheetonly=False): """run_vistrails_locally(path_to_vistrails: str, host: str, db_name: str, vt_id: str, version: str, port: str, path_to_figures: str) -> tuple(bool, str) Run vistrails and returns a tuple containing a boolean saying if it was successful or not and the latex code. """ cmd_line = build_vistrails_cmd_line(path_to_vistrails, host, db_name, vt_id, version, port, path_to_figures) if not os.path.exists(path_to_figures): os.makedirs(path_to_figures) result = os.system(cmd_line) if result != 0: os.rmdir(path_to_figures) msg = "See vistrails.log for more information." return (False, generate_latex_error(msg)) else: if build_always or not path_exists_and_not_empty(path_to_figures): result = os.system(cmd_line) if result != 0: os.rmdir(path_to_figures) msg = "See vistrails.log for more information." return (False, generate_latex_error(msg)) return (True, generate_latex(host, db_name, vt_id, version, port, tag, execute, showspreadsheetonly, path_to_figures, graphics_options)) | 3123297d6a1b374a7b720af850b6ee46e7955b16 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/3123297d6a1b374a7b720af850b6ee46e7955b16/includevistrail.py |
version, port, path_to_figures) | version, port, path_to_figures, pdf) | def run_vistrails_locally(path_to_vistrails, host, db_name, vt_id, version, port, path_to_figures, build_always=False, tag='', execute=False, showspreadsheetonly=False): """run_vistrails_locally(path_to_vistrails: str, host: str, db_name: str, vt_id: str, version: str, port: str, path_to_figures: str) -> tuple(bool, str) Run vistrails and returns a tuple containing a boolean saying if it was successful or not and the latex code. """ cmd_line = build_vistrails_cmd_line(path_to_vistrails, host, db_name, vt_id, version, port, path_to_figures) if not os.path.exists(path_to_figures): os.makedirs(path_to_figures) result = os.system(cmd_line) if result != 0: os.rmdir(path_to_figures) msg = "See vistrails.log for more information." return (False, generate_latex_error(msg)) else: if build_always or not path_exists_and_not_empty(path_to_figures): result = os.system(cmd_line) if result != 0: os.rmdir(path_to_figures) msg = "See vistrails.log for more information." return (False, generate_latex_error(msg)) return (True, generate_latex(host, db_name, vt_id, version, port, tag, execute, showspreadsheetonly, path_to_figures, graphics_options)) | 3123297d6a1b374a7b720af850b6ee46e7955b16 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/3123297d6a1b374a7b720af850b6ee46e7955b16/includevistrail.py |
def run_vistrails_remotely(path_to_vistrails, host, db_name, vt_id, | def get_vt_graph_locally(path_to_vistrails, host, db_name, vt_id, port, path_to_figures, build_always=False, pdf=False): """get_vt_graph_locally(path_to_vistrails: str, host: str, db_name: str, vt_id: str, port: str, path_to_figures: str, build_always: bool, pdf:bool) -> tuple(bool, str) Run vistrails for loading a vistrail and dump the tree to a file and returns a tuple containing a boolean saying if it was successful or not and the latex code. """ cmd_line = build_vistrails_cmd_line(path_to_vistrails, host, db_name, vt_id, None, port, path_to_figures, pdf, graph=True) if not os.path.exists(path_to_figures): os.makedirs(path_to_figures) if build_always or not path_exists_and_not_empty(path_to_figures): result = os.system(cmd_line) if result != 0: os.rmdir(path_to_figures) msg = "See vistrails.log for more information." return (False, generate_latex_error(msg)) return (True, generate_latex(host, db_name, vt_id, None, port, '', False, False, path_to_figures, graphics_options)) def get_wf_graph_locally(path_to_vistrails, host, db_name, vt_id, version, port, path_to_figures, build_always=False, tag='', pdf=False): """run_vistrails_locally(path_to_vistrails: str, host: str, db_name: str, vt_id: str, version: str, port: str, path_to_figures: str,build_always: bool, tag: str, pdf:bool) -> tuple(bool, str) Run vistrails for loading a workflow and dump the graph to a file and returns a tuple containing a boolean saying if it was successful or not and the latex code. """ cmd_line = build_vistrails_cmd_line(path_to_vistrails, host, db_name, vt_id, version, port, path_to_figures, pdf, graph) if not os.path.exists(path_to_figures): os.makedirs(path_to_figures) result = os.system(cmd_line) if result != 0: os.rmdir(path_to_figures) msg = "See vistrails.log for more information." return (False, generate_latex_error(msg)) else: if build_always or not path_exists_and_not_empty(path_to_figures): result = os.system(cmd_line) if result != 0: os.rmdir(path_to_figures) msg = "See vistrails.log for more information." return (False, generate_latex_error(msg)) return (True, generate_latex(host, db_name, vt_id, version, port, tag, execute, showspreadsheetonly, path_to_figures, graphics_options)) def run_vistrails_remotely(path_to_vistrails, download_url, host, db_name, vt_id, | def run_vistrails_remotely(path_to_vistrails, host, db_name, vt_id, version, port, path_to_figures, build_always=False, tag='', execute=False, showspreadsheetonly=False, pdf=False): """run_vistrails_remotely(path_to_vistrails: str, host: str, db_name: str, vt_id: str, version: str, port: str, path_to_figures: str, build_always: bool, tag:str, execute: bool, showspreadsheetonly: bool, pdf: bool) -> tuple(bool, str) Run vistrails and returns a tuple containing a boolean saying if it was successful or not and the latex code. """ def download(url,filename): try: furl = urllib2.urlopen(url) f = file(filename,'wb') f.write(furl.read()) f.close() return True except: return False def download_as_text(url): try: furl = urllib2.urlopen(url) s = furl.read() return s except: return None if not path_exists_and_not_empty(path_to_figures) or build_always: if not os.path.exists(path_to_figures): os.makedirs(path_to_figures) if check_url(path_to_vistrails): website = "://".join(urlparse(path_to_vistrails)[:2]) request = "?host=%s&db=%s&vt=%s&version=%s&port=%s&pdf=%s" % (host, db_name, vt_id, urllib2.quote(version), port, pdf) url = path_to_vistrails + request #print url try: page = download_as_text(url) # we will look for images and other files embedded in the html re_imgs = re.compile('<img[^>]*/>') re_src = re.compile('(.*src=")([^"]*)"') re_a = re.compile('<a[^>]*>[^<]*</a>') re_href = re.compile('(.*href=")([^"]*)"') images = re_imgs.findall(page) files = re_a.findall(page) failed = False msg = '' if len(images) > 0 or len(files) > 0: for i in images: pngfile = re_src.match(i).groups()[1] if not check_url(pngfile): img = website + pngfile else: img = pngfile if not download(img, os.path.join(path_to_figures, os.path.basename(img))): msg += "Error when downloading image: %s. <return>" %\ img failed = True for f in files: otherfile = re_href.match(f).groups()[1] if not check_url(otherfile): filename = website + otherfile else: filename = otherfile if not download(filename, os.path.join(path_to_figures, os.path.basename(filename))): msg += "Error when downloading file: %s. <return>" %\ filename failed = True if not failed : return (True, generate_latex(host, db_name, vt_id, version, port, tag, execute, showspreadsheetonly, path_to_figures, graphics_options)) else: return (False, generate_latex_error(msg)) else: msg = "Web server returned: %s" % page return (False, generate_latex_error(msg)) except Exception, e: return (False, generate_latex_error(str(e))) else: msg = "Invalid url: %s" % path_to_vistrails return (False, generate_latex_error(msg)) else: return (True, generate_latex(host, db_name, vt_id, version, port, tag, execute, showspreadsheetonly, path_to_figures, graphics_options)) | 3123297d6a1b374a7b720af850b6ee46e7955b16 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/3123297d6a1b374a7b720af850b6ee46e7955b16/includevistrail.py |
"""run_vistrails_remotely(path_to_vistrails: str, host: str, | """run_vistrails_remotely(path_to_vistrails: str, download_url: str host: str, | def run_vistrails_remotely(path_to_vistrails, host, db_name, vt_id, version, port, path_to_figures, build_always=False, tag='', execute=False, showspreadsheetonly=False, pdf=False): """run_vistrails_remotely(path_to_vistrails: str, host: str, db_name: str, vt_id: str, version: str, port: str, path_to_figures: str, build_always: bool, tag:str, execute: bool, showspreadsheetonly: bool, pdf: bool) -> tuple(bool, str) Run vistrails and returns a tuple containing a boolean saying if it was successful or not and the latex code. """ def download(url,filename): try: furl = urllib2.urlopen(url) f = file(filename,'wb') f.write(furl.read()) f.close() return True except: return False def download_as_text(url): try: furl = urllib2.urlopen(url) s = furl.read() return s except: return None if not path_exists_and_not_empty(path_to_figures) or build_always: if not os.path.exists(path_to_figures): os.makedirs(path_to_figures) if check_url(path_to_vistrails): website = "://".join(urlparse(path_to_vistrails)[:2]) request = "?host=%s&db=%s&vt=%s&version=%s&port=%s&pdf=%s" % (host, db_name, vt_id, urllib2.quote(version), port, pdf) url = path_to_vistrails + request #print url try: page = download_as_text(url) # we will look for images and other files embedded in the html re_imgs = re.compile('<img[^>]*/>') re_src = re.compile('(.*src=")([^"]*)"') re_a = re.compile('<a[^>]*>[^<]*</a>') re_href = re.compile('(.*href=")([^"]*)"') images = re_imgs.findall(page) files = re_a.findall(page) failed = False msg = '' if len(images) > 0 or len(files) > 0: for i in images: pngfile = re_src.match(i).groups()[1] if not check_url(pngfile): img = website + pngfile else: img = pngfile if not download(img, os.path.join(path_to_figures, os.path.basename(img))): msg += "Error when downloading image: %s. <return>" %\ img failed = True for f in files: otherfile = re_href.match(f).groups()[1] if not check_url(otherfile): filename = website + otherfile else: filename = otherfile if not download(filename, os.path.join(path_to_figures, os.path.basename(filename))): msg += "Error when downloading file: %s. <return>" %\ filename failed = True if not failed : return (True, generate_latex(host, db_name, vt_id, version, port, tag, execute, showspreadsheetonly, path_to_figures, graphics_options)) else: return (False, generate_latex_error(msg)) else: msg = "Web server returned: %s" % page return (False, generate_latex_error(msg)) except Exception, e: return (False, generate_latex_error(str(e))) else: msg = "Invalid url: %s" % path_to_vistrails return (False, generate_latex_error(msg)) else: return (True, generate_latex(host, db_name, vt_id, version, port, tag, execute, showspreadsheetonly, path_to_figures, graphics_options)) | 3123297d6a1b374a7b720af850b6ee46e7955b16 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/3123297d6a1b374a7b720af850b6ee46e7955b16/includevistrail.py |
Run vistrails and returns a tuple containing a boolean saying if it was successful or not and the latex code. | Call vistrails remotely to execute a workflow and returns a tuple containing a boolean saying whether it was successful and the latex code. | def run_vistrails_remotely(path_to_vistrails, host, db_name, vt_id, version, port, path_to_figures, build_always=False, tag='', execute=False, showspreadsheetonly=False, pdf=False): """run_vistrails_remotely(path_to_vistrails: str, host: str, db_name: str, vt_id: str, version: str, port: str, path_to_figures: str, build_always: bool, tag:str, execute: bool, showspreadsheetonly: bool, pdf: bool) -> tuple(bool, str) Run vistrails and returns a tuple containing a boolean saying if it was successful or not and the latex code. """ def download(url,filename): try: furl = urllib2.urlopen(url) f = file(filename,'wb') f.write(furl.read()) f.close() return True except: return False def download_as_text(url): try: furl = urllib2.urlopen(url) s = furl.read() return s except: return None if not path_exists_and_not_empty(path_to_figures) or build_always: if not os.path.exists(path_to_figures): os.makedirs(path_to_figures) if check_url(path_to_vistrails): website = "://".join(urlparse(path_to_vistrails)[:2]) request = "?host=%s&db=%s&vt=%s&version=%s&port=%s&pdf=%s" % (host, db_name, vt_id, urllib2.quote(version), port, pdf) url = path_to_vistrails + request #print url try: page = download_as_text(url) # we will look for images and other files embedded in the html re_imgs = re.compile('<img[^>]*/>') re_src = re.compile('(.*src=")([^"]*)"') re_a = re.compile('<a[^>]*>[^<]*</a>') re_href = re.compile('(.*href=")([^"]*)"') images = re_imgs.findall(page) files = re_a.findall(page) failed = False msg = '' if len(images) > 0 or len(files) > 0: for i in images: pngfile = re_src.match(i).groups()[1] if not check_url(pngfile): img = website + pngfile else: img = pngfile if not download(img, os.path.join(path_to_figures, os.path.basename(img))): msg += "Error when downloading image: %s. <return>" %\ img failed = True for f in files: otherfile = re_href.match(f).groups()[1] if not check_url(otherfile): filename = website + otherfile else: filename = otherfile if not download(filename, os.path.join(path_to_figures, os.path.basename(filename))): msg += "Error when downloading file: %s. <return>" %\ filename failed = True if not failed : return (True, generate_latex(host, db_name, vt_id, version, port, tag, execute, showspreadsheetonly, path_to_figures, graphics_options)) else: return (False, generate_latex_error(msg)) else: msg = "Web server returned: %s" % page return (False, generate_latex_error(msg)) except Exception, e: return (False, generate_latex_error(str(e))) else: msg = "Invalid url: %s" % path_to_vistrails return (False, generate_latex_error(msg)) else: return (True, generate_latex(host, db_name, vt_id, version, port, tag, execute, showspreadsheetonly, path_to_figures, graphics_options)) | 3123297d6a1b374a7b720af850b6ee46e7955b16 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/3123297d6a1b374a7b720af850b6ee46e7955b16/includevistrail.py |
def download(url,filename): try: furl = urllib2.urlopen(url) f = file(filename,'wb') f.write(furl.read()) f.close() return True except: return False def download_as_text(url): try: furl = urllib2.urlopen(url) s = furl.read() return s except: return None | log("run_vistrails_remotely") | def download(url,filename): try: furl = urllib2.urlopen(url) f = file(filename,'wb') f.write(furl.read()) f.close() return True except: return False | 3123297d6a1b374a7b720af850b6ee46e7955b16 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/3123297d6a1b374a7b720af850b6ee46e7955b16/includevistrail.py |
try: page = download_as_text(url) re_imgs = re.compile('<img[^>]*/>') re_src = re.compile('(.*src=")([^"]*)"') re_a = re.compile('<a[^>]*>[^<]*</a>') re_href = re.compile('(.*href=")([^"]*)"') images = re_imgs.findall(page) files = re_a.findall(page) failed = False msg = '' if len(images) > 0 or len(files) > 0: for i in images: pngfile = re_src.match(i).groups()[1] if not check_url(pngfile): img = website + pngfile else: img = pngfile if not download(img, os.path.join(path_to_figures, os.path.basename(img))): msg += "Error when downloading image: %s. <return>" %\ img failed = True for f in files: otherfile = re_href.match(f).groups()[1] if not check_url(otherfile): filename = website + otherfile else: filename = otherfile if not download(filename, os.path.join(path_to_figures, os.path.basename(filename))): msg += "Error when downloading file: %s. <return>" %\ filename failed = True if not failed : return (True, generate_latex(host, db_name, vt_id, version, port, tag, execute, showspreadsheetonly, path_to_figures, graphics_options)) else: return (False, generate_latex_error(msg)) else: msg = "Web server returned: %s" % page return (False, generate_latex_error(msg)) | log("will download from: " + url) | def download_as_text(url): try: furl = urllib2.urlopen(url) s = furl.read() return s except: return None | 3123297d6a1b374a7b720af850b6ee46e7955b16 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/3123297d6a1b374a7b720af850b6ee46e7955b16/includevistrail.py |
except Exception, e: return (False, generate_latex_error(str(e))) | (result, msg) = _download_content(website, url, path_to_figures) if result == True: log("success") return (result, generate_latex(download_url, host, db_name, vt_id, version, port, tag, execute, showspreadsheetonly, path_to_figures, graphics_options)) else: log("Error: " + msg) return (result, generate_latex_error(msg)) | def download_as_text(url): try: furl = urllib2.urlopen(url) s = furl.read() return s except: return None | 3123297d6a1b374a7b720af850b6ee46e7955b16 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/3123297d6a1b374a7b720af850b6ee46e7955b16/includevistrail.py |
return (True, generate_latex(host, db_name, vt_id, version, port, tag, execute, | log("using cached files") return (True, generate_latex(download_url, host, db_name, vt_id, version, port, tag, execute, | def download_as_text(url): try: furl = urllib2.urlopen(url) s = furl.read() return s except: return None | 3123297d6a1b374a7b720af850b6ee46e7955b16 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/3123297d6a1b374a7b720af850b6ee46e7955b16/includevistrail.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.