Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)
Return value that matches key in config settings.
Reference keyring if needed.

        def config_get(config, section, key=None, default=None):
    """Return value that matches key in config settings.
    Reference keyring if needed.
    """
    config_section = config.get(section)
    if not key:
        return config_section
    if config_section.get(key, default) == 'USE_KEYRING':
        keyring_path = '%s/%s' % (section, key)
        keyring_value = keyring.get_password('serverherald', keyring_path)
        if keyring_value is None:
            print ('The keyring storage mechanism has been selected for'
                   '%s but the keyring is empty' % keyring_path)

            while 1:
                user_value = getpass.getpass("%s: " % key)
                if user_value != '':
                    keyring.set_password('serverherald', keyring_path,
                                         user_value)
                    break
            return user_value
        else:
            return keyring_value
    else:
        return config_section.get(key, default)
        


src/s/e/serverherald-1-0.0.1/serverherald/__init__.py   serverherald(Download)
    def config(self, section, key=None, default=None):
        """Return the section or section/key value"""
        return serverherald.utils.config_get(self._config, section, key,
                                             default)
 

src/s/e/serverherald-1-0.0.1/serverherald/notifiers/base.py   serverherald(Download)
    def config(self, section, key=None, default=None):
        """Return the section or section/key value"""
        return serverherald.utils.config_get(self._config, section, key,
                                             default)