Пример #1
0
    def merge_config_options(self, defaults, cmdline_options):
        for k in defaults:
            self.cfg[k] = defaults[k]

        if 'configuration_file' in cmdline_options:
            self.cfg['configuration_file'] = cmdline_options[
                'configuration_file']
        if '~' in self.cfg['configuration_file']:
            self.cfg['configuration_file'] = self.cfg[
                'configuration_file'].replace('~', path.expanduser('~'))

        self.__load_user_config()

        for k in cmdline_options:
            self.cfg[k] = cmdline_options[k]

        if ('debug' in self.cfg) and ('cfg' in self.cfg['debug']):
            stdo("Configuration:\n")
            stdo("-------------------------------------------------\n")
            for k in self.cfg:
                str = "%s" % (k)
                stdo('    %-25s = "%s"\n' % (str, self.cfg[k]))
            if 'exit' in self.cfg['debug']: _exit(0)

        return
Пример #2
0
    def merge_config_options(self, defaults, cmdline_options):
        for k in defaults:
            self.cfg[k] = defaults[k]

        if 'configuration_file' in cmdline_options:
            self.cfg['configuration_file'] = cmdline_options['configuration_file']
        if '~' in self.cfg['configuration_file']:
            self.cfg['configuration_file'] = self.cfg['configuration_file'].replace('~', path.expanduser('~'))

        self.__load_user_config()

        for k in cmdline_options:
            self.cfg[k] = cmdline_options[k]

        if ('debug' in self.cfg) and ('cfg' in self.cfg['debug']):
            stdo("Configuration:\n")
            stdo("-------------------------------------------------\n")
            for k in self.cfg:
                str = "%s" % (k)
                stdo('    %-25s = "%s"\n' % (str, self.cfg[k]))
            if 'exit' in self.cfg['debug']: _exit(0)

        return
Пример #3
0
 def dbg(self, system, msg):
     if 'debug' in self.cfg:
         if system in self.cfg['debug']:
             stdo("dbg: %s" % (msg))
Пример #4
0
 def dbg(self, system, msg):
     if 'debug' in self.cfg:
         if system in self.cfg['debug']:
             stdo("dbg: %s" % (msg))