Mercurial > p > roundup > code
comparison roundup/backends/back_anydbm.py @ 778:fb2ce2b8b2ef
Moved the file storage commit into blobfiles where it belongs.
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Wed, 19 Jun 2002 03:07:19 +0000 |
| parents | 51c425129b35 |
| children | b6b0a92e0738 |
comparison
equal
deleted
inserted
replaced
| 777:bcd284bba81f | 778:fb2ce2b8b2ef |
|---|---|
| 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.35 2002-05-25 07:16:24 rochecompaan Exp $ | 18 #$Id: back_anydbm.py,v 1.36 2002-06-19 03:07:19 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) |
| 464 else: | 464 else: |
| 465 l = [entry] | 465 l = [entry] |
| 466 | 466 |
| 467 db[nodeid] = marshal.dumps(l) | 467 db[nodeid] = marshal.dumps(l) |
| 468 | 468 |
| 469 def _doStoreFile(self, name, **databases): | |
| 470 # the file is currently ".tmp" - move it to its real name to commit | |
| 471 os.rename(name+".tmp", name) | |
| 472 pattern = name.split('/')[-1] | |
| 473 self.indexer.add_files(dir=os.path.dirname(name), pattern=pattern) | |
| 474 self.indexer.save_index() | |
| 475 | |
| 476 def rollback(self): | 469 def rollback(self): |
| 477 ''' Reverse all actions from the current transaction. | 470 ''' Reverse all actions from the current transaction. |
| 478 ''' | 471 ''' |
| 479 if __debug__: | 472 if __debug__: |
| 480 print >>hyperdb.DEBUG, 'rollback', (self, ) | 473 print >>hyperdb.DEBUG, 'rollback', (self, ) |
| 488 self.newnodes = {} | 481 self.newnodes = {} |
| 489 self.transactions = [] | 482 self.transactions = [] |
| 490 | 483 |
| 491 # | 484 # |
| 492 #$Log: not supported by cvs2svn $ | 485 #$Log: not supported by cvs2svn $ |
| 486 #Revision 1.35 2002/05/25 07:16:24 rochecompaan | |
| 487 #Merged search_indexing-branch with HEAD | |
| 488 # | |
| 493 #Revision 1.34 2002/05/15 06:21:21 richard | 489 #Revision 1.34 2002/05/15 06:21:21 richard |
| 494 # . node caching now works, and gives a small boost in performance | 490 # . node caching now works, and gives a small boost in performance |
| 495 # | 491 # |
| 496 #As a part of this, I cleaned up the DEBUG output and implemented TRACE | 492 #As a part of this, I cleaned up the DEBUG output and implemented TRACE |
| 497 #output (HYPERDBTRACE='file to trace to') with checkpoints at the start of | 493 #output (HYPERDBTRACE='file to trace to') with checkpoints at the start of |
