Browse Source

Set proper default values for fields, so ConfigOpt doesn't get confused

and save "None"s in the config file.
master
Julio Biason 15 years ago
parent
commit
c2fb976a54
  1. 7
      mitterlib/network/networkbase.py

7
mitterlib/network/networkbase.py

@ -34,10 +34,15 @@ _log = logging.getLogger('mitterlib.network.Network')
def auth_options(namespace, options, auths): def auth_options(namespace, options, auths):
"""Convert the auth fields into options for the command line.""" """Convert the auth fields into options for the command line."""
default_values = {
'str': '',
'passwd': ''}
for option in auths: for option in auths:
options.add_option(group=namespace, options.add_option(group=namespace,
option=option['name'], option=option['name'],
default=None, default=default_values[option['type']],
help=option['help'], help=option['help'],
*(option['flags'])) *(option['flags']))
#-------------------------------------------------------------------- #--------------------------------------------------------------------

Loading…
Cancel
Save