示例#1
0
文件: argparser.py 项目: jpmens/ants
 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()
示例#2
0
 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()
示例#3
0
文件: argparser.py 项目: jpmens/ants
 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()