Skip to content

Commit b3c29b3

Browse files
committed
flake whitespace changes.
1 parent adc1b85 commit b3c29b3

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

roundup/cgi/timestamp.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,25 @@
77
from roundup.i18n import _
88
from roundup.anypy.strings import b2s, s2b
99

10+
1011
def pack_timestamp():
1112
return b2s(base64.b64encode(struct.pack("i", int(time.time()))).strip())
1213

14+
1315
def unpack_timestamp(s):
1416
try:
15-
timestamp = struct.unpack("i",base64.b64decode(s2b(s)))[0]
16-
except (struct.error, binascii.Error, TypeError) as e:
17+
timestamp = struct.unpack("i", base64.b64decode(s2b(s)))[0]
18+
except (struct.error, binascii.Error, TypeError):
1719
raise FormError(_("Form is corrupted."))
1820
return timestamp
1921

22+
2023
class Timestamped:
21-
def timecheck(self,field,delay):
24+
def timecheck(self, field, delay):
2225
try:
2326
created = unpack_timestamp(self.form[field].value)
2427
except KeyError:
25-
raise FormError(_("Form is corrupted, missing: %s."%field))
28+
raise FormError(_("Form is corrupted, missing: %s." % field))
2629
if time.time() - created < delay:
2730
raise FormError(_("Responding to form too quickly."))
2831
return True

0 commit comments

Comments
 (0)