Mercurial > p > roundup > code
comparison roundup/hyperdb.py @ 1928:7c1ddebe7589
Small readability improvements.
| author | Johannes Gijsbers <jlgijsbers@users.sourceforge.net> |
|---|---|
| date | Sun, 16 Nov 2003 20:01:16 +0000 |
| parents | f5e8aeb1382d |
| children | b7912efc7f57 |
comparison
equal
deleted
inserted
replaced
| 1927:f5e8aeb1382d | 1928:7c1ddebe7589 |
|---|---|
| 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.93 2003-11-16 19:59:10 jlgijsbers Exp $ | 18 # $Id: hyperdb.py,v 1.94 2003-11-16 20:01:16 jlgijsbers Exp $ |
| 19 | 19 |
| 20 """ | 20 """ |
| 21 Hyperdatabase implementation, especially field types. | 21 Hyperdatabase implementation, especially field types. |
| 22 """ | 22 """ |
| 23 | 23 |
| 228 multiple actions. | 228 multiple actions. |
| 229 ''' | 229 ''' |
| 230 raise NotImplementedError | 230 raise NotImplementedError |
| 231 | 231 |
| 232 def addnode(self, classname, nodeid, node): | 232 def addnode(self, classname, nodeid, node): |
| 233 '''Add the specified node to its class's db. | 233 """Add the specified node to its class's db. |
| 234 ''' | 234 """ |
| 235 raise NotImplementedError | 235 raise NotImplementedError |
| 236 | 236 |
| 237 def serialise(self, classname, node): | 237 def serialise(self, classname, node): |
| 238 '''Copy the node contents, converting non-marshallable data into | 238 '''Copy the node contents, converting non-marshallable data into |
| 239 marshallable data. | 239 marshallable data. |
| 596 raise HyperdbValueError, 'you may only enter ID values '\ | 596 raise HyperdbValueError, 'you may only enter ID values '\ |
| 597 'for property %s'%propname | 597 'for property %s'%propname |
| 598 return value | 598 return value |
| 599 | 599 |
| 600 def fixNewlines(text): | 600 def fixNewlines(text): |
| 601 ''' Homogenise line endings. | 601 """ Homogenise line endings. |
| 602 | 602 |
| 603 Different web clients send different line ending values, but | 603 Different web clients send different line ending values, but |
| 604 other systems (eg. email) don't necessarily handle those line | 604 other systems (eg. email) don't necessarily handle those line |
| 605 endings. Our solution is to convert all line endings to LF. | 605 endings. Our solution is to convert all line endings to LF. |
| 606 ''' | 606 """ |
| 607 text = text.replace('\r\n', '\n') | 607 text = text.replace('\r\n', '\n') |
| 608 return text.replace('\r', '\n') | 608 return text.replace('\r', '\n') |
| 609 | 609 |
| 610 def rawToHyperdb(db, klass, itemid, propname, value, | 610 def rawToHyperdb(db, klass, itemid, propname, value, |
| 611 pwre=re.compile(r'{(\w+)}(.+)')): | 611 pwre=re.compile(r'{(\w+)}(.+)')): |
