Clean up additional issues discovered with pylint and pychecker

This commit is contained in:
Rob Crittenden
2009-08-20 09:20:56 -04:00
parent 8780751330
commit d9c54cd83e
8 changed files with 30 additions and 22 deletions
+3 -1
View File
@@ -17,7 +17,9 @@
import socket
import errno
from httplib import UnimplementedFileMode
from httplib import UnimplementedFileMode, HTTPException
error = HTTPException
class SharedSocket:
def __init__(self, sock):
-10
View File
@@ -600,16 +600,6 @@ def user_input_plain(prompt, default = None, allow_empty = True, allow_spaces =
if ipavalidate.Plain(ret, not allow_empty, allow_spaces):
return ret
def user_input_path(prompt, default = None, allow_empty = True):
if default != None and allow_empty:
prompt += " (enter \"none\" for empty)"
while True:
ret = user_input(prompt, default, allow_empty)
if allow_empty and ret.lower() == "none":
return ""
if ipavalidate.Path(ret, not allow_empty):
return ret
class AttributeValueCompleter:
'''
Gets input from the user in the form "lhs operator rhs"
+4 -4
View File
@@ -275,7 +275,7 @@ class TestTimeParser(unittest.TestCase):
time = ipautil.parse_generalized_time(timestr)
self.assertEqual(0, time.tzinfo.houroffset)
self.assertEqual(0, time.tzinfo.minoffset)
offset = time.tzinfo.utcoffset(None)
offset = time.tzinfo.utcoffset()
self.assertEqual(0, offset.seconds)
timestr = "20051213141205+0500"
@@ -283,7 +283,7 @@ class TestTimeParser(unittest.TestCase):
time = ipautil.parse_generalized_time(timestr)
self.assertEqual(5, time.tzinfo.houroffset)
self.assertEqual(0, time.tzinfo.minoffset)
offset = time.tzinfo.utcoffset(None)
offset = time.tzinfo.utcoffset()
self.assertEqual(5 * 60 * 60, offset.seconds)
timestr = "20051213141205-0500"
@@ -293,7 +293,7 @@ class TestTimeParser(unittest.TestCase):
self.assertEqual(0, time.tzinfo.minoffset)
# NOTE - the offset is always positive - it's minutes
# _east_ of UTC
offset = time.tzinfo.utcoffset(None)
offset = time.tzinfo.utcoffset()
self.assertEqual((24 - 5) * 60 * 60, offset.seconds)
timestr = "20051213141205-0930"
@@ -301,7 +301,7 @@ class TestTimeParser(unittest.TestCase):
time = ipautil.parse_generalized_time(timestr)
self.assertEqual(-9, time.tzinfo.houroffset)
self.assertEqual(-30, time.tzinfo.minoffset)
offset = time.tzinfo.utcoffset(None)
offset = time.tzinfo.utcoffset()
self.assertEqual(((24 - 9) * 60 * 60) - (30 * 60), offset.seconds)