def create_workflow_entity(self, workflow, action): entity = WorkflowEntity(workflow) self.children.append(entity) entity.parent = self if self.vistrail.has_notes(action.id): plain_notes = extract_text(self.vistrail.get_notes(action.id)) entity.description = plain_notes else: entity.description = '' entity.user = action.user entity.mod_time = action.date entity.create_time = action.date scheme, rest = self.url.split('://', 1) url = 'http://' + rest url_tuple = urlparse.urlsplit(url) query_str = url_tuple[3] if query_str == '': query_str = 'workflow=%s' % action.id else: query_str += '&workflow=%s' % action.id url_tuple = (scheme, url_tuple[1], url_tuple[2], query_str, url_tuple[4]) entity.url = urlparse.urlunsplit(url_tuple) # entity.url = self.url + '?workflow_id=%s' % action.id return entity
def create_workflow_entity(self, workflow, action): entity = WorkflowEntity(workflow) self.children.append(entity) entity.parent = self if self.vistrail.has_notes(action.id): plain_notes = extract_text(self.vistrail.get_notes(action.id)) entity.description = plain_notes else: entity.description = '' entity.user = action.user entity.mod_time = action.db_date entity.create_time = action.db_date locator = BaseLocator.from_url(self.url) locator.kwargs['version_node'] = action.id entity.url = locator.to_url() return entity
def create_workflow_entity(self, workflow, action): entity = WorkflowEntity(workflow) self.children.append(entity) entity.parent = self if self.vistrail.has_notes(action.id): plain_notes = extract_text(self.vistrail.get_notes(action.id)) entity.description = plain_notes else: entity.description = '' entity.user = action.user entity.mod_time = action.date entity.create_time = action.date locator = BaseLocator.from_url(self.url) locator.kwargs['version_node'] = action.id entity.url = locator.to_url() return entity
def create_workflow_entity(self, workflow): entity = WorkflowEntity(workflow) self.add_entity(entity) return entity