当前位置: 首页>>代码示例>>Python>>正文


Python TreeDict.cache_directory方法代码示例

本文整理汇总了Python中treedict.TreeDict.cache_directory方法的典型用法代码示例。如果您正苦于以下问题:Python TreeDict.cache_directory方法的具体用法?Python TreeDict.cache_directory怎么用?Python TreeDict.cache_directory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在treedict.TreeDict的用法示例。


在下文中一共展示了TreeDict.cache_directory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: runTest

# 需要导入模块: from treedict import TreeDict [as 别名]
# 或者: from treedict.TreeDict import cache_directory [as 别名]
def runTest(preset_list, module, test_tree):
    
    # Run several different versions; with and without cache 

    def test(opttree):
        reset()
        initialize(opttree)
        runner = manager()
        
        results = runner.getResults(modules = [module], presets = preset_list)
        t = results[module]
        
        if type(test_tree) is TreeDict:
            for k, v in test_tree.iteritems():
                assert t[k] == v, ("%s: t[%s] != %s" % (module, k, repr(v)))
        else:
            assert test_tree == t
            
    
    opttree = TreeDict()
    opttree.project_directory = project_directory
    opttree.debug_mode = True
    opttree.verbose_mode = True
    
    test(opttree)
    
    opttree.cache_directory = join(project_directory, ".cache")
    
    test(opttree)
    test(opttree)
    
    shutil.rmtree(opttree.cache_directory, ignore_errors = True)
开发者ID:aurora1625,项目名称:lazyrunner,代码行数:34,代码来源:tests.py

示例2: type

# 需要导入模块: from treedict import TreeDict [as 别名]
# 或者: from treedict.TreeDict import cache_directory [as 别名]
__default_opttree.logging.format = (str, '%(asctime)s %(name)-12s %(levelname)-8s %(message)s', 
                                    'Format string used for the logging.')
__default_opttree.logging.datefmt = (str, '%H:%M:%S', 
                                    'Format string used for the date in the logging.')
    
__default_opttree.debug_mode = (is_boolean, False, "Enable debug mode in compilation.")
__default_opttree.use_hdf5 = (is_boolean, False, "Use hdf5 for caching instead of simple pickling.")
__default_opttree.cache_compression = (is_boolean, True, "Use bz2 compression on the cache files.")
__default_opttree.project_directory = (str, '.', "The root of the project directory.")
__default_opttree.verbose = (is_boolean, False, "Print more detailed diagnostic and progress messages.")
__default_opttree.no_cache = (is_boolean, False, "Disable the caching system.")
__default_opttree.force = (is_boolean, False, "Overwrite existing files when creating new modules.")
__default_opttree.cache_read_only = (is_boolean, False, "Only load things from cache; never save.")
__default_opttree.no_compile = (is_boolean, False, "Disable compiling things, even if source files are modified.")
__default_opttree.config_file = (str, 'conf', "The configuration file to load options from.")
__default_opttree.cache_directory = ([str, type(None)], None, "The cache directory to use; None disables caching.")
__default_opttree.import_list = (list, [], "List of modules / directories to import in loading project.")
__default_opttree.auto_import = (is_boolean, True, "Automatically import all subdirs with __init__.py files.")
__default_opttree.cython.use_cpp = (is_boolean, False, "Compile cython extensions in C++ mode.")

__default_opttree.cython.compiler_args = (list, [], "Additional arguments to use when compiling cython extensions.")
__default_opttree.cython.link_args = (list, [], "Additional arguments to use when linking cython extensions.")
__default_opttree.cython.extra_include_dirs = (list, [], "Additional include directories to pass to the compiler.")
__default_opttree.cython.extra_library_dirs = (list, [], "Additional library directories to pass to the linker.")
__default_opttree.cython.libraries = (list, [], "Additional libraries use in linking.")
__default_opttree.cython.numpy_needed = (is_boolean, False, "Load numpy libraries when compiling cython extension modules.")
__default_opttree.cython.library_map = (dict, {}, "Load specific librares for specific modules, given as name : list pairs.")
__default_opttree.cython.extra_source_map  = (dict, {}, "")

__default_opttree.freeze()
开发者ID:aurora1625,项目名称:lazyrunner,代码行数:32,代码来源:configuration.py


注:本文中的treedict.TreeDict.cache_directory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。