mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-15 02:54:09 -04:00
flake8
This commit is contained in:
parent
a37317c311
commit
0bd7b44ed5
1 changed files with 7 additions and 6 deletions
|
@ -481,7 +481,8 @@ class TokenEater:
|
||||||
timestamp = time.ctime(time.time())
|
timestamp = time.ctime(time.time())
|
||||||
# The time stamp in the header doesn't have the same format as that
|
# The time stamp in the header doesn't have the same format as that
|
||||||
# generated by xgettext...
|
# generated by xgettext...
|
||||||
print(pot_header % {'time': timestamp, 'version': __version__}, file=fp)
|
print(pot_header % {'time': timestamp, 'version': __version__},
|
||||||
|
file=fp)
|
||||||
# Sort the entries. First sort each particular entry's keys, then
|
# Sort the entries. First sort each particular entry's keys, then
|
||||||
# sort all the entries by their first item.
|
# sort all the entries by their first item.
|
||||||
reverse = {}
|
reverse = {}
|
||||||
|
@ -512,8 +513,8 @@ class TokenEater:
|
||||||
elif options.locationstyle == options.SOLARIS:
|
elif options.locationstyle == options.SOLARIS:
|
||||||
for filename, lineno in v:
|
for filename, lineno in v:
|
||||||
d = {'filename': filename, 'lineno': lineno}
|
d = {'filename': filename, 'lineno': lineno}
|
||||||
print(_(
|
print(_('# File: %(filename)s, line: %(lineno)d') % d,
|
||||||
'# File: %(filename)s, line: %(lineno)d') % d, file=fp)
|
file=fp)
|
||||||
elif options.locationstyle == options.GNU:
|
elif options.locationstyle == options.GNU:
|
||||||
# fit as many locations on one line, as long as the
|
# fit as many locations on one line, as long as the
|
||||||
# resulting line length doesn't exceeds 'options.width'
|
# resulting line length doesn't exceeds 'options.width'
|
||||||
|
@ -652,8 +653,8 @@ def main():
|
||||||
options.toexclude = fp.readlines()
|
options.toexclude = fp.readlines()
|
||||||
fp.close()
|
fp.close()
|
||||||
except IOError:
|
except IOError:
|
||||||
print(_(
|
print(_("Can't read --exclude-file: %s") % options.excludefilename,
|
||||||
"Can't read --exclude-file: %s") % options.excludefilename, file=sys.stderr)
|
file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
options.toexclude = []
|
options.toexclude = []
|
||||||
|
@ -688,7 +689,7 @@ def main():
|
||||||
except tokenize.TokenError as e:
|
except tokenize.TokenError as e:
|
||||||
print('%s: %s, line %d, column %d' % (
|
print('%s: %s, line %d, column %d' % (
|
||||||
e[0], filename, e[1][0], e[1][1]), file=sys.stderr)
|
e[0], filename, e[1][0], e[1][1]), file=sys.stderr)
|
||||||
except StopTokenizing:
|
except tokenize.StopTokenizing:
|
||||||
pass
|
pass
|
||||||
finally:
|
finally:
|
||||||
if closep:
|
if closep:
|
||||||
|
|
Loading…
Add table
Reference in a new issue