Cleaned up timestamps

No more stripping the decimal off, casting as a float to remain consistent with time
This commit is contained in:
Joshua Sherman 2013-10-24 17:17:13 +00:00
parent 238d8e5bd4
commit 4ae8542f31

4
tmpufw
View file

@ -56,7 +56,7 @@ class tmpufw(object):
# Breaks apart line into expiration timestamp and rule
timestamp, rule = line.strip("\n").split(' ', 1)
print(str(datetime.fromtimestamp(timestamp)) + "\t" + rule)
print(str(datetime.fromtimestamp(float(timestamp))) + "\t" + rule)
except IOError:
self.error('unable to read from the rules file: ' + rules_file)
else:
@ -114,7 +114,7 @@ class tmpufw(object):
# Converts the TTL to a timestamp
cal = Calendar()
timestamp = int(mktime(cal.parse(args.ttl)[0]))
timestamp = mktime(cal.parse(args.ttl)[0])
# Writes the rule to the rules file
try: