def __init__(self, *args, **kwargs): self.async = True self.queue = 'default' self.timeout = None # Assign all the arguments to attributes config = config_from_environment('OORQ', **kwargs) for arg, value in config.items(): setattr(self, arg, value)
def load(self): config_file = self.options.get("config_file") if not config_file: pass config = ConfigParser.ConfigParser() try: config.readfp(open(config_file)) for (key, value) in config.items("options"): if value in ("True", "False"): value = eval(value) self.options[key] = value for section in config.sections(): if section != "options": _logger.warning("Only options section is taken into account in upgrades configuration") except (IOError, ConfigParser.NoSectionError): pass
def load(self): config_file = self.options.get('config_file') if not config_file: return config = ConfigParser.ConfigParser() try: config.readfp(open(config_file)) for (key, value) in config.items('options'): if value in ('True', 'False'): value = eval(value) self.options[key] = value for section in config.sections(): if section != 'options': _logger.warning("Only options section is taken into account in upgrades configuration") except (IOError, ConfigParser.NoSectionError): return
def load(self): config_file = self.options.get('config_file') if not config_file: return config = ConfigParser.ConfigParser() try: config.readfp(open(config_file)) for (key, value) in config.items('options'): if value in ('True', 'False'): value = eval(value) self.options[key] = value for section in config.sections(): if section != 'options': _logger.warning( "Only options section is taken into account in upgrades configuration" ) except (IOError, ConfigParser.NoSectionError): pass