From 58f73d441439f25faeea1a15102942bc9a8a525a Mon Sep 17 00:00:00 2001 From: partmedia Date: Sat, 3 Aug 2013 00:28:21 +0000 Subject: [PATCH] Update explanatory comment in CFBank.py. git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@18872 282e977c-c81d-0410-88c4-b93c2d0d6712 --- python/CFBank.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/python/CFBank.py b/python/CFBank.py index 9d074be30..f29b09923 100644 --- a/python/CFBank.py +++ b/python/CFBank.py @@ -1,16 +1,14 @@ # CFBank.py -- CFBank class # Created by: Joris Bontje -# CFBank uses the 'shelve' Python library to store persistent data. The shelve -# is opened for R/W operations by default, but cannot be read from and written -# to simultaneously (so no 'append' or '+=' operations). +# CFBank uses the 'shelve' Python library to store persistent data. The +# shelved dictionary cannot be read and written to concurrently (so no '+=' or +# 'append' operations). # -# In a past implementation, the bank database was opened with 'writeback' set -# to 'True' and called sync() after each write operation, but still suffered -# from strange bank problems. -# -# In its current implementation, close() MUST be called to preserve data -# across runs. This fixed the aforementioned bug for me. +# The original implementation opened the database with 'writeback' set and +# called 'sync()' after each write operation. The current implementation does +# not set 'writeback' and instead requires 'close()' to be called before data +# is saved. This is the method recommended by the Python reference manual. import os.path import shelve