[Nym3-commit] r506 - trunk/tools/server
jr at conuropsis.org
jr at conuropsis.org
Mon Mar 27 22:38:01 CEST 2006
Author: jr
Date: 2006-03-27 22:38:00 +0200 (Mon, 27 Mar 2006)
New Revision: 506
Modified:
trunk/tools/server/Account_handler.py
Log:
- fix for the case of an empty synbox
Modified: trunk/tools/server/Account_handler.py
===================================================================
--- trunk/tools/server/Account_handler.py 2006-03-25 18:07:36 UTC (rev 505)
+++ trunk/tools/server/Account_handler.py 2006-03-27 20:38:00 UTC (rev 506)
@@ -79,13 +79,14 @@
now = int(time.time())
target_time = now - options.age
#the time of the last inserted message of the synbox
- timeyoungest = nymUser.index[nymUser.syn[-1][0][-1]]['time']
- if target_time < timeyoungest:
- print "The message that would be inserted would be older " + \
- "than the most recent message received by the " + \
- "account. Retry with age parameter < %d. Aborting." % \
- (now - timeyoungest)
- sys.exit(2)
+ if nymUser.syn:
+ timeyoungest = nymUser.index[nymUser.syn[-1][0][-1]]['time']
+ if target_time < timeyoungest:
+ print "The message that would be inserted would be " + \
+ "older than the most recent message received by " + \
+ "the account. Retry with age parameter < %d. " +\
+ "Aborting." % (now - timeyoungest)
+ sys.exit(2)
nymUser.store(msg)
midIns = nymUser.syn[-1][0][0]
nymUser.index[midIns]['time'] = target_time
More information about the Nym3-commit
mailing list