Code

3f6429f82b510adb18f6af68bc30ecf5d17dc11d
[roundup.git] / roundup / hyperdb.py
1 #
2 # Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/)
3 # This module is free software, and you may redistribute it and/or modify
4 # under the same terms as Python, so long as this copyright message and
5 # disclaimer are retained in their original form.
6 #
7 # IN NO EVENT SHALL BIZAR SOFTWARE PTY LTD BE LIABLE TO ANY PARTY FOR
8 # DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
9 # OUT OF THE USE OF THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE
10 # POSSIBILITY OF SUCH DAMAGE.
11 #
12 # BIZAR SOFTWARE PTY LTD SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
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"
15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
17
18 # $Id: hyperdb.py,v 1.75 2002-07-14 02:05:53 richard Exp $
20 __doc__ = """
21 Hyperdatabase implementation, especially field types.
22 """
24 # standard python modules
25 import sys, os, time, re
27 # roundup modules
28 import date, password
30 # configure up the DEBUG and TRACE captures
31 class Sink:
32     def write(self, content):
33         pass
34 DEBUG = os.environ.get('HYPERDBDEBUG', '')
35 if DEBUG and __debug__:
36     if DEBUG == 'stdout':
37         DEBUG = sys.stdout
38     else:
39         DEBUG = open(DEBUG, 'a')
40 else:
41     DEBUG = Sink()
42 TRACE = os.environ.get('HYPERDBTRACE', '')
43 if TRACE and __debug__:
44     if TRACE == 'stdout':
45         TRACE = sys.stdout
46     else:
47         TRACE = open(TRACE, 'w')
48 else:
49     TRACE = Sink()
50 def traceMark():
51     print >>TRACE, '**MARK', time.ctime()
52 del Sink
54 #
55 # Types
56 #
57 class String:
58     """An object designating a String property."""
59     def __init__(self, indexme='no'):
60         self.indexme = indexme == 'yes'
61     def __repr__(self):
62         ' more useful for dumps '
63         return '<%s>'%self.__class__
65 class Password:
66     """An object designating a Password property."""
67     def __repr__(self):
68         ' more useful for dumps '
69         return '<%s>'%self.__class__
71 class Date:
72     """An object designating a Date property."""
73     def __repr__(self):
74         ' more useful for dumps '
75         return '<%s>'%self.__class__
77 class Interval:
78     """An object designating an Interval property."""
79     def __repr__(self):
80         ' more useful for dumps '
81         return '<%s>'%self.__class__
83 class Link:
84     """An object designating a Link property that links to a
85        node in a specified class."""
86     def __init__(self, classname, do_journal='no'):
87         ''' Default is to not journal link and unlink events
88         '''
89         self.classname = classname
90         self.do_journal = do_journal == 'yes'
91     def __repr__(self):
92         ' more useful for dumps '
93         return '<%s to "%s">'%(self.__class__, self.classname)
95 class Multilink:
96     """An object designating a Multilink property that links
97        to nodes in a specified class.
99        "classname" indicates the class to link to
101        "do_journal" indicates whether the linked-to nodes should have
102                     'link' and 'unlink' events placed in their journal
103     """
104     def __init__(self, classname, do_journal='no'):
105         ''' Default is to not journal link and unlink events
106         '''
107         self.classname = classname
108         self.do_journal = do_journal == 'yes'
109     def __repr__(self):
110         ' more useful for dumps '
111         return '<%s to "%s">'%(self.__class__, self.classname)
114 # Support for splitting designators
116 class DesignatorError(ValueError):
117     pass
118 def splitDesignator(designator, dre=re.compile(r'([^\d]+)(\d+)')):
119     ''' Take a foo123 and return ('foo', 123)
120     '''
121     m = dre.match(designator)
122     if m is None:
123         raise DesignatorError, '"%s" not a node designator'%designator
124     return m.group(1), m.group(2)
127 # the base Database class
129 class DatabaseError(ValueError):
130     '''Error to be raised when there is some problem in the database code
131     '''
132     pass
133 class Database:
134     '''A database for storing records containing flexible data types.
136 This class defines a hyperdatabase storage layer, which the Classes use to
137 store their data.
140 Transactions
141 ------------
142 The Database should support transactions through the commit() and
143 rollback() methods. All other Database methods should be transaction-aware,
144 using data from the current transaction before looking up the database.
146 An implementation must provide an override for the get() method so that the
147 in-database value is returned in preference to the in-transaction value.
148 This is necessary to determine if any values have changed during a
149 transaction.
152 Implementation
153 --------------
155 All methods except __repr__ and getnode must be implemented by a
156 concrete backend Class.
158 '''
160     # flag to set on retired entries
161     RETIRED_FLAG = '__hyperdb_retired'
163     # XXX deviates from spec: storagelocator is obtained from the config
164     def __init__(self, config, journaltag=None):
165         """Open a hyperdatabase given a specifier to some storage.
167         The 'storagelocator' is obtained from config.DATABASE.
168         The meaning of 'storagelocator' depends on the particular
169         implementation of the hyperdatabase.  It could be a file name,
170         a directory path, a socket descriptor for a connection to a
171         database over the network, etc.
173         The 'journaltag' is a token that will be attached to the journal
174         entries for any edits done on the database.  If 'journaltag' is
175         None, the database is opened in read-only mode: the Class.create(),
176         Class.set(), and Class.retire() methods are disabled.
177         """
178         raise NotImplementedError
180     def post_init(self):
181         """Called once the schema initialisation has finished."""
182         raise NotImplementedError
184     def __getattr__(self, classname):
185         """A convenient way of calling self.getclass(classname)."""
186         raise NotImplementedError
188     def addclass(self, cl):
189         '''Add a Class to the hyperdatabase.
190         '''
191         raise NotImplementedError
193     def getclasses(self):
194         """Return a list of the names of all existing classes."""
195         raise NotImplementedError
197     def getclass(self, classname):
198         """Get the Class object representing a particular class.
200         If 'classname' is not a valid class name, a KeyError is raised.
201         """
202         raise NotImplementedError
204     def clear(self):
205         '''Delete all database contents.
206         '''
207         raise NotImplementedError
209     def getclassdb(self, classname, mode='r'):
210         '''Obtain a connection to the class db that will be used for
211            multiple actions.
212         '''
213         raise NotImplementedError
215     def addnode(self, classname, nodeid, node):
216         '''Add the specified node to its class's db.
217         '''
218         raise NotImplementedError
220     def serialise(self, classname, node):
221         '''Copy the node contents, converting non-marshallable data into
222            marshallable data.
223         '''
224         return node
226     def setnode(self, classname, nodeid, node):
227         '''Change the specified node.
228         '''
229         raise NotImplementedError
231     def unserialise(self, classname, node):
232         '''Decode the marshalled node data
233         '''
234         return node
236     def getnode(self, classname, nodeid, db=None, cache=1):
237         '''Get a node from the database.
238         '''
239         raise NotImplementedError
241     def hasnode(self, classname, nodeid, db=None):
242         '''Determine if the database has a given node.
243         '''
244         raise NotImplementedError
246     def countnodes(self, classname, db=None):
247         '''Count the number of nodes that exist for a particular Class.
248         '''
249         raise NotImplementedError
251     def getnodeids(self, classname, db=None):
252         '''Retrieve all the ids of the nodes for a particular Class.
253         '''
254         raise NotImplementedError
256     def storefile(self, classname, nodeid, property, content):
257         '''Store the content of the file in the database.
258         
259            The property may be None, in which case the filename does not
260            indicate which property is being saved.
261         '''
262         raise NotImplementedError
264     def getfile(self, classname, nodeid, property):
265         '''Store the content of the file in the database.
266         '''
267         raise NotImplementedError
269     def addjournal(self, classname, nodeid, action, params):
270         ''' Journal the Action
271         'action' may be:
273             'create' or 'set' -- 'params' is a dictionary of property values
274             'link' or 'unlink' -- 'params' is (classname, nodeid, propname)
275             'retire' -- 'params' is None
276         '''
277         raise NotImplementedError
279     def getjournal(self, classname, nodeid):
280         ''' get the journal for id
281         '''
282         raise NotImplementedError
284     def pack(self, pack_before):
285         ''' pack the database
286         '''
287         raise NotImplementedError
289     def commit(self):
290         ''' Commit the current transactions.
292         Save all data changed since the database was opened or since the
293         last commit() or rollback().
294         '''
295         raise NotImplementedError
297     def rollback(self):
298         ''' Reverse all actions from the current transaction.
300         Undo all the changes made since the database was opened or the last
301         commit() or rollback() was performed.
302         '''
303         raise NotImplementedError
306 # The base Class class
308 class Class:
309     """ The handle to a particular class of nodes in a hyperdatabase.
310         
311         All methods except __repr__ and getnode must be implemented by a
312         concrete backend Class.
313     """
315     def __init__(self, db, classname, **properties):
316         """Create a new class with a given name and property specification.
318         'classname' must not collide with the name of an existing class,
319         or a ValueError is raised.  The keyword arguments in 'properties'
320         must map names to property objects, or a TypeError is raised.
321         """
322         raise NotImplementedError
324     def __repr__(self):
325         '''Slightly more useful representation
326         '''
327         return '<hypderdb.Class "%s">'%self.classname
329     # Editing nodes:
331     def create(self, **propvalues):
332         """Create a new node of this class and return its id.
334         The keyword arguments in 'propvalues' map property names to values.
336         The values of arguments must be acceptable for the types of their
337         corresponding properties or a TypeError is raised.
338         
339         If this class has a key property, it must be present and its value
340         must not collide with other key strings or a ValueError is raised.
341         
342         Any other properties on this class that are missing from the
343         'propvalues' dictionary are set to None.
344         
345         If an id in a link or multilink property does not refer to a valid
346         node, an IndexError is raised.
347         """
348         raise NotImplementedError
350     _marker = []
351     def get(self, nodeid, propname, default=_marker, cache=1):
352         """Get the value of a property on an existing node of this class.
354         'nodeid' must be the id of an existing node of this class or an
355         IndexError is raised.  'propname' must be the name of a property
356         of this class or a KeyError is raised.
358         'cache' indicates whether the transaction cache should be queried
359         for the node. If the node has been modified and you need to
360         determine what its values prior to modification are, you need to
361         set cache=0.
362         """
363         raise NotImplementedError
365     # XXX not in spec
366     def getnode(self, nodeid, cache=1):
367         ''' Return a convenience wrapper for the node.
369         'nodeid' must be the id of an existing node of this class or an
370         IndexError is raised.
372         'cache' indicates whether the transaction cache should be queried
373         for the node. If the node has been modified and you need to
374         determine what its values prior to modification are, you need to
375         set cache=0.
376         '''
377         return Node(self, nodeid, cache=cache)
379     def set(self, nodeid, **propvalues):
380         """Modify a property on an existing node of this class.
381         
382         'nodeid' must be the id of an existing node of this class or an
383         IndexError is raised.
385         Each key in 'propvalues' must be the name of a property of this
386         class or a KeyError is raised.
388         All values in 'propvalues' must be acceptable types for their
389         corresponding properties or a TypeError is raised.
391         If the value of the key property is set, it must not collide with
392         other key strings or a ValueError is raised.
394         If the value of a Link or Multilink property contains an invalid
395         node id, a ValueError is raised.
396         """
397         raise NotImplementedError
399     def retire(self, nodeid):
400         """Retire a node.
401         
402         The properties on the node remain available from the get() method,
403         and the node's id is never reused.
404         
405         Retired nodes are not returned by the find(), list(), or lookup()
406         methods, and other nodes may reuse the values of their key properties.
407         """
408         raise NotImplementedError
410     def history(self, nodeid):
411         """Retrieve the journal of edits on a particular node.
413         'nodeid' must be the id of an existing node of this class or an
414         IndexError is raised.
416         The returned list contains tuples of the form
418             (date, tag, action, params)
420         'date' is a Timestamp object specifying the time of the change and
421         'tag' is the journaltag specified when the database was opened.
422         """
423         raise NotImplementedError
425     # Locating nodes:
426     def hasnode(self, nodeid):
427         '''Determine if the given nodeid actually exists
428         '''
429         raise NotImplementedError
431     def setkey(self, propname):
432         """Select a String property of this class to be the key property.
434         'propname' must be the name of a String property of this class or
435         None, or a TypeError is raised.  The values of the key property on
436         all existing nodes must be unique or a ValueError is raised.
437         """
438         raise NotImplementedError
440     def getkey(self):
441         """Return the name of the key property for this class or None."""
442         raise NotImplementedError
444     def labelprop(self, default_to_id=0):
445         ''' Return the property name for a label for the given node.
447         This method attempts to generate a consistent label for the node.
448         It tries the following in order:
449             1. key property
450             2. "name" property
451             3. "title" property
452             4. first property from the sorted property name list
453         '''
454         raise NotImplementedError
456     def lookup(self, keyvalue):
457         """Locate a particular node by its key property and return its id.
459         If this class has no key property, a TypeError is raised.  If the
460         'keyvalue' matches one of the values for the key property among
461         the nodes in this class, the matching node's id is returned;
462         otherwise a KeyError is raised.
463         """
464         raise NotImplementedError
466     # XXX: change from spec - allows multiple props to match
467     def find(self, **propspec):
468         """Get the ids of nodes in this class which link to the given nodes.
470         'propspec' consists of keyword args propname={nodeid:1,}   
471           'propname' must be the name of a property in this class, or a
472             KeyError is raised.  That property must be a Link or Multilink
473             property, or a TypeError is raised.
475         Any node in this class whose 'propname' property links to any of the
476         nodeids will be returned. Used by the full text indexing, which knows
477         that "foo" occurs in msg1, msg3 and file7, so we have hits on these
478         issues:
480             db.issue.find(messages={'1':1,'3':1}, files={'7':1})
481         """
482         raise NotImplementedError
484     # XXX not in spec
485     def filter(self, search_matches, filterspec, sort, group, 
486             num_re = re.compile('^\d+$')):
487         ''' Return a list of the ids of the active nodes in this class that
488             match the 'filter' spec, sorted by the group spec and then the
489             sort spec
490         '''
491         raise NotImplementedError
493     def count(self):
494         """Get the number of nodes in this class.
496         If the returned integer is 'numnodes', the ids of all the nodes
497         in this class run from 1 to numnodes, and numnodes+1 will be the
498         id of the next node to be created in this class.
499         """
500         raise NotImplementedError
502     # Manipulating properties:
503     def getprops(self, protected=1):
504         """Return a dictionary mapping property names to property objects.
505            If the "protected" flag is true, we include protected properties -
506            those which may not be modified.
507         """
508         raise NotImplementedError
510     def addprop(self, **properties):
511         """Add properties to this class.
513         The keyword arguments in 'properties' must map names to property
514         objects, or a TypeError is raised.  None of the keys in 'properties'
515         may collide with the names of existing properties, or a ValueError
516         is raised before any properties have been added.
517         """
518         raise NotImplementedError
520     def index(self, nodeid):
521         '''Add (or refresh) the node to search indexes
522         '''
523         raise NotImplementedError
525 # XXX not in spec
526 class Node:
527     ''' A convenience wrapper for the given node
528     '''
529     def __init__(self, cl, nodeid, cache=1):
530         self.__dict__['cl'] = cl
531         self.__dict__['nodeid'] = nodeid
532         self.__dict__['cache'] = cache
533     def keys(self, protected=1):
534         return self.cl.getprops(protected=protected).keys()
535     def values(self, protected=1):
536         l = []
537         for name in self.cl.getprops(protected=protected).keys():
538             l.append(self.cl.get(self.nodeid, name, cache=self.cache))
539         return l
540     def items(self, protected=1):
541         l = []
542         for name in self.cl.getprops(protected=protected).keys():
543             l.append((name, self.cl.get(self.nodeid, name, cache=self.cache)))
544         return l
545     def has_key(self, name):
546         return self.cl.getprops().has_key(name)
547     def __getattr__(self, name):
548         if self.__dict__.has_key(name):
549             return self.__dict__[name]
550         try:
551             return self.cl.get(self.nodeid, name, cache=self.cache)
552         except KeyError, value:
553             # we trap this but re-raise it as AttributeError - all other
554             # exceptions should pass through untrapped
555             pass
556         # nope, no such attribute
557         raise AttributeError, str(value)
558     def __getitem__(self, name):
559         return self.cl.get(self.nodeid, name, cache=self.cache)
560     def __setattr__(self, name, value):
561         try:
562             return self.cl.set(self.nodeid, **{name: value})
563         except KeyError, value:
564             raise AttributeError, str(value)
565     def __setitem__(self, name, value):
566         self.cl.set(self.nodeid, **{name: value})
567     def history(self):
568         return self.cl.history(self.nodeid)
569     def retire(self):
570         return self.cl.retire(self.nodeid)
573 def Choice(name, db, *options):
574     '''Quick helper to create a simple class with choices
575     '''
576     cl = Class(db, name, name=String(), order=String())
577     for i in range(len(options)):
578         cl.create(name=options[i], order=i)
579     return hyperdb.Link(name)
582 # $Log: not supported by cvs2svn $
583 # Revision 1.74  2002/07/10 00:24:10  richard
584 # braino
586 # Revision 1.73  2002/07/10 00:19:48  richard
587 # Added explicit closing of backend database handles.
589 # Revision 1.72  2002/07/09 21:53:38  gmcm
590 # Optimize Class.find so that the propspec can contain a set of ids to match.
591 # This is used by indexer.search so it can do just one find for all the index matches.
592 # This was already confusing code, but for common terms (lots of index matches),
593 # it is enormously faster.
595 # Revision 1.71  2002/07/09 03:02:52  richard
596 # More indexer work:
597 # - all String properties may now be indexed too. Currently there's a bit of
598 #   "issue" specific code in the actual searching which needs to be
599 #   addressed. In a nutshell:
600 #   + pass 'indexme="yes"' as a String() property initialisation arg, eg:
601 #         file = FileClass(db, "file", name=String(), type=String(),
602 #             comment=String(indexme="yes"))
603 #   + the comment will then be indexed and be searchable, with the results
604 #     related back to the issue that the file is linked to
605 # - as a result of this work, the FileClass has a default MIME type that may
606 #   be overridden in a subclass, or by the use of a "type" property as is
607 #   done in the default templates.
608 # - the regeneration of the indexes (if necessary) is done once the schema is
609 #   set up in the dbinit.
611 # Revision 1.70  2002/06/27 12:06:20  gmcm
612 # Improve an error message.
614 # Revision 1.69  2002/06/17 23:15:29  richard
615 # Can debug to stdout now
617 # Revision 1.68  2002/06/11 06:52:03  richard
618 #  . #564271 ] find() and new properties
620 # Revision 1.67  2002/06/11 05:02:37  richard
621 #  . #565979 ] code error in hyperdb.Class.find
623 # Revision 1.66  2002/05/25 07:16:24  rochecompaan
624 # Merged search_indexing-branch with HEAD
626 # Revision 1.65  2002/05/22 04:12:05  richard
627 #  . applied patch #558876 ] cgi client customization
628 #    ... with significant additions and modifications ;)
629 #    - extended handling of ML assignedto to all places it's handled
630 #    - added more NotFound info
632 # Revision 1.64  2002/05/15 06:21:21  richard
633 #  . node caching now works, and gives a small boost in performance
635 # As a part of this, I cleaned up the DEBUG output and implemented TRACE
636 # output (HYPERDBTRACE='file to trace to') with checkpoints at the start of
637 # CGI requests. Run roundup with python -O to skip all the DEBUG/TRACE stuff
638 # (using if __debug__ which is compiled out with -O)
640 # Revision 1.63  2002/04/15 23:25:15  richard
641 # . node ids are now generated from a lockable store - no more race conditions
643 # We're using the portalocker code by Jonathan Feinberg that was contributed
644 # to the ASPN Python cookbook. This gives us locking across Unix and Windows.
646 # Revision 1.62  2002/04/03 07:05:50  richard
647 # d'oh! killed retirement of nodes :(
648 # all better now...
650 # Revision 1.61  2002/04/03 06:11:51  richard
651 # Fix for old databases that contain properties that don't exist any more.
653 # Revision 1.60  2002/04/03 05:54:31  richard
654 # Fixed serialisation problem by moving the serialisation step out of the
655 # hyperdb.Class (get, set) into the hyperdb.Database.
657 # Also fixed htmltemplate after the showid changes I made yesterday.
659 # Unit tests for all of the above written.
661 # Revision 1.59.2.2  2002/04/20 13:23:33  rochecompaan
662 # We now have a separate search page for nodes.  Search links for
663 # different classes can be customized in instance_config similar to
664 # index links.
666 # Revision 1.59.2.1  2002/04/19 19:54:42  rochecompaan
667 # cgi_client.py
668 #     removed search link for the time being
669 #     moved rendering of matches to htmltemplate
670 # hyperdb.py
671 #     filtering of nodes on full text search incorporated in filter method
672 # roundupdb.py
673 #     added paramater to call of filter method
674 # roundup_indexer.py
675 #     added search method to RoundupIndexer class
677 # Revision 1.59  2002/03/12 22:52:26  richard
678 # more pychecker warnings removed
680 # Revision 1.58  2002/02/27 03:23:16  richard
681 # Ran it through pychecker, made fixes
683 # Revision 1.57  2002/02/20 05:23:24  richard
684 # Didn't accomodate new values for new properties
686 # Revision 1.56  2002/02/20 05:05:28  richard
687 #  . Added simple editing for classes that don't define a templated interface.
688 #    - access using the admin "class list" interface
689 #    - limited to admin-only
690 #    - requires the csv module from object-craft (url given if it's missing)
692 # Revision 1.55  2002/02/15 07:27:12  richard
693 # Oops, precedences around the way w0rng.
695 # Revision 1.54  2002/02/15 07:08:44  richard
696 #  . Alternate email addresses are now available for users. See the MIGRATION
697 #    file for info on how to activate the feature.
699 # Revision 1.53  2002/01/22 07:21:13  richard
700 # . fixed back_bsddb so it passed the journal tests
702 # ... it didn't seem happy using the back_anydbm _open method, which is odd.
703 # Yet another occurrance of whichdb not being able to recognise older bsddb
704 # databases. Yadda yadda. Made the HYPERDBDEBUG stuff more sane in the
705 # process.
707 # Revision 1.52  2002/01/21 16:33:19  rochecompaan
708 # You can now use the roundup-admin tool to pack the database
710 # Revision 1.51  2002/01/21 03:01:29  richard
711 # brief docco on the do_journal argument
713 # Revision 1.50  2002/01/19 13:16:04  rochecompaan
714 # Journal entries for link and multilink properties can now be switched on
715 # or off.
717 # Revision 1.49  2002/01/16 07:02:57  richard
718 #  . lots of date/interval related changes:
719 #    - more relaxed date format for input
721 # Revision 1.48  2002/01/14 06:32:34  richard
722 #  . #502951 ] adding new properties to old database
724 # Revision 1.47  2002/01/14 02:20:15  richard
725 #  . changed all config accesses so they access either the instance or the
726 #    config attriubute on the db. This means that all config is obtained from
727 #    instance_config instead of the mish-mash of classes. This will make
728 #    switching to a ConfigParser setup easier too, I hope.
730 # At a minimum, this makes migration a _little_ easier (a lot easier in the
731 # 0.5.0 switch, I hope!)
733 # Revision 1.46  2002/01/07 10:42:23  richard
734 # oops
736 # Revision 1.45  2002/01/02 04:18:17  richard
737 # hyperdb docstrings
739 # Revision 1.44  2002/01/02 02:31:38  richard
740 # Sorry for the huge checkin message - I was only intending to implement #496356
741 # but I found a number of places where things had been broken by transactions:
742 #  . modified ROUNDUPDBSENDMAILDEBUG to be SENDMAILDEBUG and hold a filename
743 #    for _all_ roundup-generated smtp messages to be sent to.
744 #  . the transaction cache had broken the roundupdb.Class set() reactors
745 #  . newly-created author users in the mailgw weren't being committed to the db
747 # Stuff that made it into CHANGES.txt (ie. the stuff I was actually working
748 # on when I found that stuff :):
749 #  . #496356 ] Use threading in messages
750 #  . detectors were being registered multiple times
751 #  . added tests for mailgw
752 #  . much better attaching of erroneous messages in the mail gateway
754 # Revision 1.43  2001/12/20 06:13:24  rochecompaan
755 # Bugs fixed:
756 #   . Exception handling in hyperdb for strings-that-look-like numbers got
757 #     lost somewhere
758 #   . Internet Explorer submits full path for filename - we now strip away
759 #     the path
760 # Features added:
761 #   . Link and multilink properties are now displayed sorted in the cgi
762 #     interface
764 # Revision 1.42  2001/12/16 10:53:37  richard
765 # take a copy of the node dict so that the subsequent set
766 # operation doesn't modify the oldvalues structure
768 # Revision 1.41  2001/12/15 23:47:47  richard
769 # Cleaned up some bare except statements
771 # Revision 1.40  2001/12/14 23:42:57  richard
772 # yuck, a gdbm instance tests false :(
773 # I've left the debugging code in - it should be removed one day if we're ever
774 # _really_ anal about performace :)
776 # Revision 1.39  2001/12/02 05:06:16  richard
777 # . We now use weakrefs in the Classes to keep the database reference, so
778 #   the close() method on the database is no longer needed.
779 #   I bumped the minimum python requirement up to 2.1 accordingly.
780 # . #487480 ] roundup-server
781 # . #487476 ] INSTALL.txt
783 # I also cleaned up the change message / post-edit stuff in the cgi client.
784 # There's now a clearly marked "TODO: append the change note" where I believe
785 # the change note should be added there. The "changes" list will obviously
786 # have to be modified to be a dict of the changes, or somesuch.
788 # More testing needed.
790 # Revision 1.38  2001/12/01 07:17:50  richard
791 # . We now have basic transaction support! Information is only written to
792 #   the database when the commit() method is called. Only the anydbm
793 #   backend is modified in this way - neither of the bsddb backends have been.
794 #   The mail, admin and cgi interfaces all use commit (except the admin tool
795 #   doesn't have a commit command, so interactive users can't commit...)
796 # . Fixed login/registration forwarding the user to the right page (or not,
797 #   on a failure)
799 # Revision 1.37  2001/11/28 21:55:35  richard
800 #  . login_action and newuser_action return values were being ignored
801 #  . Woohoo! Found that bloody re-login bug that was killing the mail
802 #    gateway.
803 #  (also a minor cleanup in hyperdb)
805 # Revision 1.36  2001/11/27 03:16:09  richard
806 # Another place that wasn't handling missing properties.
808 # Revision 1.35  2001/11/22 15:46:42  jhermann
809 # Added module docstrings to all modules.
811 # Revision 1.34  2001/11/21 04:04:43  richard
812 # *sigh* more missing value handling
814 # Revision 1.33  2001/11/21 03:40:54  richard
815 # more new property handling
817 # Revision 1.32  2001/11/21 03:11:28  richard
818 # Better handling of new properties.
820 # Revision 1.31  2001/11/12 22:01:06  richard
821 # Fixed issues with nosy reaction and author copies.
823 # Revision 1.30  2001/11/09 10:11:08  richard
824 #  . roundup-admin now handles all hyperdb exceptions
826 # Revision 1.29  2001/10/27 00:17:41  richard
827 # Made Class.stringFind() do caseless matching.
829 # Revision 1.28  2001/10/21 04:44:50  richard
830 # bug #473124: UI inconsistency with Link fields.
831 #    This also prompted me to fix a fairly long-standing usability issue -
832 #    that of being able to turn off certain filters.
834 # Revision 1.27  2001/10/20 23:44:27  richard
835 # Hyperdatabase sorts strings-that-look-like-numbers as numbers now.
837 # Revision 1.26  2001/10/16 03:48:01  richard
838 # admin tool now complains if a "find" is attempted with a non-link property.
840 # Revision 1.25  2001/10/11 00:17:51  richard
841 # Reverted a change in hyperdb so the default value for missing property
842 # values in a create() is None and not '' (the empty string.) This obviously
843 # breaks CSV import/export - the string 'None' will be created in an
844 # export/import operation.
846 # Revision 1.24  2001/10/10 03:54:57  richard
847 # Added database importing and exporting through CSV files.
848 # Uses the csv module from object-craft for exporting if it's available.
849 # Requires the csv module for importing.
851 # Revision 1.23  2001/10/09 23:58:10  richard
852 # Moved the data stringification up into the hyperdb.Class class' get, set
853 # and create methods. This means that the data is also stringified for the
854 # journal call, and removes duplication of code from the backends. The
855 # backend code now only sees strings.
857 # Revision 1.22  2001/10/09 07:25:59  richard
858 # Added the Password property type. See "pydoc roundup.password" for
859 # implementation details. Have updated some of the documentation too.
861 # Revision 1.21  2001/10/05 02:23:24  richard
862 #  . roundup-admin create now prompts for property info if none is supplied
863 #    on the command-line.
864 #  . hyperdb Class getprops() method may now return only the mutable
865 #    properties.
866 #  . Login now uses cookies, which makes it a whole lot more flexible. We can
867 #    now support anonymous user access (read-only, unless there's an
868 #    "anonymous" user, in which case write access is permitted). Login
869 #    handling has been moved into cgi_client.Client.main()
870 #  . The "extended" schema is now the default in roundup init.
871 #  . The schemas have had their page headings modified to cope with the new
872 #    login handling. Existing installations should copy the interfaces.py
873 #    file from the roundup lib directory to their instance home.
874 #  . Incorrectly had a Bizar Software copyright on the cgitb.py module from
875 #    Ping - has been removed.
876 #  . Fixed a whole bunch of places in the CGI interface where we should have
877 #    been returning Not Found instead of throwing an exception.
878 #  . Fixed a deviation from the spec: trying to modify the 'id' property of
879 #    an item now throws an exception.
881 # Revision 1.20  2001/10/04 02:12:42  richard
882 # Added nicer command-line item adding: passing no arguments will enter an
883 # interactive more which asks for each property in turn. While I was at it, I
884 # fixed an implementation problem WRT the spec - I wasn't raising a
885 # ValueError if the key property was missing from a create(). Also added a
886 # protected=boolean argument to getprops() so we can list only the mutable
887 # properties (defaults to yes, which lists the immutables).
889 # Revision 1.19  2001/08/29 04:47:18  richard
890 # Fixed CGI client change messages so they actually include the properties
891 # changed (again).
893 # Revision 1.18  2001/08/16 07:34:59  richard
894 # better CGI text searching - but hidden filter fields are disappearing...
896 # Revision 1.17  2001/08/16 06:59:58  richard
897 # all searches use re now - and they're all case insensitive
899 # Revision 1.16  2001/08/15 23:43:18  richard
900 # Fixed some isFooTypes that I missed.
901 # Refactored some code in the CGI code.
903 # Revision 1.15  2001/08/12 06:32:36  richard
904 # using isinstance(blah, Foo) now instead of isFooType
906 # Revision 1.14  2001/08/07 00:24:42  richard
907 # stupid typo
909 # Revision 1.13  2001/08/07 00:15:51  richard
910 # Added the copyright/license notice to (nearly) all files at request of
911 # Bizar Software.
913 # Revision 1.12  2001/08/02 06:38:17  richard
914 # Roundupdb now appends "mailing list" information to its messages which
915 # include the e-mail address and web interface address. Templates may
916 # override this in their db classes to include specific information (support
917 # instructions, etc).
919 # Revision 1.11  2001/08/01 04:24:21  richard
920 # mailgw was assuming certain properties existed on the issues being created.
922 # Revision 1.10  2001/07/30 02:38:31  richard
923 # get() now has a default arg - for migration only.
925 # Revision 1.9  2001/07/29 09:28:23  richard
926 # Fixed sorting by clicking on column headings.
928 # Revision 1.8  2001/07/29 08:27:40  richard
929 # Fixed handling of passed-in values in form elements (ie. during a
930 # drill-down)
932 # Revision 1.7  2001/07/29 07:01:39  richard
933 # Added vim command to all source so that we don't get no steenkin' tabs :)
935 # Revision 1.6  2001/07/29 05:36:14  richard
936 # Cleanup of the link label generation.
938 # Revision 1.5  2001/07/29 04:05:37  richard
939 # Added the fabricated property "id".
941 # Revision 1.4  2001/07/27 06:25:35  richard
942 # Fixed some of the exceptions so they're the right type.
943 # Removed the str()-ification of node ids so we don't mask oopsy errors any
944 # more.
946 # Revision 1.3  2001/07/27 05:17:14  richard
947 # just some comments
949 # Revision 1.2  2001/07/22 12:09:32  richard
950 # Final commit of Grande Splite
952 # Revision 1.1  2001/07/22 11:58:35  richard
953 # More Grande Splite
956 # vim: set filetype=python ts=4 sw=4 et si