From f6a5f063b369a66e7f231c77b148adc118267814 Mon Sep 17 00:00:00 2001
From: Kevin Lyda <kevin@ie.suberic.net>
Date: Sat, 16 Jun 2012 22:36:58 +0100
Subject: [PATCH] Hush some pylint errors.
---
chkcrontab_lib.py | 16 +++++++++++-----
tests/test_check.py | 4 ++--
2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/chkcrontab_lib.py b/chkcrontab_lib.py
index dded62d..ac1e8a4 100755
--- a/chkcrontab_lib.py
+++ b/chkcrontab_lib.py
@@ -342,22 +342,22 @@ class CronTimeField(object):
return self._text
@property
- def kind(self):
+ def Kind(self):
"""Kind field."""
return self._kind
@property
- def start(self):
+ def Start(self):
"""Start value of this field."""
return self._start
@property
- def end(self):
+ def End(self):
"""End value of this field."""
return self._end
@property
- def step(self):
+ def Step(self):
"""Step for this field."""
return self._step
@@ -488,7 +488,7 @@ def ChkCTStarOnly(cron_time_field):
"""
if not cron_time_field:
return True
- if len(cron_time_field) == 1 and cron_time_field[0].kind == 'star':
+ if len(cron_time_field) == 1 and cron_time_field[0].Kind == 'star':
return True
return False
@@ -693,6 +693,7 @@ class CronLineTimeAction(object):
self.command = command
def _CheckTimeField(self, log):
+ """Virtual method to be implemented by subclasses to check time field."""
pass
def ValidateAndLog(self, log):
@@ -782,6 +783,11 @@ class CronLineUnknown(object):
"""For unrecognised cron lines."""
def ValidateAndLog(self, log):
+ """Emits an error for unrecognised cron lines.
+
+ Args:
+ log: A LogCounter instance to record issues.
+ """
log.LineError(log.MSG_LINE_ERROR, 'Failed to parse line.')
diff --git a/tests/test_check.py b/tests/test_check.py
index 3bf95e5..87ac551 100755
--- a/tests/test_check.py
+++ b/tests/test_check.py
@@ -71,10 +71,10 @@ class FSMUnitTest(unittest.TestCase):
len(parsed_fields['cron_times'])))
for i in range(min(len(parsed_fields['cron_times']),
len(check_parsed_fields['cron_times']))):
- self.assertEquals(parsed_fields['cron_times'][i].kind,
+ self.assertEquals(parsed_fields['cron_times'][i].Kind,
check_parsed_fields['cron_times'][i][0],
'Parser detected "%s" field not "%s"'
- % (parsed_fields['cron_times'][i].kind,
+ % (parsed_fields['cron_times'][i].Kind,
check_parsed_fields['cron_times'][i][0]))
self.assertEquals('%s' % parsed_fields['cron_times'][i],
check_parsed_fields['cron_times'][i][1],
--
GitLab