Skip to content

Commit f38adc3

Browse files
committed
flake8 fixes: whitespace, remove unused imports
1 parent f7e4cc3 commit f38adc3

20 files changed

+56
-49
lines changed

roundup/admin.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ def do_initialise(self, tracker_home, args):
653653
tx_Source='cli')
654654
except OptionUnsetError as e:
655655
raise UsageError("In %(tracker_home)s/config.ini - %(error)s" % {
656-
'error': str(e), 'tracker_home': tracker_home })
656+
'error': str(e), 'tracker_home': tracker_home})
657657

658658
return 0
659659

@@ -1739,12 +1739,12 @@ def do_migrate(self, args):
17391739
into the habit.
17401740
"""
17411741
if self.db.db_version_updated:
1742-
print(_('Tracker updated to schema version %s.') %
1742+
print(_('Tracker updated to schema version %s.') %
17431743
self.db.database_schema['version'])
17441744
self.db_uncommitted = True
17451745
else:
17461746
print(_('No migration action required. At schema version %s.') %
1747-
self.db.database_schema['version'])
1747+
self.db.database_schema['version'])
17481748
return 0
17491749

17501750
def do_perftest(self, args):
@@ -1763,14 +1763,13 @@ def do_perftest(self, args):
17631763
"""
17641764
from roundup.anypy.time_ import perf_counter
17651765

1766-
props = { "rounds": self.db.config.PASSWORD_PBKDF2_DEFAULT_ROUNDS,
1767-
"scheme": password.Password.known_schemes[0]
1768-
}
1766+
props = {"rounds": self.db.config.PASSWORD_PBKDF2_DEFAULT_ROUNDS,
1767+
"scheme": password.Password.known_schemes[0]}
17691768

17701769
print_supported_schemes = lambda: print(
1771-
"Supported schemes (default is first, case "
1772-
"sensitive):\n %s." %
1773-
", ".join(password.Password.known_schemes))
1770+
"Supported schemes (default is first, case "
1771+
"sensitive):\n %s." %
1772+
", ".join(password.Password.known_schemes))
17741773

17751774
if (args[0].find("=") != -1):
17761775
args.insert(0, 'password')
@@ -1780,7 +1779,7 @@ def do_perftest(self, args):
17801779
if args[0] == "password":
17811780
try:
17821781
# convert 10,000,000 or 10.000.000 to 10000000
1783-
r = int(re.sub('[,.]','',props['rounds']))
1782+
r = int(re.sub('[,.]', '', props['rounds']))
17841783
if r < 1000:
17851784
print(_("Invalid 'rounds'. Must be larger than 999."))
17861785
return
@@ -1789,7 +1788,7 @@ def do_perftest(self, args):
17891788
print(_("Invalid 'rounds'. It must be an integer not: %s") %
17901789
props['rounds'])
17911790
return
1792-
if props['scheme'] == None:
1791+
if props['scheme'] is None:
17931792
print_supported_schemes()
17941793
return
17951794

roundup/anypy/cookie_.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
from http.cookies import _getdate as get_cookie_date
77
except ImportError:
88
# Python 2.5-2.7
9-
from Cookie import CookieError, BaseCookie, SimpleCookie
10-
from Cookie import _getdate as get_cookie_date
9+
from Cookie import CookieError, BaseCookie, SimpleCookie # noqa: F401
10+
from Cookie import _getdate as get_cookie_date # noqa: F401

roundup/anypy/http_.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
server.DEFAULT_ERROR_MESSAGE
55
except (ImportError, AttributeError):
66
# Python 2.5-2.7
7-
import httplib as client
8-
import BaseHTTPServer as server
7+
import httplib as client # noqa: F401
8+
import BaseHTTPServer as server # noqa: F401

roundup/anypy/random_.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ def seed(v=None):
2020
# don't completely throw away the existing state, but add some
2121
# more random state to the existing state
2222
def seed(v=None):
23-
import os, time
23+
import os
24+
import time
2425
_r.seed((_r.getstate(),
2526
v,
2627
hasattr(os, 'getpid') and os.getpid(),

roundup/anypy/ssl_.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
from ssl import SSLError
44
except (ImportError, AttributeError):
55
# Python 2.5-2.7
6-
from socket import sslerror as SSLError
6+
from socket import sslerror as SSLError # noqa: F401

roundup/anypy/time_.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
from time import perf_counter
44
except (ImportError, AttributeError):
55
# Python 2.5-2.7
6-
from time import clock as perf_counter
6+
from time import clock as perf_counter # noqa: F401

roundup/anypy/urllib_.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
from urllib.request import urlopen
77
except ImportError:
88
# Python 2.5-2.7
9-
from urllib import quote, unquote, urlencode
10-
from urllib2 import urlopen
11-
from urlparse import urlparse, parse_qs, urlunparse
9+
from urllib import quote, unquote, urlencode # noqa: F401
10+
from urllib2 import urlopen # noqa: F401
11+
from urlparse import urlparse, parse_qs, urlunparse # noqa: F401

roundup/cgi/KeywordsExpr.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
this.brackets = false;
4848
4949
this.infix = function() {
50-
return this.x.brackets
50+
return this.x.brackets
5151
? "NOT(" + this.x.infix() + ")"
5252
: "NOT " + this.x.infix();
5353
}
@@ -126,7 +126,7 @@
126126
out += '>';
127127
out += '<option value="-1"><\/option>';
128128
for (var i = 0; i < KEYWORDS.length; ++i) {
129-
out += '<option value="' + KEYWORDS[i][0] +
129+
out += '<option value="' + KEYWORDS[i][0] +
130130
'">' + KEYWORDS[i][1] + "<\/option>";
131131
}
132132
out += '<\/select>';
@@ -175,7 +175,7 @@
175175
}
176176
177177
function undo_clicked() {
178-
current = undo.length > 0
178+
current = undo.length > 0
179179
? undo.pop()
180180
: original;
181181
set_content();

roundup/cgi/TranslationService.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class TranslationServiceMixin:
2626
def translate(self, domain, msgid, mapping=None,
2727
context=None, target_language=None, default=None):
2828
_msg = self.gettext(msgid)
29-
#print ("TRANSLATE", msgid, _msg, mapping, context)
29+
# print ("TRANSLATE", msgid, _msg, mapping, context)
3030
_msg = TALInterpreter.interpolate(_msg, mapping)
3131
return _msg
3232

roundup/cgi/apache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def handler(req):
149149
_env["CGI_SHOW_TIMING"] = _timing
150150
_form = cgi.FieldStorage(req, environ=_env)
151151
_client = _tracker.Client(_tracker, Request(req), _env, _form,
152-
translator=TranslationService.get_translation(_lang,
152+
translator=TranslationService.get_translation(_lang,
153153
tracker_home=_home))
154154
_client.main()
155155
return apache.OK

0 commit comments

Comments
 (0)