From 4ae8542f3100679d94b415e65818c1e3216a830e Mon Sep 17 00:00:00 2001 From: Joshua Sherman Date: Thu, 24 Oct 2013 17:17:13 +0000 Subject: [PATCH] Cleaned up timestamps No more stripping the decimal off, casting as a float to remain consistent with time --- tmpufw | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tmpufw b/tmpufw index 616cfee..4384788 100755 --- a/tmpufw +++ b/tmpufw @@ -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: