(self, temp_dir, arguments)
Initialise settings.
Initialise settings.
Initialise settings .
def __init__(self, temp_dir, arguments):
        """Initialise settings."""
        # arguments should be unicode
        if not arguments:
            self._uargv = argv[1:]
        else:
            self._uargv = list(arguments)
        lumberjack = Lumberjack()
        try:
            # create state path if needed
            if not os.path.exists(STATE_PATH):
                os.makedirs(STATE_PATH)
            # create user config file if needed
            if not os.path.exists(USER_CONFIG_PATH):
                try:
                    os.makedirs(USER_CONFIG_DIR)
                except OSError:
                    pass
                _build_default_config_file(USER_CONFIG_PATH)
            # create @: drive if not present
            if not os.path.exists(PROGRAM_PATH):
                os.makedirs(PROGRAM_PATH)
                # unpack bundled programs
                _store_bundled_programs(PROGRAM_PATH)
            # store options in options dictionary
            self._options = ArgumentParser().retrieve_options(self._uargv, temp_dir)
        except:
            # avoid losing exception messages occuring while logging was disabled
            lumberjack.reset()
            raise
        # prepare global logger for use by main program
        lumberjack.prepare(self.get('logfile'), self.get('debug'))
        self._session_params = None
def __init__ ( self , temp_dir , arguments ) : # arguments should be unicode if not arguments : self . _uargv = argv [ 1 : ] else : self . _uargv = list ( arguments ) lumberjack = Lumberjack ( ) try : # create state path if needed if not os . path . exists ( STATE_PATH ) : os . makedirs ( STATE_PATH ) # create user config file if needed if not os . path . exists ( USER_CONFIG_PATH ) : try : os . makedirs ( USER_CONFIG_DIR ) except OSError : pass _build_default_config_file ( USER_CONFIG_PATH ) # create @: drive if not present if not os . path . exists ( PROGRAM_PATH ) : os . makedirs ( PROGRAM_PATH ) # unpack bundled programs _store_bundled_programs ( PROGRAM_PATH ) # store options in options dictionary self . _options = ArgumentParser ( ) . retrieve_options ( self . _uargv , temp_dir ) except : # avoid losing exception messages occuring while logging was disabled lumberjack . reset ( ) raise # prepare global logger for use by main program lumberjack . prepare ( self . get ( 'logfile' ) , self . get ( 'debug' ) ) self . _session_params = None