(cls)
Loads all of Gate One's settings from `options.settings_dir` into
        ``cls.prefs``.

        .. note::

            This ``classmethod`` gets called automatically whenever a change is
            detected inside Gate One's ``settings_dir``.
Loads all of Gate One's settings from `options.settings_dir` into
        ``cls.prefs``.
Loads all of Gate One s settings from options . settings_dir into cls . prefs .
def load_prefs(cls):
        """
        Loads all of Gate One's settings from `options.settings_dir` into
        ``cls.prefs``.

        .. note::

            This ``classmethod`` gets called automatically whenever a change is
            detected inside Gate One's ``settings_dir``.
        """
        logger.info(_(
            "Settings have been modified.  Reloading from %s"
            % options.settings_dir))
        prefs = get_settings(options.settings_dir)
        # Only overwrite our settings if everything is proper
        if 'gateone' not in prefs['*']:
            # NOTE: get_settings() records its own errors too
            logger.info(_("Settings have NOT been loaded."))
            return
        cls.prefs = prefs
        # Reset the memoization dict so that everything using
        # applicable_policies() gets the latest & greatest settings
        MEMO.clear()
        # Also update __license_info__ so folks don't have to restart Gate One
        # when installing a new license:
        licenses = prefs.get('*', {}).get('licenses', {})
        if licenses:
            validate_licenses(licenses)
        else: # Ensure the default license is applied (if license removed)
            __license_info__.clear()
            __license_info__["AGPLv3"] = {
                "product": "gateone",
                "users": 0, # 0 being unlimited
                "customer": "Unsupported",
                "version": __version__,
                "license_format": "1.0",
            }
def load_prefs ( cls ) : logger . info ( _ ( "Settings have been modified.  Reloading from %s" % options . settings_dir ) ) prefs = get_settings ( options . settings_dir ) # Only overwrite our settings if everything is proper if 'gateone' not in prefs [ '*' ] : # NOTE: get_settings() records its own errors too logger . info ( _ ( "Settings have NOT been loaded." ) ) return cls . prefs = prefs # Reset the memoization dict so that everything using # applicable_policies() gets the latest & greatest settings MEMO . clear ( ) # Also update __license_info__ so folks don't have to restart Gate One # when installing a new license: licenses = prefs . get ( '*' , { } ) . get ( 'licenses' , { } ) if licenses : validate_licenses ( licenses ) else : # Ensure the default license is applied (if license removed) __license_info__ . clear ( ) __license_info__ [ "AGPLv3" ] = { "product" : "gateone" , "users" : 0 , # 0 being unlimited "customer" : "Unsupported" , "version" : __version__ , "license_format" : "1.0" , }