Changeset 412


Ignore:
Timestamp:
07/20/10 11:26:42 (13 years ago)
Author:
bas
Message:

added -d/--debug option

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/email2trac.py.in

    r411 r412  
    709709                if tkt['reporter'].lower() in [self.author, self.email_addr]:
    710710                        if self.parameters.debug:
    711                                 self.logger.info('ALLOW, %s is the ticket reporter' %(self.email_addr))
     711                                self.logger.debug('ALLOW, %s is the ticket reporter' %(self.email_addr))
    712712
    713713                        return True
     
    22202220        dry_run = None
    22212221        verbose = None
    2222 
    2223         SHORT_OPT = 'chf:np:t:v'
    2224         LONG_OPT  =  ['component=', 'dry-run', 'help', 'file=', 'project=', 'ticket_prefix=', 'verbose']
     2222        debug = None
     2223
     2224        SHORT_OPT = 'cdhf:np:t:v'
     2225        LONG_OPT  =  ['component=', 'debug', 'dry-run', 'help', 'file=', 'project=', 'ticket_prefix=', 'verbose']
    22252226
    22262227        try:
     
    22382239                elif opt in ['-c', '--component']:
    22392240                        component = value
     2241                elif opt in ['-d', '--debug']:
     2242                        debug = 1
    22402243                elif opt in ['-f', '--file']:
    22412244                        configfile = value
     
    22532256        # The default prefix for ticket values in email2trac.conf
    22542257        #
    2255         settings['ticket_prefix'] = ticket_prefix
    2256         settings['dry_run'] = dry_run
    2257         settings['verbose'] = verbose
     2258        settings.ticket_prefix = ticket_prefix
     2259        settings.dry_run = dry_run
     2260        settings.verbose = verbose
     2261
     2262        if not settings.debug and debug:
     2263                settings.debug = debug
    22582264
    22592265        logger = setup_log(settings)
Note: See TracChangeset for help on using the changeset viewer.