From 70d6ee02d34bac89ba76bb87bbd2c04420f841cf Mon Sep 17 00:00:00 2001 From: pictuga Date: Sat, 18 Sep 2021 16:08:01 +0200 Subject: [PATCH] cache: avoid name collision --- morss/{cache.py => caching.py} | 0 morss/crawler.py | 2 +- morss/morss.py | 4 ++-- morss/wsgi.py | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) rename morss/{cache.py => caching.py} (100%) diff --git a/morss/cache.py b/morss/caching.py similarity index 100% rename from morss/cache.py rename to morss/caching.py diff --git a/morss/crawler.py b/morss/crawler.py index f73923c..396d21d 100644 --- a/morss/crawler.py +++ b/morss/crawler.py @@ -28,7 +28,7 @@ from io import BytesIO, StringIO import chardet -from .cache import default_cache +from .caching import default_cache try: # python 2 diff --git a/morss/morss.py b/morss/morss.py index bcc4069..b24b600 100644 --- a/morss/morss.py +++ b/morss/morss.py @@ -25,7 +25,7 @@ import lxml.etree import lxml.html from dateutil import tz -from . import crawler, feeds, readabilite +from . import caching, crawler, feeds, readabilite try: # python 2 @@ -411,7 +411,7 @@ def process(url, cache=None, options=None): options = Options(options) if cache: - crawler.default_cache = crawler.SQLiteCache(cache) + caching.default_cache = caching.SQLiteCache(cache) url, rss = FeedFetch(url, options) rss = FeedGather(rss, url, options) diff --git a/morss/wsgi.py b/morss/wsgi.py index 6489810..0bd0d31 100644 --- a/morss/wsgi.py +++ b/morss/wsgi.py @@ -33,7 +33,7 @@ except ImportError: # python 3 from urllib.parse import unquote -from . import crawler, readabilite +from . import caching, crawler, readabilite from .morss import (DELAY, TIMEOUT, FeedFetch, FeedFormat, FeedGather, MorssException, Options, log) @@ -287,7 +287,7 @@ class WSGIRequestHandlerRequestUri(wsgiref.simple_server.WSGIRequestHandler): def cgi_start_server(): - crawler.default_cache.autotrim() + caching.default_cache.autotrim() print('Serving http://localhost:%s/' % PORT) httpd = wsgiref.simple_server.make_server('', PORT, application, handler_class=WSGIRequestHandlerRequestUri) @@ -295,4 +295,4 @@ def cgi_start_server(): if 'gunicorn' in os.getenv('SERVER_SOFTWARE', ''): - crawler.default_cache.autotrim() + caching.default_cache.autotrim()