def __call__(self, parser, namespace, values, option_string=None): if not configer.is_root(): sys.exit('Script must be run as root') cfg_sections = ['main', 'ad', 'callback_plugins'] for section in cfg_sections: sys.stdout.write('[%s]\n' % (section)) c = configer.read_config(section) for key in c: sys.stdout.write('%s: %s\n' % (key, c[key])) sys.stdout.write('\n') parser.exit()
def __call__(self, parser, namespace, values, option_string=None): if not configer.is_root(): sys.exit("Script must be run as root") cfg_sections = ["main", "ad", "callback_plugins"] for section in cfg_sections: sys.stdout.write("[%s]\n" % (section)) c = configer.read_config(section) for key in c: sys.stdout.write("%s: %s\n" % (key, c[key])) sys.stdout.write("\n") parser.exit()
def __call__(self, parser, namespace, values, option_string=None): if not configer.is_root(): sys.exit('Script must be run as root') config = configer.get_config() configer.write_config(config) parser.exit()