Mercurial > p > roundup > code
comparison roundup/backends/back_anydbm.py @ 838:b31ac31ece69
explicit database closing
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Wed, 10 Jul 2002 00:21:45 +0000 |
| parents | 6d7a45c8464a |
| children | 4c39d8b48fbd |
comparison
equal
deleted
inserted
replaced
| 837:cafa20a4c2b1 | 838:b31ac31ece69 |
|---|---|
| 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" | 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" |
| 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, | 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
| 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 17 # | 17 # |
| 18 #$Id: back_anydbm.py,v 1.40 2002-07-09 04:19:09 richard Exp $ | 18 #$Id: back_anydbm.py,v 1.41 2002-07-10 00:21:45 richard Exp $ |
| 19 ''' | 19 ''' |
| 20 This module defines a backend that saves the hyperdatabase in a database | 20 This module defines a backend that saves the hyperdatabase in a database |
| 21 chosen by anydbm. It is guaranteed to always be available in python | 21 chosen by anydbm. It is guaranteed to always be available in python |
| 22 versions >2.1.1 (the dumbdbm fallback in 2.1.1 and earlier has several | 22 versions >2.1.1 (the dumbdbm fallback in 2.1.1 and earlier has several |
| 23 serious bugs, and is not available) | 23 serious bugs, and is not available) |
| 349 return [] | 349 return [] |
| 350 try: | 350 try: |
| 351 journal = marshal.loads(db[nodeid]) | 351 journal = marshal.loads(db[nodeid]) |
| 352 except KeyError: | 352 except KeyError: |
| 353 raise KeyError, 'no such %s %s'%(classname, nodeid) | 353 raise KeyError, 'no such %s %s'%(classname, nodeid) |
| 354 db.close() | |
| 354 res = [] | 355 res = [] |
| 355 for entry in journal: | 356 for entry in journal: |
| 356 (nodeid, date_stamp, user, action, params) = entry | 357 (nodeid, date_stamp, user, action, params) = entry |
| 357 date_obj = date.Date(date_stamp) | 358 date_obj = date.Date(date_stamp) |
| 358 res.append((nodeid, date_obj, user, action, params)) | 359 res.append((nodeid, date_obj, user, action, params)) |
| 507 self.newnodes = {} | 508 self.newnodes = {} |
| 508 self.transactions = [] | 509 self.transactions = [] |
| 509 | 510 |
| 510 # | 511 # |
| 511 #$Log: not supported by cvs2svn $ | 512 #$Log: not supported by cvs2svn $ |
| 513 #Revision 1.40 2002/07/09 04:19:09 richard | |
| 514 #Added reindex command to roundup-admin. | |
| 515 #Fixed reindex on first access. | |
| 516 #Also fixed reindexing of entries that change. | |
| 517 # | |
| 512 #Revision 1.39 2002/07/09 03:02:52 richard | 518 #Revision 1.39 2002/07/09 03:02:52 richard |
| 513 #More indexer work: | 519 #More indexer work: |
| 514 #- all String properties may now be indexed too. Currently there's a bit of | 520 #- all String properties may now be indexed too. Currently there's a bit of |
| 515 # "issue" specific code in the actual searching which needs to be | 521 # "issue" specific code in the actual searching which needs to be |
| 516 # addressed. In a nutshell: | 522 # addressed. In a nutshell: |
