|
From: | Claus Klein |
Subject: | [gpsd-dev] [PATCH] to improve the nice script leapsecond.py |
Date: | Sun, 26 Oct 2014 15:17:56 +0100 |
Hi all while working with leapsecond.py from GPSD project I added the missing option -c generate a C initializer listing leap seconds in Unix gmt time. and a default action: With no option, get the current GPS leap-second value. like this: Claus-MacBook-Pro:gpsd clausklein$ ./leapsecond.py Current leap seconds since 1980: 16, valid from 2012-06-30T23:59:59 Claus-MacBook-Pro:gpsd clausklein$ I checked my changes with pep8 and found a lot of warnings. I decided to fix this warnings too: ./leapsecond.py:49:10: E401 multiple imports on one line ./leapsecond.py:64:8: E261 at least two spaces before inline comment ./leapsecond.py:72:8: E261 at least two spaces before inline comment ./leapsecond.py:77:10: E223 tab before operator ./leapsecond.py:78:14: E223 tab before operator ./leapsecond.py:78:33: E261 at least two spaces before inline comment ./leapsecond.py:79:9: E223 tab before operator ./leapsecond.py:79:41: W291 trailing whitespace ./leapsecond.py:81:1: E302 expected 2 blank lines, found 1 ./leapsecond.py:82:28: E226 missing whitespace around arithmetic operator ./leapsecond.py:84:1: E302 expected 2 blank lines, found 1 ./leapsecond.py:85:28: E226 missing whitespace around arithmetic operator ./leapsecond.py:87:1: E302 expected 2 blank lines, found 1 ./leapsecond.py:89:16: E721 do not compare types, use 'isinstance()' ./leapsecond.py:91:18: E721 do not compare types, use 'isinstance()' ./leapsecond.py:96:18: E721 do not compare types, use 'isinstance()' ./leapsecond.py:109:1: E302 expected 2 blank lines, found 1 ./leapsecond.py:111:32: E261 at least two spaces before inline comment ./leapsecond.py:130:1: E302 expected 2 blank lines, found 1 ./leapsecond.py:154:1: E302 expected 2 blank lines, found 1 ./leapsecond.py:155:111: E501 line too long (112 > 110 characters) ./leapsecond.py:156:32: E261 at least two spaces before inline comment ./leapsecond.py:180:62: E221 multiple spaces before operator ./leapsecond.py:185:1: E302 expected 2 blank lines, found 1 ./leapsecond.py:192:1: E302 expected 2 blank lines, found 1 ./leapsecond.py:218:1: E302 expected 2 blank lines, found 1 ./leapsecond.py:249:1: E302 expected 2 blank lines, found 1 ./leapsecond.py:251:10: E225 missing whitespace around operator ./leapsecond.py:252:10: E225 missing whitespace around operator ./leapsecond.py:253:11: E225 missing whitespace around operator ./leapsecond.py:254:11: E225 missing whitespace around operator ./leapsecond.py:256:22: E226 missing whitespace around arithmetic operator ./leapsecond.py:257:22: E226 missing whitespace around arithmetic operator ./leapsecond.py:258:24: E231 missing whitespace after ',' ./leapsecond.py:259:24: E226 missing whitespace around arithmetic operator ./leapsecond.py:260:15: E226 missing whitespace around arithmetic operator ./leapsecond.py:261:24: E226 missing whitespace around arithmetic operator ./leapsecond.py:263:16: E226 missing whitespace around arithmetic operator ./leapsecond.py:263:23: E226 missing whitespace around arithmetic operator ./leapsecond.py:263:30: E226 missing whitespace around arithmetic operator ./leapsecond.py:263:37: E226 missing whitespace around arithmetic operator ./leapsecond.py:263:40: E226 missing whitespace around arithmetic operator ./leapsecond.py:263:47: E226 missing whitespace around arithmetic operator ./leapsecond.py:263:53: E226 missing whitespace around arithmetic operator ./leapsecond.py:264:16: E226 missing whitespace around arithmetic operator ./leapsecond.py:264:22: E226 missing whitespace around arithmetic operator ./leapsecond.py:264:24: E226 missing whitespace around arithmetic operator ./leapsecond.py:264:32: E226 missing whitespace around arithmetic operator ./leapsecond.py:264:35: E226 missing whitespace around arithmetic operator ./leapsecond.py:264:42: E226 missing whitespace around arithmetic operator ./leapsecond.py:264:48: E226 missing whitespace around arithmetic operator ./leapsecond.py:273:1: E302 expected 2 blank lines, found 1 ./leapsecond.py:277:1: E302 expected 2 blank lines, found 1 ./leapsecond.py:281:1: E302 expected 2 blank lines, found 1 ./leapsecond.py:286:51: E231 missing whitespace after ',' ./leapsecond.py:293:47: E226 missing whitespace around arithmetic operator ./leapsecond.py:306:1: E302 expected 2 blank lines, found 1 ./leapsecond.py:310:1: E302 expected 2 blank lines, found 1 ./leapsecond.py:314:1: E302 expected 2 blank lines, found 1 ./leapsecond.py:319:25: W602 deprecated form of raising exception ./leapsecond.py:325:29: W602 deprecated form of raising exception ./leapsecond.py:331:29: W602 deprecated form of raising exception ./leapsecond.py:336:1: E302 expected 2 blank lines, found 1 ./leapsecond.py:343:46: E226 missing whitespace around arithmetic operator ./leapsecond.py:352:1: E302 expected 2 blank lines, found 1 ./leapsecond.py:354:21: W602 deprecated form of raising exception ./leapsecond.py:363:20: E225 missing whitespace around operator ./leapsecond.py:366:29: W602 deprecated form of raising exception ./leapsecond.py:369:29: W602 deprecated form of raising exception ./leapsecond.py:372:29: W602 deprecated form of raising exception ./leapsecond.py:375:29: W602 deprecated form of raising exception ./leapsecond.py:378:29: W602 deprecated form of raising exception ./leapsecond.py:381:29: W602 deprecated form of raising exception ./leapsecond.py:384:29: W602 deprecated form of raising exception ./leapsecond.py:387:29: W602 deprecated form of raising exception Now it is clean expect this pylint warnings: pylint-2.7 leapsecond.py Warning: option include-ids is deprecated and ignored. Warning: option symbols is deprecated and ignored. ************* Module leapsecond W:131, 0: FIXME retrieve() is unused! ck (fixme) W:266, 0: FIXME conditional_leapsecond_fetch() is unused! ck (fixme) W:248, 4: Unused variable '_isodate' (unused-variable) W:246, 4: Unused variable '_week' (unused-variable) W:247, 4: Unused variable '_rollovers' (unused-variable) W:249, 4: Unused variable '_leapsecs' (unused-variable) W:245, 4: Unused variable '_century' (unused-variable) W:279,20: Unused argument '_signum' (unused-argument) W:279,29: Unused argument '_frame' (unused-argument) Claus-MacBook-Pro:gpsd clausklein$ Would you like to accept my patch? With regards Claus |
leapsecond.py.patch
Description: Binary data
signature.asc
Description: Message signed with OpenPGP using GPGMail
[Prev in Thread] | Current Thread | [Next in Thread] |