def __init__(self, config=None, filename=None, defaults=None):
        """ Parse command line parameters and populate the options object
        """
        self.appPath  = _ourPath
        self.filename = filename
        self._config  = { 'configFile':  ('-c', '--config',  self.filename,       'Configuration Filename (optionally w/path'),
                          'debug':       ('-d', '--debug',   False,               'Enable Debug'),
                          'echo':        ('-e', '--echo',    False,               'Enable log echo to the console'),
                          'logpath':     ('-l', '--logpath', '',                  'Path where log file is to be written'),
                          'logfile':     ('',   '--logfile', '%s.log' % _ourName, 'log filename'),
                          'verbose':     ('-v', '--verbose', False,               'show extra output from remote commands'),
                        }

        if config is not None and isinstance(config, types.DictType):
            for key in config:
                self._config[key] = config[key]

        if defaults is not None and isinstance(defaults, types.DictType):
            self._defaults = defaults
        else:
            self._defaults = {}

        self.load()
def __init__ ( self , config = None , filename = None , defaults = None ) : self . appPath = _ourPath self . filename = filename self . _config = { 'configFile' : ( '-c' , '--config' , self . filename , 'Configuration Filename (optionally w/path' ) , 'debug' : ( '-d' , '--debug' , False , 'Enable Debug' ) , 'echo' : ( '-e' , '--echo' , False , 'Enable log echo to the console' ) , 'logpath' : ( '-l' , '--logpath' , '' , 'Path where log file is to be written' ) , 'logfile' : ( '' , '--logfile' , '%s.log' % _ourName , 'log filename' ) , 'verbose' : ( '-v' , '--verbose' , False , 'show extra output from remote commands' ) , } if config is not None and isinstance ( config , types . DictType ) : for key in config : self . _config [ key ] = config [ key ] if defaults is not None and isinstance ( defaults , types . DictType ) : self . _defaults = defaults else : self . _defaults = { } self . load ( )
Parse command line parameters and populate the options object