Returns a human readable settings representation for logging purposes.
347011
def _settings_str(self):
        """"""
        settings = "Automatically save changes: {}, " \
            "Show tray icon: {}, " \
            "Allow keyboard navigation: {}, " \
            "Sort by usage count: {}, " \
            "Enable undo using backspace: {}, " \
            "Tray icon theme: {}".format(
               self.autosave_checkbox.isChecked(),
               self.show_tray_checkbox.isChecked(),
               self.allow_kb_nav_checkbox.isChecked(),
               self.sort_by_usage_checkbox.isChecked(),
               self.enable_undo_checkbox.isChecked(),
               self.system_tray_icon_theme_combobox.currentData(Qt.UserRole)
            )
        return settings
91631
def _get_log_format(self, request):
        """"""
        user = getattr(request, 'user', None)
        if not user:
            return
        if not request.user.is_authenticated:
            return
        method = request.method.upper()
        if not (method in self.target_methods):
            return
        request_url = urlparse.unquote(request.path)
        for rule in self._ignored_urls:
            if rule.search(request_url):
                return
        return self.format
265312
def settings(cls):
        

        from bernard.platforms.management import get_platform_settings

        for platform in get_platform_settings():
            candidate = import_class(platform['class'])
            if candidate == cls:
                return platform.get('settings', {})
498502
protected void checkLoggingSettings() {
        final LoggingSettings logSettings = settings.getLoggingSettings();
        final LogFile logFileSettings = logSettings.getLogFile();

        if(logFileSettings.getCurrentLogFilename() != null &&
           logFileSettings.isEnabled() == false) {
            LOG.warn("You specified a log file, but have it disabled");
        }

        if(logFileSettings.isEnabled() &&
           logFileSettings.getCurrentLogFilename() == null) {
            throw new IllegalStateException("You enabled logging to a file, but didn't specify the file name");
        }
    }
828337
def print_settings(settings, depth=0):
    """"""
    # handle the case where a single setting is passed
    if isinstance(settings, Setting):
        settings = [settings]
    for setting in settings:
        cur = setting.currentValue
        print(
            "%s* %s (%s, value: %s, type: %s)"
            % (
                " " * depth,
                setting.title,
                setting.target,
                click.style(cur, bold=True),
                setting.type,
            )
        )
        for opt in setting.candidate:
            if not opt.isAvailable:
                logging.debug("Unavailable setting %s", opt)
                continue
            click.echo(
                click.style(
                    "%s  - %s (%s)" % (" " * depth, opt.title, opt.value),
                    bold=opt.value == cur,
                )
            )
1061192
def config():
    ''''''
    if hasattr(current_app, 'settings_file'):
        log.info('Loaded configuration from %s', current_app.settings_file)

    log.info(white('Current configuration'))
    for key in sorted(current_app.config):
        if key.startswith('__') or not key.isupper():
            continue
        echo('{0}: {1}'.format(white(key), current_app.config[key]))
199578
def list_settings(self):
        
        result = super().list_settings()
        result.append((self.SETTING_FLAG_BORDER, True))
        result.append((self.SETTING_BORDER_FORMATING, {}))
        result.append((self.SETTING_BORDER_STYLE, 'utf8.a'))
        return result
932638
def settings(self):
        
        result = self.client.get('/account/settings')

        if not 'managed' in result:
            raise UnexpectedResponseError('Unexpected response when getting account settings!',
                    json=result)

        s = AccountSettings(self.client, result['managed'], result)
        return s
373402
private String humanReadable(long uptime) {
        uptime = uptime / 1000;

        int sec = (int) uptime % 60;
        uptime /= 60;

        int min = (int) uptime % 60;
        uptime /= 60;

        int hour = (int) uptime % 24;
        uptime /= 24;

        int day = (int) uptime;

        String str = "";
        if (day > 0)
            if (day > 1)
                str += day + " days, ";
            else
                str += day + " day, ";
        // prints 0 hour in case days exists. Otherwise prints 2 days, 34 min, sounds weird.
        if (hour > 0 || (day > 0))
            if (hour > 1)
                str += hour + " hours, ";
            else
                str += hour + " hour, ";
        if (min > 0)
            str += min + " min, ";
        if (sec > 0)
            str += sec + " s";

        return str;
    }
140759
def get_settings(editor_override=None):
    """"""
    flavor = getattr(settings, "DJANGO_WYSIWYG_FLAVOR", "yui")

    if editor_override is not None:
        flavor = editor_override

    return {
        "DJANGO_WYSIWYG_MEDIA_URL": getattr(settings, "DJANGO_WYSIWYG_MEDIA_URL", urljoin(settings.STATIC_URL, flavor) + '/'),
        "DJANGO_WYSIWYG_FLAVOR":    flavor,
    }
333639
def read_settings(self):
        
        logger.debug('Reading settings from: %s', self.settings_path)
        self.settings = Settings.from_dsbfile(self.settings_path)
226788
def _config_logs(lvl=None, name=None):
    
    # print('_config_log', 'from %s' %name if name else '')
    FORMAT = '%(message)s'
    # maybe better for log files
    # FORMAT='[%(levelname)s]:%(message)s',

    # Reset handlers
    for h in list(logging.root.handlers):
        logging.root.removeHandler(h)

    global _log_level
    if lvl: _log_level = lvl

    logging.basicConfig(level=_log_level, format=FORMAT, stream=sys.stdout)
    _log = logging.getLogger(__name__)
    _log.setLevel(_log_level)

    # external
    for log in ['urllib3', 'asyncio']:
        logging.getLogger(log).setLevel(_log_level)
378742
def config(self):
        
        config = self._get_config()
        return {section: {itm.name: itm for itm in config[section].values()
                          if not itm.readonly}
                for section in config
                if 'settings' in section or section == 'other'}
184934
def _user_settings(self):
        
        user_settings = getattr(settings, self._name, {})
        if not user_settings and self._required:
            raise ImproperlyConfigured("Settings file is missing dict options with name {}".format(self._name))
        keys = frozenset(user_settings.keys())

        required = self._required - keys
        if required:
            raise ImproperlyConfigured("Following options for {} are missing from settings file: {}".format(self._name, ', '.join(sorted(required))))

        removed = keys & self._removed
        if removed:
            raise ImproperlyConfigured("Following options for {} have been removed: {}".format(self._name, ', '.join(sorted(removed))))

        return user_settings
184892
def get_settings(self, service_id, version_number):
		""""""
		content = self._fetch("/service/%s/version/%d/settings" % (service_id, version_number))
		return FastlySettings(self, content)
808563
def format_log_context(msg, connection=None, keyspace=None):
    """"""
    connection_info = connection or 'DEFAULT_CONNECTION'

    if keyspace:
        msg = '[Connection: {0}, Keyspace: {1}] {2}'.format(connection_info, keyspace, msg)
    else:
        msg = '[Connection: {0}] {1}'.format(connection_info, msg)
    return msg
81191
def settings(self):
        
        if not self._settings:
            data = self.query(Settings.key)
            self._settings = Settings(self, data)
        return self._settings