Changeset 3640
- Timestamp:
- 05/08/08 08:52:18 (8 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
advancedticketworkflowplugin/0.11/advancedworkflow/controller.py
r3632 r3640 3 3 """ 4 4 5 from subprocess import call 5 import os 6 from subprocess import check_call, CalledProcessError 6 7 from genshi.builder import tag 7 8 … … 248 249 to doing its thing. If the script exits with a non-zero return code, an 249 250 error will be logged to the Trac log. 251 The plugin will look for a script named <tracenv>/hooks/<someaction>, and 252 will pass it 2 parameters: the ticket number, and the user. 250 253 251 254 <someaction>.operations = run_external 252 <someaction>.run_external = echo "blah blah blah" >> /var/log/blah 253 <someaction>.run_external_hint = Clue the user in. 255 <someaction>.run_external = Hint for the user 254 256 255 257 Don't forget to add the `TicketWorkflowOpRunExternal` to the workflow … … 281 283 label = actions[action]['name'] 282 284 hint = self.config.get('ticket-workflow', 283 action + '.run_external _hint').strip()285 action + '.run_external').strip() 284 286 if hint is None: 285 287 hint = "Will run external script." … … 292 294 def apply_action_side_effects(self, req, ticket, action): 293 295 """Run the external script""" 294 script = self.config.get('ticket-workflow', 295 action + '.run_external').strip() 296 retval = call(script, shell=True) 297 if retval: 298 self.env.log.error("External script %r exited with %s." % (script, 299 retval)) 296 script = os.path.join(self.env.path, 'hooks', action) 297 try: 298 check_call([script, str(ticket.id), req.authname]) 299 except (CalledProcessError, OSError), e: 300 self.env.log.error("External script %r exited: %s." % (script, e)) advancedticketworkflowplugin/0.11/setup.py
r3632 r3640 5 5 setup( 6 6 name='AdvancedTicketWorkflowPlugin', 7 version='0. 4',7 version='0.5', 8 8 author = 'Eli Carter', 9 9 author_email = 'elicarter@retracile.net',
