Run isort on project

Signed-off-by: Alfred Wingate <parona@protonmail.com>
This commit is contained in:
Alfred Wingate 2023-11-14 23:04:18 +02:00
parent d860708ec9
commit 70f88ed37d
No known key found for this signature in database
GPG Key ID: A12750536B5E7010
21 changed files with 99 additions and 83 deletions

View File

@ -17,23 +17,21 @@ __description__ = "A tool to detect new upstream releases."
# Imports # Imports
import sys
import getopt import getopt
import sys
from errno import EINTR, EINVAL from errno import EINTR, EINVAL
from http.client import HTTPConnection from http.client import HTTPConnection
from portage import settings
from portage.output import white, yellow, turquoise, green
from portage.exception import AmbiguousPackageName
from gentoolkit import pprinter as pp from gentoolkit import pprinter as pp
from gentoolkit.errors import GentoolkitException from gentoolkit.errors import GentoolkitException
from portage import settings
from portage.exception import AmbiguousPackageName
from portage.output import green, turquoise, white, yellow
from euscan import CONFIG, output from euscan import CONFIG, output
from euscan.out import progress_bar from euscan.out import progress_bar
from euscan._version import __version__ from euscan._version import __version__
# Globals # Globals
isatty = os.environ.get("TERM") != "dumb" and sys.stdout.isatty() isatty = os.environ.get("TERM") != "dumb" and sys.stdout.isatty()
isatty_stderr = os.environ.get("TERM") != "dumb" and sys.stderr.isatty() isatty_stderr = os.environ.get("TERM") != "dumb" and sys.stderr.isatty()

View File

@ -1,20 +1,19 @@
#!/usr/bin/env python #!/usr/bin/env python
import os
import sys
import re
import urllib
from tempfile import mkstemp
import tarfile
import gzip import gzip
import logging import logging
import os
import re
import shutil import shutil
import sys
import tarfile
import urllib
from difflib import unified_diff from difflib import unified_diff
from tempfile import mkstemp
from portage.exception import AmbiguousPackageName
from gentoolkit.query import Query
from BeautifulSoup import BeautifulSoup, SoupStrainer from BeautifulSoup import BeautifulSoup, SoupStrainer
from gentoolkit.query import Query
from portage.exception import AmbiguousPackageName
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)

View File

@ -7,7 +7,6 @@ import configparser
import os import os
from ast import literal_eval from ast import literal_eval
CONFIG = { CONFIG = {
"nocolor": False, "nocolor": False,
"quiet": False, "quiet": False,

View File

@ -1,13 +1,10 @@
import importlib
import os import os
import sys import sys
import importlib
import portage import portage
from portage import _encodings, _shell_quote, _unicode_decode, _unicode_encode
from portage.const import VDB_PATH from portage.const import VDB_PATH
from portage import _encodings
from portage import _shell_quote
from portage import _unicode_decode
from portage import _unicode_encode
# Stolen from the ebuild command # Stolen from the ebuild command

View File

@ -1,11 +1,11 @@
import os import os
import sys
import pkgutil import pkgutil
import sys
from euscan import CONFIG, output
from portage.xml.metadata import MetaDataXML from portage.xml.metadata import MetaDataXML
from euscan import CONFIG, output
handlers = {"package": [], "url": [], "all": {}} handlers = {"package": [], "url": [], "all": {}}
# autoimport all modules in this directory and append them to handlers list # autoimport all modules in this directory and append them to handlers list

View File

@ -1,11 +1,13 @@
import re import re
import urllib.request, urllib.parse, urllib.error import urllib.error
import urllib.parse
import urllib.request
import portage import portage
from euscan.helpers import regex_from_template
from euscan.handlers.url import process_scan as url_scan
from euscan import output from euscan import output
from euscan.handlers.url import process_scan as url_scan
from euscan.helpers import regex_from_template
HANDLER_NAME = "berlios" HANDLER_NAME = "berlios"
CONFIDENCE = 90 CONFIDENCE = 90

View File

@ -1,9 +1,12 @@
import re
import portage
import urllib.request, urllib.error, urllib.parse
import json import json
import re
import urllib.error
import urllib.parse
import urllib.request
from euscan import helpers, output, mangling import portage
from euscan import helpers, mangling, output
HANDLER_NAME = "cpan" HANDLER_NAME = "cpan"
CONFIDENCE = 100 CONFIDENCE = 100

View File

@ -1,11 +1,13 @@
import urllib.request, urllib.parse, urllib.error
import re
import bz2 import bz2
import re
import urllib.error
import urllib.parse
import urllib.request
import zlib import zlib
import portage import portage
from euscan import mangling, helpers, output from euscan import helpers, mangling, output
HANDLER_NAME = "deb" HANDLER_NAME = "deb"
CONFIDENCE = 100 CONFIDENCE = 100

View File

@ -1,9 +1,11 @@
import urllib.request, urllib.parse, urllib.error
import re import re
import urllib.error
import urllib.parse
import urllib.request
import portage import portage
from euscan import mangling, helpers, output from euscan import helpers, mangling, output
HANDLER_NAME = "freecode" HANDLER_NAME = "freecode"
CONFIDENCE = 100 CONFIDENCE = 100

View File

@ -1,8 +1,10 @@
from urllib.parse import urljoin, urlparse
import urllib.request, urllib.error, urllib.parse
import re
import io
import difflib import difflib
import io
import re
import urllib.error
import urllib.parse
import urllib.request
from urllib.parse import urljoin, urlparse
try: try:
from BeautifulSoup import BeautifulSoup from BeautifulSoup import BeautifulSoup
@ -12,13 +14,13 @@ except ImportError:
import portage import portage
from euscan import ( from euscan import (
output,
helpers,
mangling,
CONFIG,
SCANDIR_BLACKLIST_URLS,
BRUTEFORCE_BLACKLIST_PACKAGES, BRUTEFORCE_BLACKLIST_PACKAGES,
BRUTEFORCE_BLACKLIST_URLS, BRUTEFORCE_BLACKLIST_URLS,
CONFIG,
SCANDIR_BLACKLIST_URLS,
helpers,
mangling,
output,
) )
HANDLER_NAME = "generic" HANDLER_NAME = "generic"

View File

@ -1,10 +1,12 @@
import json import json
import urllib.request, urllib.error, urllib.parse
import re import re
import urllib.error
import urllib.parse
import urllib.request
import portage import portage
from euscan import helpers, output, mangling from euscan import helpers, mangling, output
HANDLER_NAME = "github" HANDLER_NAME = "github"
CONFIDENCE = 100 CONFIDENCE = 100

View File

@ -1,7 +1,9 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import re import re
import urllib.request, urllib.error, urllib.parse import urllib.error
import urllib.parse
import urllib.request
try: try:
import simplejson as json import simplejson as json
@ -10,7 +12,7 @@ except ImportError:
import portage import portage
from euscan import mangling, helpers, output from euscan import helpers, mangling, output
HANDLER_NAME = "gnome" HANDLER_NAME = "gnome"
CONFIDENCE = 100 CONFIDENCE = 100

View File

@ -1,9 +1,10 @@
import re import re
import portage import portage
from euscan import output from euscan import output
from euscan.helpers import regex_from_template
from euscan.handlers.url import process_scan as url_scan from euscan.handlers.url import process_scan as url_scan
from euscan.helpers import regex_from_template
HANDLER_NAME = "google-code" HANDLER_NAME = "google-code"
CONFIDENCE = 90 CONFIDENCE = 90

View File

@ -1,9 +1,12 @@
import re import re
import portage import urllib.error
import urllib.request, urllib.error, urllib.parse import urllib.parse
import urllib.request
import xml.dom.minidom import xml.dom.minidom
from euscan import helpers, output, mangling import portage
from euscan import helpers, mangling, output
HANDLER_NAME = "php" HANDLER_NAME = "php"
CONFIDENCE = 100 CONFIDENCE = 100

View File

@ -1,9 +1,9 @@
import xmlrpc.client
import re import re
import xmlrpc.client
import portage import portage
from euscan import mangling, helpers, output from euscan import helpers, mangling, output
HANDLER_NAME = "pypi" HANDLER_NAME = "pypi"
CONFIDENCE = 100 CONFIDENCE = 100

View File

@ -1,9 +1,12 @@
import re
import portage
import json import json
import urllib.request, urllib.error, urllib.parse import re
import urllib.error
import urllib.parse
import urllib.request
from euscan import helpers, output, mangling import portage
from euscan import helpers, mangling, output
HANDLER_NAME = "rubygems" HANDLER_NAME = "rubygems"
CONFIDENCE = 100 CONFIDENCE = 100

View File

@ -2,9 +2,9 @@ import re
import portage import portage
from euscan.helpers import regex_from_template
from euscan.handlers.url import process_scan as url_scan
from euscan import output from euscan import output
from euscan.handlers.url import process_scan as url_scan
from euscan.helpers import regex_from_template
HANDLER_NAME = "sourceforge" HANDLER_NAME = "sourceforge"
CONFIDENCE = 90 CONFIDENCE = 90

View File

@ -1,8 +1,10 @@
import re import re
import urllib.request, urllib.error, urllib.parse import urllib.error
import urllib.parse
import urllib.request
from euscan import helpers, output
from euscan.handlers import generic from euscan.handlers import generic
from euscan import output, helpers
PRIORITY = 100 PRIORITY = 100

View File

@ -1,21 +1,22 @@
import errno
import os import os
import re import re
import errno import urllib.error
import urllib.request, urllib.error, urllib.parse import urllib.parse
import urllib.request
from xml.dom.minidom import Document from xml.dom.minidom import Document
import portage import portage
from portage import dep from portage import dep
try: try:
from urllib import robotparser from urllib import robotparser, urlparse
from urllib import urlparse
except ImportError: except ImportError:
import urllib.robotparser import urllib.robotparser
import urllib.parse import urllib.parse
import euscan import euscan
from euscan import CONFIG, BLACKLIST_VERSIONS, ROBOTS_TXT_BLACKLIST_DOMAINS from euscan import BLACKLIST_VERSIONS, CONFIG, ROBOTS_TXT_BLACKLIST_DOMAINS
from euscan.version import parse_version from euscan.version import parse_version
@ -267,7 +268,7 @@ def urlallowed(url):
if baseurl in rpcache: if baseurl in rpcache:
rp = rpcache[baseurl] rp = rpcache[baseurl]
else: else:
from socket import setdefaulttimeout, getdefaulttimeout from socket import getdefaulttimeout, setdefaulttimeout
timeout = getdefaulttimeout() timeout = getdefaulttimeout()
setdefaulttimeout(5) setdefaulttimeout(5)

View File

@ -1,14 +1,14 @@
import sys
from io import StringIO
from collections import defaultdict
import json import json
import signal
import time
import re import re
import signal
import sys
import time
from collections import defaultdict
from io import StringIO
import portage import portage
from portage.output import EOutput, TermProgressBar
from gentoolkit import pprinter as pp from gentoolkit import pprinter as pp
from portage.output import EOutput, TermProgressBar
from euscan.helpers import dict_to_xml from euscan.helpers import dict_to_xml

View File

@ -2,18 +2,16 @@ import os
import sys import sys
from datetime import datetime from datetime import datetime
import portage
import gentoolkit.pprinter as pp import gentoolkit.pprinter as pp
from gentoolkit.query import Query import portage
from gentoolkit.package import Package from gentoolkit.package import Package
from gentoolkit.query import Query
from euscan import CONFIG, BLACKLIST_PACKAGES from euscan import BLACKLIST_PACKAGES, CONFIG, handlers, output
from euscan import handlers, output
from euscan.out import from_mirror
from euscan.helpers import version_blacklisted
from euscan.version import is_version_stable
from euscan.ebuild import package_from_ebuild from euscan.ebuild import package_from_ebuild
from euscan.helpers import version_blacklisted
from euscan.out import from_mirror
from euscan.version import is_version_stable
def filter_versions(cp, versions): def filter_versions(cp, versions):