Permalink
Browse files

Remove --dump-config

There is not much use with multi-profile configs.
  • Loading branch information...
1 parent 7c3ddf3 commit 289f8ef9ca640dce1963850a113ff116cb14601f @mludvig committed Feb 15, 2012
Showing with 0 additions and 17 deletions.
  1. +0 −12 Sms/Config.py
  2. +0 −5 sms-cli
View
@@ -58,9 +58,6 @@ def read_config_file(self, configfile):
self.update_option(option, cp.get(option))
self._parsed_files.append(configfile)
- def dump_config(self, stream):
- ConfigDumper(stream).dump(self.profile, self)
-
def update_option(self, option, value):
if value is None:
return
@@ -145,12 +142,3 @@ def get(self, name, default = None):
return self.cfg[name]
return default
-class ConfigDumper(object):
- def __init__(self, stream):
- self.stream = stream
-
- def dump(self, section, config):
- self.stream.write("[%s]\n" % section)
- for option in config.option_list():
- self.stream.write("%s = %s\n" % (option, getattr(config, option)))
-
View
@@ -35,7 +35,6 @@ optparser.add_option("-f", "--config", dest="config", metavar="FILE", help="Conf
optparser.add_option("-p", "--profile", dest="profile", action="store", metavar="PROFILE", help="Config file profile / section to process. Defaults to [default]")
optparser.add_option( "--debug", dest="verbosity", action="store_const", const=logging.DEBUG, help="Enable debug output.")
optparser.add_option( "--quiet", dest="verbosity", action="store_const", const=logging.WARNING, help="Suppres most messages. Only Warnings and Errors are printed.")
-optparser.add_option( "--dump-config", dest="dump_config", action="store_true", help="Dump current configuration after parsing config files and command line options and exit.")
(options, args) = optparser.parse_args()
@@ -72,10 +71,6 @@ for option in cfg.option_list():
## Some Config() options are not settable from command line
pass
-if options.dump_config:
- cfg.dump_config(sys.stdout)
- sys.exit(0)
-
if not options.message or not cfg.sms_recipients:
sys.stderr.write('Message and at least one recipient must be set!\n')
sys.exit(1)

0 comments on commit 289f8ef

Please sign in to comment.