# HG changeset patch # User John Rouillard # Date 1679163391 14400 # Node ID 07ce4e4110f587bf6a878f9c15a9cb22537969ed # Parent 1e004afe87bb1399584e5f217638d19b9128d27c flake8 fixes: whitespace, remove unused imports diff -r 1e004afe87bb -r 07ce4e4110f5 roundup/admin.py --- a/roundup/admin.py Thu Mar 16 16:34:11 2023 -0400 +++ b/roundup/admin.py Sat Mar 18 14:16:31 2023 -0400 @@ -653,7 +653,7 @@ tx_Source='cli') except OptionUnsetError as e: raise UsageError("In %(tracker_home)s/config.ini - %(error)s" % { - 'error': str(e), 'tracker_home': tracker_home }) + 'error': str(e), 'tracker_home': tracker_home}) return 0 @@ -1739,12 +1739,12 @@ into the habit. """ if self.db.db_version_updated: - print(_('Tracker updated to schema version %s.') % + print(_('Tracker updated to schema version %s.') % self.db.database_schema['version']) self.db_uncommitted = True else: print(_('No migration action required. At schema version %s.') % - self.db.database_schema['version']) + self.db.database_schema['version']) return 0 def do_perftest(self, args): @@ -1763,14 +1763,13 @@ """ from roundup.anypy.time_ import perf_counter - props = { "rounds": self.db.config.PASSWORD_PBKDF2_DEFAULT_ROUNDS, - "scheme": password.Password.known_schemes[0] - } + props = {"rounds": self.db.config.PASSWORD_PBKDF2_DEFAULT_ROUNDS, + "scheme": password.Password.known_schemes[0]} print_supported_schemes = lambda: print( - "Supported schemes (default is first, case " - "sensitive):\n %s." % - ", ".join(password.Password.known_schemes)) + "Supported schemes (default is first, case " + "sensitive):\n %s." % + ", ".join(password.Password.known_schemes)) if (args[0].find("=") != -1): args.insert(0, 'password') @@ -1780,7 +1779,7 @@ if args[0] == "password": try: # convert 10,000,000 or 10.000.000 to 10000000 - r = int(re.sub('[,.]','',props['rounds'])) + r = int(re.sub('[,.]', '', props['rounds'])) if r < 1000: print(_("Invalid 'rounds'. Must be larger than 999.")) return @@ -1789,7 +1788,7 @@ print(_("Invalid 'rounds'. It must be an integer not: %s") % props['rounds']) return - if props['scheme'] == None: + if props['scheme'] is None: print_supported_schemes() return diff -r 1e004afe87bb -r 07ce4e4110f5 roundup/anypy/cookie_.py --- a/roundup/anypy/cookie_.py Thu Mar 16 16:34:11 2023 -0400 +++ b/roundup/anypy/cookie_.py Sat Mar 18 14:16:31 2023 -0400 @@ -6,5 +6,5 @@ from http.cookies import _getdate as get_cookie_date except ImportError: # Python 2.5-2.7 - from Cookie import CookieError, BaseCookie, SimpleCookie - from Cookie import _getdate as get_cookie_date + from Cookie import CookieError, BaseCookie, SimpleCookie # noqa: F401 + from Cookie import _getdate as get_cookie_date # noqa: F401 diff -r 1e004afe87bb -r 07ce4e4110f5 roundup/anypy/http_.py --- a/roundup/anypy/http_.py Thu Mar 16 16:34:11 2023 -0400 +++ b/roundup/anypy/http_.py Sat Mar 18 14:16:31 2023 -0400 @@ -4,5 +4,5 @@ server.DEFAULT_ERROR_MESSAGE except (ImportError, AttributeError): # Python 2.5-2.7 - import httplib as client - import BaseHTTPServer as server + import httplib as client # noqa: F401 + import BaseHTTPServer as server # noqa: F401 diff -r 1e004afe87bb -r 07ce4e4110f5 roundup/anypy/random_.py --- a/roundup/anypy/random_.py Thu Mar 16 16:34:11 2023 -0400 +++ b/roundup/anypy/random_.py Sat Mar 18 14:16:31 2023 -0400 @@ -20,7 +20,8 @@ # don't completely throw away the existing state, but add some # more random state to the existing state def seed(v=None): - import os, time + import os + import time _r.seed((_r.getstate(), v, hasattr(os, 'getpid') and os.getpid(), diff -r 1e004afe87bb -r 07ce4e4110f5 roundup/anypy/ssl_.py --- a/roundup/anypy/ssl_.py Thu Mar 16 16:34:11 2023 -0400 +++ b/roundup/anypy/ssl_.py Sat Mar 18 14:16:31 2023 -0400 @@ -3,4 +3,4 @@ from ssl import SSLError except (ImportError, AttributeError): # Python 2.5-2.7 - from socket import sslerror as SSLError + from socket import sslerror as SSLError # noqa: F401 diff -r 1e004afe87bb -r 07ce4e4110f5 roundup/anypy/time_.py --- a/roundup/anypy/time_.py Thu Mar 16 16:34:11 2023 -0400 +++ b/roundup/anypy/time_.py Sat Mar 18 14:16:31 2023 -0400 @@ -3,4 +3,4 @@ from time import perf_counter except (ImportError, AttributeError): # Python 2.5-2.7 - from time import clock as perf_counter + from time import clock as perf_counter # noqa: F401 diff -r 1e004afe87bb -r 07ce4e4110f5 roundup/anypy/urllib_.py --- a/roundup/anypy/urllib_.py Thu Mar 16 16:34:11 2023 -0400 +++ b/roundup/anypy/urllib_.py Sat Mar 18 14:16:31 2023 -0400 @@ -6,6 +6,6 @@ from urllib.request import urlopen except ImportError: # Python 2.5-2.7 - from urllib import quote, unquote, urlencode - from urllib2 import urlopen - from urlparse import urlparse, parse_qs, urlunparse + from urllib import quote, unquote, urlencode # noqa: F401 + from urllib2 import urlopen # noqa: F401 + from urlparse import urlparse, parse_qs, urlunparse # noqa: F401 diff -r 1e004afe87bb -r 07ce4e4110f5 roundup/cgi/KeywordsExpr.py --- a/roundup/cgi/KeywordsExpr.py Thu Mar 16 16:34:11 2023 -0400 +++ b/roundup/cgi/KeywordsExpr.py Sat Mar 18 14:16:31 2023 -0400 @@ -47,7 +47,7 @@ this.brackets = false; this.infix = function() { - return this.x.brackets + return this.x.brackets ? "NOT(" + this.x.infix() + ")" : "NOT " + this.x.infix(); } @@ -126,7 +126,7 @@ out += '>'; out += '