aboutsummaryrefslogtreecommitdiff
path: root/rpki/sundial.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2015-11-11 03:22:38 +0000
committerRob Austein <sra@hactrn.net>2015-11-11 03:22:38 +0000
commit9f6d6462a9cef37735a9d4c61921d04934fd9864 (patch)
treee5d1b046f6f6bd44faf1b5028f6f1df9698e2a88 /rpki/sundial.py
parentac415cdd0f88f8479975627772dd0a84797b261a (diff)
Configure pylint to use the pylint-django plugin, which (mostly)
understands Django's exotic metaclasses, which in turn allows us to re-enable a number of pylint checks we had disabled. While we were at this, stripped out a bunch of old pylint pragmas, then added back the subset that were really needed. As usual with pylint, this turned up a few real bugs along with an awful lot of noise. svn path=/branches/tk705/; revision=6162
Diffstat (limited to 'rpki/sundial.py')
-rw-r--r--rpki/sundial.py68
1 files changed, 50 insertions, 18 deletions
diff --git a/rpki/sundial.py b/rpki/sundial.py
index 0381599f..1556d0bd 100644
--- a/rpki/sundial.py
+++ b/rpki/sundial.py
@@ -155,10 +155,17 @@ class datetime(pydatetime.datetime):
return other if other < self else self
- def __add__(self, y): return _cast(pydatetime.datetime.__add__(self, y))
- def __radd__(self, y): return _cast(pydatetime.datetime.__radd__(self, y))
- def __rsub__(self, y): return _cast(pydatetime.datetime.__rsub__(self, y))
- def __sub__(self, y): return _cast(pydatetime.datetime.__sub__(self, y))
+ def __add__(self, y):
+ return _cast(pydatetime.datetime.__add__(self, y))
+
+ def __radd__(self, y):
+ return _cast(pydatetime.datetime.__radd__(self, y))
+
+ def __rsub__(self, y):
+ return _cast(pydatetime.datetime.__rsub__(self, y))
+
+ def __sub__(self, y):
+ return _cast(pydatetime.datetime.__sub__(self, y))
@classmethod
def DateTime_or_None(cls, s):
@@ -172,7 +179,7 @@ class datetime(pydatetime.datetime):
if t:
try:
return cls(*[int(x) for x in d.split("-") + t.split(":")])
- except: # pylint: disable=W0702
+ except:
break
from rpki.mysql_import import MySQLdb
@@ -260,19 +267,44 @@ class timedelta(pydatetime.timedelta):
return cls(days = x.days, seconds = x.seconds, microseconds = x.microseconds)
- def __abs__(self): return _cast(pydatetime.timedelta.__abs__(self))
- def __add__(self, x): return _cast(pydatetime.timedelta.__add__(self, x))
- def __div__(self, x): return _cast(pydatetime.timedelta.__div__(self, x))
- def __floordiv__(self, x): return _cast(pydatetime.timedelta.__floordiv__(self, x))
- def __mul__(self, x): return _cast(pydatetime.timedelta.__mul__(self, x))
- def __neg__(self): return _cast(pydatetime.timedelta.__neg__(self))
- def __pos__(self): return _cast(pydatetime.timedelta.__pos__(self))
- def __radd__(self, x): return _cast(pydatetime.timedelta.__radd__(self, x))
- def __rdiv__(self, x): return _cast(pydatetime.timedelta.__rdiv__(self, x))
- def __rfloordiv__(self, x): return _cast(pydatetime.timedelta.__rfloordiv__(self, x))
- def __rmul__(self, x): return _cast(pydatetime.timedelta.__rmul__(self, x))
- def __rsub__(self, x): return _cast(pydatetime.timedelta.__rsub__(self, x))
- def __sub__(self, x): return _cast(pydatetime.timedelta.__sub__(self, x))
+ def __abs__(self):
+ return _cast(pydatetime.timedelta.__abs__(self))
+
+ def __add__(self, x):
+ return _cast(pydatetime.timedelta.__add__(self, x))
+
+ def __div__(self, x):
+ return _cast(pydatetime.timedelta.__div__(self, x))
+
+ def __floordiv__(self, x):
+ return _cast(pydatetime.timedelta.__floordiv__(self, x))
+
+ def __mul__(self, x):
+ return _cast(pydatetime.timedelta.__mul__(self, x))
+
+ def __neg__(self):
+ return _cast(pydatetime.timedelta.__neg__(self))
+
+ def __pos__(self):
+ return _cast(pydatetime.timedelta.__pos__(self))
+
+ def __radd__(self, x):
+ return _cast(pydatetime.timedelta.__radd__(self, x))
+
+ def __rdiv__(self, x):
+ return _cast(pydatetime.timedelta.__rdiv__(self, x))
+
+ def __rfloordiv__(self, x):
+ return _cast(pydatetime.timedelta.__rfloordiv__(self, x))
+
+ def __rmul__(self, x):
+ return _cast(pydatetime.timedelta.__rmul__(self, x))
+
+ def __rsub__(self, x):
+ return _cast(pydatetime.timedelta.__rsub__(self, x))
+
+ def __sub__(self, x):
+ return _cast(pydatetime.timedelta.__sub__(self, x))
def _cast(x):
"""