示例#1
0
 def handle(self, *args, **options):
     logger.debug("Handling settings")
     GlobalConfig.initialize()
     try:
         for config in args:
             logger.debug('Config: {}'.format(config))
             first, value = config.split('=')
             first = first.split('.')
             if len(first) == 2:
                 mod, name = first
             else:
                 mod, name = GLOBAL_SECTION, first[0]
             if Config.update(mod, name, value) is False:  # If not exists, try to store value without any special parameters
                 Config.section(mod).value(name, value).get()
     except Exception:
         logger.exception('Exception processing {}'.format(args))
示例#2
0
文件: config.py 项目: shaba/openuds
 def handle(self, *args, **options):
     logger.debug("Handling settings")
     GlobalConfig.initialize()
     try:
         for config in options['name_value']:
             logger.debug('Config: %s', config)
             first, value = config.split('=')
             first = first.split('.')
             if len(first) == 2:
                 mod, name = first
             else:
                 mod, name = GLOBAL_SECTION, first[0]
             if Config.update(
                     mod, name, value
             ) is False:  # If not exists, try to store value without any special parameters
                 Config.section(mod).value(name, value).get()
     except Exception as e:
         print('The command could not be processed: {}'.format(e))
         logger.exception('Exception processing %s', args)
示例#3
0
 def put(self):
     for section, secDict in self._params.items():
         for key, vals in secDict.items():
             cfgConfig.update(section, key, vals['value'])
     return 'done'
示例#4
0
 def put(self):
     for section, secDict in six.iteritems(self._params):
         for key, vals in six.iteritems(secDict):
             cfgConfig.update(section, key, vals['value'])
     return 'done'
示例#5
0
 def put(self):
     for section, secDict in self._params.iteritems():
         for key, vals in secDict.iteritems():
             cfgConfig.update(section, key, vals["value"])
     return "done"