From 75dba515dde5c388357c14d549bfbdc68298e191 Mon Sep 17 00:00:00 2001 From: Kevin Lyda <lyda@google.com> Date: Fri, 29 Jun 2012 13:53:01 +0100 Subject: [PATCH] Fix print issues in cli, add future imports. --- README.rst | 3 ++- chkcrontab | 6 ++++-- chkcrontab_lib.py | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 946defa..0dfa140 100644 --- a/README.rst +++ b/README.rst @@ -51,7 +51,8 @@ TODO * Look for duplicate entries. Puppet sometimes loads up crontabs with dups. * Check for backticks. (why?) -* Make sure MAILTO and PATH are set (perhaps others?) +* Make sure MAILTO and PATH are set (perhaps others?). +* Add tests for command line. Credits ======= diff --git a/chkcrontab b/chkcrontab index 9020dfb..ff5fe98 100755 --- a/chkcrontab +++ b/chkcrontab @@ -22,6 +22,8 @@ Basic usage: chkcrontab crontab_file """ +from __future__ import print_function + __author__ = 'lyda@google.com (Kevin Lyda)' import sys @@ -31,10 +33,10 @@ import chkcrontab_lib as check def main(argv): """main program.""" if len(argv) != 2: - print 'ERROR: No crontab file was specified.' + print('ERROR: No crontab file was specified.') sys.exit(1) log = check.LogCounter() - print 'Checking correctness of %s' % argv[1] + print('Checking correctness of %s' % argv[1]) return check.check_crontab(argv[1], log) if __name__ == '__main__': diff --git a/chkcrontab_lib.py b/chkcrontab_lib.py index ac1e8a4..f8943e8 100755 --- a/chkcrontab_lib.py +++ b/chkcrontab_lib.py @@ -65,6 +65,7 @@ A brief description of each class and function: CheckCrontab: Checks the a crontab file. """ +from __future__ import print_function # For Python 2.5 from __future__ import with_statement -- GitLab