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

All Samples(36)  |  Call(30)  |  Derive(0)  |  Import(6)
Take the value passed, and merge the current `setting` over it. Once
complete, take the value and set the cache `key` and destination.settings
`setting` to that value, using the `ttl` for set_cache().

:param destination:
    An object that has a `.settings` attribute that is a dict

:param setting:
    The dict key to use when pushing the value into the settings dict
(more...)

        def set_cache_under_settings(destination, setting, key_prefix, value, ttl, list_=False):
    """
    Take the value passed, and merge the current `setting` over it. Once
    complete, take the value and set the cache `key` and destination.settings
    `setting` to that value, using the `ttl` for set_cache().

    :param destination:
        An object that has a `.settings` attribute that is a dict

    :param setting:
        The dict key to use when pushing the value into the settings dict

    :param key_prefix:
        The string to prefix to `setting` to make the cache key

    :param value:
        The value to set

    :param ttl:
        The cache ttl to use
    """

    default = {} if not list_ else []
    existing = destination.settings.get(setting, default)
    if value:
        if list_:
            value.extend(existing)
        else:
            value.update(existing)
        set_cache(key_prefix + '.' + setting, value, ttl)
        destination.settings[setting] = value
        


src/c/h/ChocolateyPackages-HEAD/EthanBrown.SublimeText2.UtilPackages/tools/PackageCache/Package Control/package_control/package_manager.py   ChocolateyPackages(Download)
from .unicode import unicode_from_os
from .clear_directory import clear_directory
from .cache import (clear_cache, set_cache, get_cache, merge_cache_under_settings,
    merge_cache_over_settings, set_cache_under_settings, set_cache_over_settings)
from .versions import version_comparable, version_sort
                    # Have the local name map override the one from the channel
                    name_map = provider.get_name_map()
                    set_cache_under_settings(self, 'package_name_map', channel, name_map, cache_ttl)
 
                    renamed_packages = provider.get_renamed_packages()
                    set_cache_under_settings(self, 'renamed_packages', channel, renamed_packages, cache_ttl)
 
                    unavailable_packages = provider.get_unavailable_packages()
                    set_cache_under_settings(self, 'unavailable_packages', channel, unavailable_packages, cache_ttl, list_=True)
 
            renamed_packages = provider.get_renamed_packages()
            set_cache_under_settings(self, 'renamed_packages', repo, renamed_packages, cache_ttl)
 
            unavailable_packages = provider.get_unavailable_packages()

src/a/l/Alfred-Popclip-Sublime-HEAD/Sublime Text 2/Package Control/package_control/package_manager.py   Alfred-Popclip-Sublime(Download)
from .unicode import unicode_from_os
from .clear_directory import clear_directory
from .cache import (clear_cache, set_cache, get_cache, merge_cache_under_settings,
    merge_cache_over_settings, set_cache_under_settings, set_cache_over_settings)
from .versions import version_comparable, version_sort
                    # Have the local name map override the one from the channel
                    name_map = provider.get_name_map()
                    set_cache_under_settings(self, 'package_name_map', channel, name_map, cache_ttl)
 
                    renamed_packages = provider.get_renamed_packages()
                    set_cache_under_settings(self, 'renamed_packages', channel, renamed_packages, cache_ttl)
 
                    unavailable_packages = provider.get_unavailable_packages()
                    set_cache_under_settings(self, 'unavailable_packages', channel, unavailable_packages, cache_ttl, list_=True)
 
            renamed_packages = provider.get_renamed_packages()
            set_cache_under_settings(self, 'renamed_packages', repo, renamed_packages, cache_ttl)
 
            unavailable_packages = provider.get_unavailable_packages()

src/s/u/Sublime-Text-2-Settings-HEAD/Package Control/package_control/package_manager.py   Sublime-Text-2-Settings(Download)
from .unicode import unicode_from_os
from .clear_directory import clear_directory
from .cache import (clear_cache, set_cache, get_cache, merge_cache_under_settings,
    merge_cache_over_settings, set_cache_under_settings, set_cache_over_settings)
from .versions import version_comparable, version_sort
                    # Have the local name map override the one from the channel
                    name_map = provider.get_name_map()
                    set_cache_under_settings(self, 'package_name_map', channel, name_map, cache_ttl)
 
                    renamed_packages = provider.get_renamed_packages()
                    set_cache_under_settings(self, 'renamed_packages', channel, renamed_packages, cache_ttl)
 
                    unavailable_packages = provider.get_unavailable_packages()
                    set_cache_under_settings(self, 'unavailable_packages', channel, unavailable_packages, cache_ttl, list_=True)
 
            renamed_packages = provider.get_renamed_packages()
            set_cache_under_settings(self, 'renamed_packages', repo, renamed_packages, cache_ttl)
 
            unavailable_packages = provider.get_unavailable_packages()

src/f/e/FED-Sublime-Settings-HEAD/Package Control/package_control/package_manager.py   FED-Sublime-Settings(Download)
from .unicode import unicode_from_os
from .clear_directory import clear_directory
from .cache import (clear_cache, set_cache, get_cache, merge_cache_under_settings,
    merge_cache_over_settings, set_cache_under_settings, set_cache_over_settings)
from .versions import version_comparable, version_sort
                    # Have the local name map override the one from the channel
                    name_map = provider.get_name_map()
                    set_cache_under_settings(self, 'package_name_map', channel, name_map, cache_ttl)
 
                    renamed_packages = provider.get_renamed_packages()
                    set_cache_under_settings(self, 'renamed_packages', channel, renamed_packages, cache_ttl)
 
                    unavailable_packages = provider.get_unavailable_packages()
                    set_cache_under_settings(self, 'unavailable_packages', channel, unavailable_packages, cache_ttl, list_=True)
 
            renamed_packages = provider.get_renamed_packages()
            set_cache_under_settings(self, 'renamed_packages', repo, renamed_packages, cache_ttl)
 
            unavailable_packages = provider.get_unavailable_packages()

src/s/u/Sublime-Rails-Settings-HEAD/Package Control/package_control/package_manager.py   Sublime-Rails-Settings(Download)
from .unicode import unicode_from_os
from .clear_directory import clear_directory
from .cache import (clear_cache, set_cache, get_cache, merge_cache_under_settings,
    merge_cache_over_settings, set_cache_under_settings, set_cache_over_settings)
from .versions import version_comparable, version_sort
                    # Have the local name map override the one from the channel
                    name_map = provider.get_name_map()
                    set_cache_under_settings(self, 'package_name_map', channel, name_map, cache_ttl)
 
                    renamed_packages = provider.get_renamed_packages()
                    set_cache_under_settings(self, 'renamed_packages', channel, renamed_packages, cache_ttl)
 
                    unavailable_packages = provider.get_unavailable_packages()
                    set_cache_under_settings(self, 'unavailable_packages', channel, unavailable_packages, cache_ttl, list_=True)
 
            renamed_packages = provider.get_renamed_packages()
            set_cache_under_settings(self, 'renamed_packages', repo, renamed_packages, cache_ttl)
 
            unavailable_packages = provider.get_unavailable_packages()

src/s/u/sublime_package_control-HEAD/package_control/package_manager.py   sublime_package_control(Download)
from .rmtree import rmtree
from .clear_directory import clear_directory
from .cache import (clear_cache, set_cache, get_cache, merge_cache_under_settings,
    merge_cache_over_settings, set_cache_under_settings, set_cache_over_settings)
from .versions import version_comparable, version_sort
                    # Have the local name map override the one from the channel
                    name_map = provider.get_name_map()
                    set_cache_under_settings(self, 'package_name_map', channel, name_map, cache_ttl)
 
                    renamed_packages = provider.get_renamed_packages()
                    set_cache_under_settings(self, 'renamed_packages', channel, renamed_packages, cache_ttl)
 
                    unavailable_packages = provider.get_unavailable_packages()
                    set_cache_under_settings(self, 'unavailable_packages', channel, unavailable_packages, cache_ttl, list_=True)
 
            renamed_packages = provider.get_renamed_packages()
            set_cache_under_settings(self, 'renamed_packages', repo, renamed_packages, cache_ttl)
 
            unavailable_packages = provider.get_unavailable_packages()