diff --git a/djangoblog/whoosh_cn_backend.py b/djangoblog/whoosh_cn_backend.py index 04e3f7fd..b885613f 100644 --- a/djangoblog/whoosh_cn_backend.py +++ b/djangoblog/whoosh_cn_backend.py @@ -40,17 +40,17 @@ except ImportError: raise MissingDependency( "The 'whoosh' backend requires the installation of 'Whoosh'. Please refer to the documentation.") -# Handle minimum requirement. +#姜雨菲: 检查Whoosh版本,要求2.5.0及以上 if not hasattr(whoosh, '__version__') or whoosh.__version__ < (2, 5, 0): raise MissingDependency( "The 'whoosh' backend requires version 2.5.0 or greater.") -# Bubble up the correct error. - +#姜雨菲:日期时间格式正则表达式,用于解析Whoosh返回的日期时间字符串 DATETIME_REGEX = re.compile( '^(?P\d{4})-(?P\d{2})-(?P\d{2})T(?P\d{2}):(?P\d{2}):(?P\d{2})(\.\d{3,6}Z?)?$') LOCALS = threading.local() -LOCALS.RAM_STORE = None +LOCALS.RAM_STORE = None # 线程本地存储,用于内存存储模式 + class WhooshHtmlFormatter(HtmlFormatter):