Skip to content
Snippets Groups Projects
Commit 1a9cfc33 authored by Kevin Lyda's avatar Kevin Lyda :speech_balloon:
Browse files

Fix print calls for python 3.2

parent 69d853fe
No related branches found
No related tags found
No related merge requests found
...@@ -891,7 +891,7 @@ class LogCounter(object): ...@@ -891,7 +891,7 @@ class LogCounter(object):
Args: Args:
message: The message to print as a warning. message: The message to print as a warning.
""" """
print 'W:', message print('W:', message)
self._warn_count += 1 self._warn_count += 1
def LineWarn(self, msg_kind, line_warn): def LineWarn(self, msg_kind, line_warn):
...@@ -915,7 +915,7 @@ class LogCounter(object): ...@@ -915,7 +915,7 @@ class LogCounter(object):
Args: Args:
message: The message to print as a error. message: The message to print as a error.
""" """
print 'E:', message print('E:', message)
self._error_count += 1 self._error_count += 1
def LineError(self, msg_kind, line_error): def LineError(self, msg_kind, line_error):
...@@ -946,13 +946,13 @@ class LogCounter(object): ...@@ -946,13 +946,13 @@ class LogCounter(object):
line_error_fmt = 'e: %s %%s' % spacer line_error_fmt = 'e: %s %%s' % spacer
line_warn_fmt = 'w: %s %%s' % spacer line_warn_fmt = 'w: %s %%s' % spacer
if self._line_errors: if self._line_errors:
print 'E: %d: %s' % (line_no, line) print('E: %d: %s' % (line_no, line))
else: else:
print 'W: %d: %s' % (line_no, line) print('W: %d: %s' % (line_no, line))
for line_error in self._line_errors: for line_error in self._line_errors:
print line_error_fmt % line_error print(line_error_fmt % line_error)
for line_warn in self._line_warns: for line_warn in self._line_warns:
print line_warn_fmt % line_warn print(line_warn_fmt % line_warn)
self._line_errors = [] self._line_errors = []
self._line_warns = [] self._line_warns = []
...@@ -970,11 +970,11 @@ class LogCounter(object): ...@@ -970,11 +970,11 @@ class LogCounter(object):
if self._error_count > 0: if self._error_count > 0:
print('E: There were %d errors and %d warnings.' print('E: There were %d errors and %d warnings.'
% (self._error_count, self._warn_count)) % (self._error_count, self._warn_count))
print more_info print(more_info)
return 2 return 2
elif self._warn_count > 0: elif self._warn_count > 0:
print 'W: There were %d warnings.' % self._warn_count print('W: There were %d warnings.' % self._warn_count)
print more_info print(more_info)
return 1 return 1
else: else:
return 0 return 0
...@@ -1040,7 +1040,7 @@ def main(): ...@@ -1040,7 +1040,7 @@ def main():
log = LogCounter() log = LogCounter()
if len(sys.argv) != 2: if len(sys.argv) != 2:
log.Error('Must provide a crontab file to check.') log.Error('Must provide a crontab file to check.')
print 'Checking correctness of %s' % sys.argv[1] print('Checking correctness of %s' % sys.argv[1])
return CheckCrontab(sys.argv[1], log) return CheckCrontab(sys.argv[1], log)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment