Mercurial > p > roundup > code
comparison roundup/hyperdb.py @ 690:509a101305da
node ids are now generated from a lockable store - no more race conditions
We're using the portalocker code by Jonathan Feinberg that was contributed
to the ASPN Python cookbook. This gives us locking across Unix and Windows.
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Mon, 15 Apr 2002 23:25:15 +0000 |
| parents | 5a4dd342d827 |
| children | fed4c363a7f3 |
comparison
equal
deleted
inserted
replaced
| 689:456a1ed04650 | 690:509a101305da |
|---|---|
| 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: hyperdb.py,v 1.62 2002-04-03 07:05:50 richard Exp $ | 18 # $Id: hyperdb.py,v 1.63 2002-04-15 23:25:15 richard Exp $ |
| 19 | 19 |
| 20 __doc__ = """ | 20 __doc__ = """ |
| 21 Hyperdatabase implementation, especially field types. | 21 Hyperdatabase implementation, especially field types. |
| 22 """ | 22 """ |
| 23 | 23 |
| 351 | 351 |
| 352 if self.db.journaltag is None: | 352 if self.db.journaltag is None: |
| 353 raise DatabaseError, 'Database open read-only' | 353 raise DatabaseError, 'Database open read-only' |
| 354 | 354 |
| 355 # new node's id | 355 # new node's id |
| 356 newid = str(self.count() + 1) | 356 newid = self.db.newid(self.classname) |
| 357 | 357 |
| 358 # validate propvalues | 358 # validate propvalues |
| 359 num_re = re.compile('^\d+$') | 359 num_re = re.compile('^\d+$') |
| 360 for key, value in propvalues.items(): | 360 for key, value in propvalues.items(): |
| 361 if key == self.key: | 361 if key == self.key: |
| 1125 cl.create(name=options[i], order=i) | 1125 cl.create(name=options[i], order=i) |
| 1126 return hyperdb.Link(name) | 1126 return hyperdb.Link(name) |
| 1127 | 1127 |
| 1128 # | 1128 # |
| 1129 # $Log: not supported by cvs2svn $ | 1129 # $Log: not supported by cvs2svn $ |
| 1130 # Revision 1.62 2002/04/03 07:05:50 richard | |
| 1131 # d'oh! killed retirement of nodes :( | |
| 1132 # all better now... | |
| 1133 # | |
| 1130 # Revision 1.61 2002/04/03 06:11:51 richard | 1134 # Revision 1.61 2002/04/03 06:11:51 richard |
| 1131 # Fix for old databases that contain properties that don't exist any more. | 1135 # Fix for old databases that contain properties that don't exist any more. |
| 1132 # | 1136 # |
| 1133 # Revision 1.60 2002/04/03 05:54:31 richard | 1137 # Revision 1.60 2002/04/03 05:54:31 richard |
| 1134 # Fixed serialisation problem by moving the serialisation step out of the | 1138 # Fixed serialisation problem by moving the serialisation step out of the |
