def get_workflow_config_by_type(config, ticket_type): """return the [ticket-workflow-type] session""" if ticket_type == 'default': raw_actions = list(config.options('ticket-workflow')) else: raw_actions = list(config.options('ticket-workflow-%s' % ticket_type)) return parse_workflow_config(raw_actions)
def __init__(self, *args, **kwargs): """ Parses the configuration file to find all the workflows defined. To define a workflow state machine for a particular resource realm, add a "<realm>-resource_workflow" section in trac.ini and describe the state machine with the same syntax as the ConfigurableTicketWorkflow component. """ Component.__init__(self, *args, **kwargs) from trac.ticket.default_workflow import parse_workflow_config for section in self.config.sections(): if section.find('-resource_workflow') > 0: self.log.debug( "ResourceWorkflowSystem - parsing config section %s" % section) realm = section.partition('-')[0] raw_actions = list(self.config.options(section)) self.actions[realm] = parse_workflow_config(raw_actions) self._operation_providers_map = None
def main(filename, show_ops=False, show_perms=False): # Read in the config rawactions = readconfig(filename) # Parse the config information actions = parse_workflow_config(rawactions) # Convert to graphviz digraph_lines = actions2graphviz(actions, show_ops, show_perms) # And output sys.stdout.write('\n'.join(digraph_lines))
def main(filename, output, show_ops=False, show_perms=False): # Read in the config rawactions = readconfig(filename) # Parse the config information actions = parse_workflow_config(rawactions) # Convert to graphviz digraph_lines = actions2graphviz(actions, show_ops, show_perms) # And output output.write(unicode.encode('\n'.join(digraph_lines), locale.getpreferredencoding()))
def __init__(self, *args, **kwargs): """ Parses the configuration file to find all the workflows defined. To define a workflow state machine for a particular resource realm, add a "<realm>-resource_workflow" section in trac.ini and describe the state machine with the same syntax as the ConfigurableTicketWorkflow component. """ Component.__init__(self, *args, **kwargs) from trac.ticket.default_workflow import parse_workflow_config for section in self.config.sections(): if section.find('-resource_workflow') > 0: self.log.debug("ResourceWorkflowSystem - parsing config section %s" % section) realm = section.partition('-')[0] raw_actions = list(self.config.options(section)) self.actions[realm] = parse_workflow_config(raw_actions) self._operation_providers_map = None
def get_workflow_config(config): raw_actions = list(config.options('itteco-milestone-workflow')) return parse_workflow_config(raw_actions)