From 688d17a902aaf0b771057a6a870a86d182f6159b Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 16 Dec 2013 14:15:33 +1100 Subject: [PATCH] sms: discard whitespace at eol in code --- sms/storesms.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/sms/storesms.py b/sms/storesms.py index f0d5f2e..f04a47f 100644 --- a/sms/storesms.py +++ b/sms/storesms.py @@ -49,7 +49,7 @@ # Finally it might have a 'ref' and a 'part' which is a tuple (this,max) # This is only used when storing the message to link it up with # a partner -# +# # SMSstore # This represents a collection of messages in a directory (one file per month) # and provides lists of 'NEW' and 'DRAFT' messages. @@ -66,7 +66,7 @@ # setstate(SMSmesg, NEW|DRAFT|None) # update the 'new' and 'draft' lists or container, or not container, this # message. -# +# # import os, fcntl, re, time, urllib @@ -98,7 +98,6 @@ def format_time(t): def format_ltime(tm): return time.strftime("%Y%m%d-%H%M%S", tm[0:6]+(0,0,0)) + ("%+03d" % tm[6]) - class SMSmesg: def __init__(self, **a): if len(a) == 1 and 'line' in a: @@ -199,7 +198,6 @@ class SMSmesg: return a+b self.text = reduce(reduce_pair, self.parts) - def set_corresponent(self): if len(self.correspondents) == 1: self.correspondent = self.correspondents[0] @@ -228,7 +226,6 @@ class SMSmesg: return r[1:] else: return '-' - class SMSstore: def __init__(self, dir): @@ -308,7 +305,7 @@ class SMSstore: sms.parts[i] = orig.parts[i] else: orig = None - + m = time.strftime("%Y%m", time.gmtime(sms.stamp)) try: f = open(self.dirname + '/' + m, "r+") @@ -322,7 +319,7 @@ class SMSstore: if complete: sms.reduce_parts() sms.parts = None - + fcntl.lockf(f, fcntl.LOCK_EX) l = self.load_month(f) while sms.stamp in l: @@ -370,7 +367,7 @@ class SMSstore: self.files.append(f) self.files.sort() self.files.reverse() - + def lookup(self, lasttime = None, state = None): if lasttime == None: lasttime = int(time.time()) @@ -482,5 +479,3 @@ class SMSstore: self.newmesg.append(tm) self.newmesg.sort() self.newmesg.reverse() - - -- 2.39.5