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

All Samples(101)  |  Call(61)  |  Derive(0)  |  Import(40)
Return a cache instance based on ``option``.
    

        def get_cache(option, env):
    """Return a cache instance based on ``option``.
    """
    if not option:
        return None

    if isinstance(option, BaseCache):
        return option
    elif isinstance(option, type) and issubclass(option, BaseCache):
        return option()

    if option is True:
        directory = path.join(env.directory, '.webassets-cache')
        # Auto-create the default directory
        if not path.exists(directory):
            os.makedirs(directory)
    else:
        directory = option
    return FilesystemCache(directory)
        


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
        # time the package manager was created, and clearing any cached
        # values if they have.
        previous_settings = get_cache('filtered_settings', {})
 
        # Reduce the settings down to exclude channel info since that will
            # Caches various info from channels for performance
            cache_key = channel + '.repositories'
            channel_repositories = get_cache(cache_key)
 
            merge_cache_under_settings(self, 'package_name_map', channel)
        for repo in repositories[::-1]:
            cache_key = repo + '.packages'
            repository_packages = get_cache(cache_key)
 
            if repository_packages != None:

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
        # time the package manager was created, and clearing any cached
        # values if they have.
        previous_settings = get_cache('filtered_settings', {})
 
        # Reduce the settings down to exclude channel info since that will
            # Caches various info from channels for performance
            cache_key = channel + '.repositories'
            channel_repositories = get_cache(cache_key)
 
            merge_cache_under_settings(self, 'package_name_map', channel)
        for repo in repositories[::-1]:
            cache_key = repo + '.packages'
            repository_packages = get_cache(cache_key)
 
            if repository_packages != None:

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
        # time the package manager was created, and clearing any cached
        # values if they have.
        previous_settings = get_cache('filtered_settings', {})
 
        # Reduce the settings down to exclude channel info since that will
            # Caches various info from channels for performance
            cache_key = channel + '.repositories'
            channel_repositories = get_cache(cache_key)
 
            merge_cache_under_settings(self, 'package_name_map', channel)
        for repo in repositories[::-1]:
            cache_key = repo + '.packages'
            repository_packages = get_cache(cache_key)
 
            if repository_packages != None:

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
        # time the package manager was created, and clearing any cached
        # values if they have.
        previous_settings = get_cache('filtered_settings', {})
 
        # Reduce the settings down to exclude channel info since that will
            # Caches various info from channels for performance
            cache_key = channel + '.repositories'
            channel_repositories = get_cache(cache_key)
 
            merge_cache_under_settings(self, 'package_name_map', channel)
        for repo in repositories[::-1]:
            cache_key = repo + '.packages'
            repository_packages = get_cache(cache_key)
 
            if repository_packages != None:

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
        # time the package manager was created, and clearing any cached
        # values if they have.
        previous_settings = get_cache('filtered_settings', {})
 
        # Reduce the settings down to exclude channel info since that will
            # Caches various info from channels for performance
            cache_key = channel + '.repositories'
            channel_repositories = get_cache(cache_key)
 
            merge_cache_under_settings(self, 'package_name_map', channel)
        for repo in repositories[::-1]:
            cache_key = repo + '.packages'
            repository_packages = get_cache(cache_key)
 
            if repository_packages != None:

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
        # time the package manager was created, and clearing any cached
        # values if they have.
        previous_settings = get_cache('filtered_settings', {})
 
        # Reduce the settings down to exclude channel info since that will
            # Caches various info from channels for performance
            cache_key = channel + '.repositories'
            channel_repositories = get_cache(cache_key)
 
            merge_cache_under_settings(self, 'package_name_map', channel)
        for repo in repositories[::-1]:
            cache_key = repo + '.packages'
            repository_packages = get_cache(cache_key)
 
            if repository_packages != None:

src/c/h/ChocolateyPackages-HEAD/EthanBrown.SublimeText2.UtilPackages/tools/PackageCache/Package Control/package_control/download_manager.py   ChocolateyPackages(Download)
from .show_error import show_error
from .console_write import console_write
from .cache import set_cache, get_cache
from .unicode import unicode_from_os
 
        timeout = self.settings.get('timeout', 3)
 
        rate_limited_domains = get_cache('rate_limited_domains', [])
        no_ca_cert_domains = get_cache('no_ca_cert_domains', [])
 

src/a/l/Alfred-Popclip-Sublime-HEAD/Sublime Text 2/Package Control/package_control/download_manager.py   Alfred-Popclip-Sublime(Download)
from .show_error import show_error
from .console_write import console_write
from .cache import set_cache, get_cache
from .unicode import unicode_from_os
 
        timeout = self.settings.get('timeout', 3)
 
        rate_limited_domains = get_cache('rate_limited_domains', [])
        no_ca_cert_domains = get_cache('no_ca_cert_domains', [])
 

src/s/u/Sublime-Text-2-Settings-HEAD/Package Control/package_control/download_manager.py   Sublime-Text-2-Settings(Download)
from .show_error import show_error
from .console_write import console_write
from .cache import set_cache, get_cache
from .unicode import unicode_from_os
 
        timeout = self.settings.get('timeout', 3)
 
        rate_limited_domains = get_cache('rate_limited_domains', [])
        no_ca_cert_domains = get_cache('no_ca_cert_domains', [])
 

src/f/e/FED-Sublime-Settings-HEAD/Package Control/package_control/download_manager.py   FED-Sublime-Settings(Download)
from .show_error import show_error
from .console_write import console_write
from .cache import set_cache, get_cache
from .unicode import unicode_from_os
 
        timeout = self.settings.get('timeout', 3)
 
        rate_limited_domains = get_cache('rate_limited_domains', [])
        no_ca_cert_domains = get_cache('no_ca_cert_domains', [])
 

  1 | 2 | 3 | 4  Next