#NEWLINE# def main( ) : #NEWLINE# #INDENT# "Rewrite the ticket-workflow section of the config; and change all\n    'assigned' tickets to 'accepted'.\n    " #NEWLINE# if ( len ( sys . argv ) != 2 ) : #NEWLINE# #INDENT# print ( ( 'Usage: %s path_to_trac_environment' % sys . argv [ 0 ] ) ) #NEWLINE# sys . exit ( 1 ) #NEWLINE# #UNINDENT# tracdir = sys . argv [ 1 ] #NEWLINE# trac_env = trac . env . open_environment ( tracdir ) #NEWLINE# old_workflow = trac_env . config . options ( 'ticket-workflow' ) #NEWLINE# for ( name , value ) in old_workflow : #NEWLINE# #INDENT# trac_env . config . remove ( 'ticket-workflow' , name ) #NEWLINE# #UNINDENT# load_workflow_config_snippet ( trac_env . config , 'basic-workflow.ini' ) #NEWLINE# trac_env . config . save ( ) #NEWLINE# trac_env . db_transaction ( "\n        UPDATE ticket SET status = 'accepted' WHERE status = 'assigned'\n        " )