bug fix: reenable the -d option

svn: r12722
This commit is contained in:
Benny Malengier 2009-06-28 09:57:05 +00:00
parent d69bb96fe9
commit db5458a507

View File

@ -173,6 +173,7 @@ class ArgParser(object):
return return
# Go over all given option and place them into appropriate lists # Go over all given option and place them into appropriate lists
cleandbg = []
for opt_ix in range(len(options)): for opt_ix in range(len(options)):
option, value = options[opt_ix] option, value = options[opt_ix]
if option in ( '-O', '--open'): if option in ( '-O', '--open'):
@ -200,8 +201,10 @@ class ArgParser(object):
options_str = options[opt_ix+1][1] options_str = options[opt_ix+1][1]
self.actions.append((action, options_str)) self.actions.append((action, options_str))
elif option in ('-d', '--debug'): elif option in ('-d', '--debug'):
print 'setup debugging', value
logger = logging.getLogger(value) logger = logging.getLogger(value)
logger.setLevel(logging.DEBUG) logger.setLevel(logging.DEBUG)
cleandbg += [opt_ix]
elif option in ('-l',): elif option in ('-l',):
self.list = True self.list = True
elif option in ('-L',): elif option in ('-L',):
@ -211,6 +214,11 @@ class ArgParser(object):
elif option in ('-u', '--force-unlock'): elif option in ('-u', '--force-unlock'):
self.force_unlock = True self.force_unlock = True
#clean options list
cleandbg.reverse()
for ind in cleandbg:
del options[ind]
if len(options) > 0 and self.open is None and self.imports == [] \ if len(options) > 0 and self.open is None and self.imports == [] \
and not (self.list or self.list_more or self.help): and not (self.list or self.list_more or self.help):
self.errors += [(_('Error parsing the arguments'), self.errors += [(_('Error parsing the arguments'),