From f5ccd844da4650cf50f42973567415f4c8b8e580 Mon Sep 17 00:00:00 2001 From: Jason Schwarzenberger Date: Mon, 16 Nov 2020 15:41:09 +1300 Subject: [PATCH] fix import error. --- apiserver/feeds/category.py | 2 +- apiserver/feeds/sitemap.py | 2 +- apiserver/{feeds/_news.py => misc/news.py} | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) rename apiserver/{feeds/_news.py => misc/news.py} (97%) diff --git a/apiserver/feeds/category.py b/apiserver/feeds/category.py index a58f82e..ec6aca5 100644 --- a/apiserver/feeds/category.py +++ b/apiserver/feeds/category.py @@ -12,7 +12,7 @@ from bs4 import BeautifulSoup import settings from utils import clean from misc.api import xml -from _news import Base +from misc.news import Base def _filter_links(links, category_url, excludes=None): links = list(filter(None, [link if link.startswith(category_url) else None for link in links])) diff --git a/apiserver/feeds/sitemap.py b/apiserver/feeds/sitemap.py index ac9f7e7..f0f807c 100644 --- a/apiserver/feeds/sitemap.py +++ b/apiserver/feeds/sitemap.py @@ -14,7 +14,7 @@ import settings from utils import clean from misc.time import unix from misc.api import xml -from _news import Base +from misc.news import Base def _get_sitemap_date(a): if a.find('lastmod'): diff --git a/apiserver/feeds/_news.py b/apiserver/misc/news.py similarity index 97% rename from apiserver/feeds/_news.py rename to apiserver/misc/news.py index 0b5041d..4d89ad8 100644 --- a/apiserver/feeds/_news.py +++ b/apiserver/misc/news.py @@ -3,10 +3,6 @@ logging.basicConfig( format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.DEBUG) -if __name__ == '__main__': - import sys - sys.path.insert(0,'.') - import requests from bs4 import BeautifulSoup from scrapers import declutter