diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2017-01-22 09:36:50 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2017-01-22 09:36:50 +0300 |
commit | 736a26da764f61c9b71555dea7ffdbf3935c5591 (patch) | |
tree | ad073852dc88303940c99caf0c0cef8c6cd1df30 /bin/track_status.py | |
parent | revert most of the recent Pylint fixes (diff) | |
download | vk-scripts-736a26da764f61c9b71555dea7ffdbf3935c5591.tar.gz vk-scripts-736a26da764f61c9b71555dea7ffdbf3935c5591.zip |
fix Pylint warnings
Diffstat (limited to '')
-rw-r--r-- | bin/track_status.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/bin/track_status.py b/bin/track_status.py index c221c53..d8d8908 100644 --- a/bin/track_status.py +++ b/bin/track_status.py @@ -27,7 +27,10 @@ def _parse_database_format(s): except ValueError: raise argparse.ArgumentTypeError('invalid database format: ' + s) -def _parse_args(args=sys.argv): +def _parse_args(args=None): + if args is None: + args = sys.argv[1:] + parser = argparse.ArgumentParser( description='Track when people go online/offline.') @@ -51,7 +54,7 @@ def _parse_args(args=sys.argv): default=None, help='set database file path') - return parser.parse_args(args[1:]) + return parser.parse_args(args) def track_status( uids, timeout=DEFAULT_TIMEOUT, @@ -70,9 +73,8 @@ def track_status( tracker.add_database_writer(db_writer) tracker.loop(uids) -def main(args=sys.argv): - args = _parse_args(args) - track_status(**vars(args)) +def main(args=None): + track_status(**vars(_parse_args(args))) if __name__ == '__main__': main() |