Fix tabs/spaces mixup in 8c87fa6bb5
This commit is contained in:
@@ -12,7 +12,7 @@ class ConfigOptionParser(object):
|
||||
self.cmdParser = optparse.OptionParser(usage=kwargs.get("usage",""))
|
||||
self.configFile = kwargs.get("config","settings.py")
|
||||
self.configVars = []
|
||||
self.advancedHelp = []
|
||||
self.advancedHelp = []
|
||||
# these are arguments not understood by OptionParser, so they must be removed
|
||||
# in add_option before being passed to the OptionParser
|
||||
|
||||
@@ -38,10 +38,10 @@ class ConfigOptionParser(object):
|
||||
self.configVars.append(kwargs.copy())
|
||||
|
||||
if kwargs.get("advanced"):
|
||||
kwargs['help'] = optparse.SUPPRESS_HELP
|
||||
self.advancedHelp.append((args, kwargs.copy()))
|
||||
kwargs['help'] = optparse.SUPPRESS_HELP
|
||||
self.advancedHelp.append((args, kwargs.copy()))
|
||||
else:
|
||||
kwargs["help"]=kwargs["helptext"]
|
||||
kwargs["help"]=kwargs["helptext"]
|
||||
|
||||
for arg in self.customArgs:
|
||||
if arg in kwargs.keys(): del kwargs[arg]
|
||||
@@ -54,15 +54,15 @@ class ConfigOptionParser(object):
|
||||
self.cmdParser.print_help()
|
||||
|
||||
def advanced_help(self):
|
||||
self.cmdParser.set_conflict_handler('resolve') # Allows us to overwrite the previous definitions
|
||||
for opt in self.advancedHelp:
|
||||
self.cmdParser.set_conflict_handler('resolve') # Allows us to overwrite the previous definitions
|
||||
for opt in self.advancedHelp:
|
||||
opt[1]['help']="[!]" + opt[1]['helptext']
|
||||
for arg in self.customArgs:
|
||||
if arg in opt[1].keys(): del opt[1][arg]
|
||||
if opt[1].get("type", None):
|
||||
opt[1]['type'] = 'string' # we'll do our own converting later
|
||||
self.cmdParser.add_option(*opt[0], **opt[1])
|
||||
self.cmdParser.epilog = "Advanced options indicated by [!]. These options should not normally be required, and may have caveats regarding their use. See README file for more details"
|
||||
self.cmdParser.epilog = "Advanced options indicated by [!]. These options should not normally be required, and may have caveats regarding their use. See README file for more details"
|
||||
self.print_help()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user