aboutsummaryrefslogtreecommitdiff
path: root/newspipe/lib
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2020-03-10 22:29:19 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2020-03-10 22:29:19 +0100
commit7a08a6b548e39a477aaf49b6213a2e06a0f3498a (patch)
tree775895d433100fbbe0efdb6759a2b14e5a999d30 /newspipe/lib
parentremoved unused variable (diff)
downloadnewspipe-7a08a6b548e39a477aaf49b6213a2e06a0f3498a.tar.gz
newspipe-7a08a6b548e39a477aaf49b6213a2e06a0f3498a.tar.bz2
newspipe-7a08a6b548e39a477aaf49b6213a2e06a0f3498a.zip
cleaned imports
Diffstat (limited to 'newspipe/lib')
-rw-r--r--newspipe/lib/data.py10
-rw-r--r--newspipe/lib/feed_utils.py7
-rwxr-xr-xnewspipe/lib/misc_utils.py22
-rw-r--r--newspipe/lib/utils.py5
4 files changed, 24 insertions, 20 deletions
diff --git a/newspipe/lib/data.py b/newspipe/lib/data.py
index 61c481d1..52d05cd2 100644
--- a/newspipe/lib/data.py
+++ b/newspipe/lib/data.py
@@ -30,17 +30,17 @@ __license__ = "AGPLv3"
# This file contains the import/export functions of Newspipe.
#
+import datetime
import json
-import opml
import logging
-import datetime
+
+import opml
from flask import jsonify
from newspipe.bootstrap import db
-from newspipe.models import User, Feed, Article
-from newspipe.models.tag import BookmarkTag
from newspipe.controllers import BookmarkController, BookmarkTagController
-
+from newspipe.models import Article, Feed, User
+from newspipe.models.tag import BookmarkTag
logger = logging.getLogger(__name__)
diff --git a/newspipe/lib/feed_utils.py b/newspipe/lib/feed_utils.py
index 55cb6205..995bfaae 100644
--- a/newspipe/lib/feed_utils.py
+++ b/newspipe/lib/feed_utils.py
@@ -1,12 +1,13 @@
import html
-import urllib
import logging
-import requests
+import urllib
+
import feedparser
+import requests
from bs4 import BeautifulSoup, SoupStrainer
from newspipe.bootstrap import application
-from newspipe.lib.utils import try_keys, try_get_icon_url, rebuild_url
+from newspipe.lib.utils import rebuild_url, try_get_icon_url, try_keys
logger = logging.getLogger(__name__)
logging.captureWarnings(True)
diff --git a/newspipe/lib/misc_utils.py b/newspipe/lib/misc_utils.py
index 1a423466..1e246757 100755
--- a/newspipe/lib/misc_utils.py
+++ b/newspipe/lib/misc_utils.py
@@ -26,28 +26,30 @@ __revision__ = "$Date: 2016/11/22 $"
__copyright__ = "Copyright (c) Cedric Bonhomme"
__license__ = "AGPLv3"
-import re
-import os
-import sys
import glob
import logging
import operator
-import urllib
+import os
+import re
import subprocess
-import sqlalchemy
-
-try:
- from urlparse import urlparse, parse_qs, urlunparse
-except:
- from urllib.parse import urlparse, parse_qs, urlunparse, urljoin
+import sys
+import urllib
from collections import Counter
from contextlib import contextmanager
+
+import sqlalchemy
from flask import request
from newspipe.bootstrap import application
from newspipe.controllers import ArticleController
from newspipe.lib.utils import clear_string
+try:
+ from urlparse import urlparse, parse_qs, urlunparse
+except:
+ from urllib.parse import urlparse, parse_qs, urlunparse, urljoin
+
+
logger = logging.getLogger(__name__)
ALLOWED_EXTENSIONS = set(["xml", "opml", "json"])
diff --git a/newspipe/lib/utils.py b/newspipe/lib/utils.py
index 67ced60d..3d6bf0b8 100644
--- a/newspipe/lib/utils.py
+++ b/newspipe/lib/utils.py
@@ -1,9 +1,10 @@
+import logging
import re
import types
import urllib
-import logging
-import requests
from hashlib import md5
+
+import requests
from flask import request, url_for
from newspipe.bootstrap import application
bgstack15