Mercurial > p > roundup > code
annotate roundup/roundupdb.py @ 440:de5bf4191f11
Enabled transaction support in the bsddb backend.
It uses the anydbm code where possible, only replacing methods where
the db is opened (it uses the btree opener specifically.)
Also cleaned up some change note generation.
Made the backends package work with pydoc too.
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Mon, 10 Dec 2001 22:20:01 +0000 |
| parents | 6e27cb83aacb |
| children | 52b5f53d12f3 |
| rev | line source |
|---|---|
|
213
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
188
diff
changeset
|
1 # |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
188
diff
changeset
|
2 # Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/) |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
188
diff
changeset
|
3 # This module is free software, and you may redistribute it and/or modify |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
188
diff
changeset
|
4 # under the same terms as Python, so long as this copyright message and |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
188
diff
changeset
|
5 # disclaimer are retained in their original form. |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
188
diff
changeset
|
6 # |
| 214 | 7 # IN NO EVENT SHALL BIZAR SOFTWARE PTY LTD BE LIABLE TO ANY PARTY FOR |
|
213
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
188
diff
changeset
|
8 # DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
188
diff
changeset
|
9 # OUT OF THE USE OF THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
188
diff
changeset
|
10 # POSSIBILITY OF SUCH DAMAGE. |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
188
diff
changeset
|
11 # |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
188
diff
changeset
|
12 # BIZAR SOFTWARE PTY LTD SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
188
diff
changeset
|
13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
188
diff
changeset
|
14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
188
diff
changeset
|
15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
188
diff
changeset
|
16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
188
diff
changeset
|
17 # |
|
440
de5bf4191f11
Enabled transaction support in the bsddb backend.
Richard Jones <richard@users.sourceforge.net>
parents:
439
diff
changeset
|
18 # $Id: roundupdb.py,v 1.28 2001-12-10 22:20:01 richard Exp $ |
|
406
bdc2ea127ae9
Added module docstrings to all modules.
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
393
diff
changeset
|
19 |
|
bdc2ea127ae9
Added module docstrings to all modules.
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
393
diff
changeset
|
20 __doc__ = """ |
|
bdc2ea127ae9
Added module docstrings to all modules.
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
393
diff
changeset
|
21 Extending hyperdb with types specific to issue-tracking. |
|
bdc2ea127ae9
Added module docstrings to all modules.
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
393
diff
changeset
|
22 """ |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
23 |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
24 import re, os, smtplib, socket |
|
393
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
25 import mimetools, MimeWriter, cStringIO |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
26 import base64, mimetypes |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
27 |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
28 import hyperdb, date |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
29 |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
313
diff
changeset
|
30 class DesignatorError(ValueError): |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
313
diff
changeset
|
31 pass |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
32 def splitDesignator(designator, dre=re.compile(r'([^\d]+)(\d+)')): |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
33 ''' Take a foo123 and return ('foo', 123) |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
34 ''' |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
35 m = dre.match(designator) |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
313
diff
changeset
|
36 if m is None: |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
313
diff
changeset
|
37 raise DesignatorError, '"%s" not a node designator'%designator |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
38 return m.group(1), m.group(2) |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
39 |
|
380
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
40 |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
41 class Database: |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
42 def getuid(self): |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
43 """Return the id of the "user" node associated with the user |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
44 that owns this connection to the hyperdatabase.""" |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
45 return self.user.lookup(self.journaltag) |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
46 |
|
262
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
47 def uidFromAddress(self, address, create=1): |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
48 ''' address is from the rfc822 module, and therefore is (name, addr) |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
49 |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
50 user is created if they don't exist in the db already |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
51 ''' |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
52 (realname, address) = address |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
53 users = self.user.stringFind(address=address) |
| 337 | 54 for dummy in range(2): |
| 55 if len(users) > 1: | |
| 56 # make sure we don't match the anonymous or admin user | |
| 57 for user in users: | |
| 58 if user == '1': continue | |
| 59 if self.user.get(user, 'username') == 'anonymous': continue | |
| 60 # first valid match will do | |
| 61 return user | |
| 62 # well, I guess we have no choice | |
| 63 return user[0] | |
| 64 elif users: | |
| 65 return users[0] | |
| 66 # try to match the username to the address (for local | |
| 67 # submissions where the address is empty) | |
| 68 users = self.user.stringFind(username=address) | |
| 69 | |
| 70 # couldn't match address or username, so create a new user | |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
71 return self.user.create(username=address, address=address, |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
72 realname=realname) |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
73 |
|
156
9c5ddad06430
get() now has a default arg - for migration only.
Richard Jones <richard@users.sourceforge.net>
parents:
138
diff
changeset
|
74 _marker = [] |
|
44
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
75 # XXX: added the 'creator' faked attribute |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
76 class Class(hyperdb.Class): |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
77 # Overridden methods: |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
78 def __init__(self, db, classname, **properties): |
|
313
489b70c37f32
feature [SF#473127]: Filenames.
Richard Jones <richard@users.sourceforge.net>
parents:
308
diff
changeset
|
79 if (properties.has_key('creation') or properties.has_key('activity') |
|
489b70c37f32
feature [SF#473127]: Filenames.
Richard Jones <richard@users.sourceforge.net>
parents:
308
diff
changeset
|
80 or properties.has_key('creator')): |
|
489b70c37f32
feature [SF#473127]: Filenames.
Richard Jones <richard@users.sourceforge.net>
parents:
308
diff
changeset
|
81 raise ValueError, '"creation", "activity" and "creator" are reserved' |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
82 hyperdb.Class.__init__(self, db, classname, **properties) |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
83 self.auditors = {'create': [], 'set': [], 'retire': []} |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
84 self.reactors = {'create': [], 'set': [], 'retire': []} |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
85 |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
86 def create(self, **propvalues): |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
87 """These operations trigger detectors and can be vetoed. Attempts |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
88 to modify the "creation" or "activity" properties cause a KeyError. |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
89 """ |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
90 if propvalues.has_key('creation') or propvalues.has_key('activity'): |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
91 raise KeyError, '"creation" and "activity" are reserved' |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
92 for audit in self.auditors['create']: |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
93 audit(self.db, self, None, propvalues) |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
94 nodeid = hyperdb.Class.create(self, **propvalues) |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
95 for react in self.reactors['create']: |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
96 react(self.db, self, nodeid, None) |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
97 return nodeid |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
98 |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
99 def set(self, nodeid, **propvalues): |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
100 """These operations trigger detectors and can be vetoed. Attempts |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
101 to modify the "creation" or "activity" properties cause a KeyError. |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
102 """ |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
103 if propvalues.has_key('creation') or propvalues.has_key('activity'): |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
104 raise KeyError, '"creation" and "activity" are reserved' |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
105 for audit in self.auditors['set']: |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
106 audit(self.db, self, nodeid, propvalues) |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
107 oldvalues = self.db.getnode(self.classname, nodeid) |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
108 hyperdb.Class.set(self, nodeid, **propvalues) |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
109 for react in self.reactors['set']: |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
110 react(self.db, self, nodeid, oldvalues) |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
111 |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
112 def retire(self, nodeid): |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
113 """These operations trigger detectors and can be vetoed. Attempts |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
114 to modify the "creation" or "activity" properties cause a KeyError. |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
115 """ |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
116 for audit in self.auditors['retire']: |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
117 audit(self.db, self, nodeid, None) |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
118 hyperdb.Class.retire(self, nodeid) |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
119 for react in self.reactors['retire']: |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
120 react(self.db, self, nodeid, None) |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
121 |
|
156
9c5ddad06430
get() now has a default arg - for migration only.
Richard Jones <richard@users.sourceforge.net>
parents:
138
diff
changeset
|
122 def get(self, nodeid, propname, default=_marker): |
|
44
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
123 """Attempts to get the "creation" or "activity" properties should |
|
156
9c5ddad06430
get() now has a default arg - for migration only.
Richard Jones <richard@users.sourceforge.net>
parents:
138
diff
changeset
|
124 do the right thing. |
|
44
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
125 """ |
|
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
126 if propname == 'creation': |
|
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
127 journal = self.db.getjournal(self.classname, nodeid) |
|
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
128 if journal: |
|
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
129 return self.db.getjournal(self.classname, nodeid)[0][1] |
|
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
130 else: |
|
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
131 # on the strange chance that there's no journal |
|
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
132 return date.Date() |
|
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
133 if propname == 'activity': |
|
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
134 journal = self.db.getjournal(self.classname, nodeid) |
|
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
135 if journal: |
|
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
136 return self.db.getjournal(self.classname, nodeid)[-1][1] |
|
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
137 else: |
|
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
138 # on the strange chance that there's no journal |
|
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
139 return date.Date() |
|
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
140 if propname == 'creator': |
|
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
141 journal = self.db.getjournal(self.classname, nodeid) |
|
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
142 if journal: |
|
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
143 name = self.db.getjournal(self.classname, nodeid)[0][2] |
|
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
144 else: |
|
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
145 return None |
|
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
146 return self.db.user.lookup(name) |
|
156
9c5ddad06430
get() now has a default arg - for migration only.
Richard Jones <richard@users.sourceforge.net>
parents:
138
diff
changeset
|
147 if default is not _marker: |
|
9c5ddad06430
get() now has a default arg - for migration only.
Richard Jones <richard@users.sourceforge.net>
parents:
138
diff
changeset
|
148 return hyperdb.Class.get(self, nodeid, propname, default) |
|
9c5ddad06430
get() now has a default arg - for migration only.
Richard Jones <richard@users.sourceforge.net>
parents:
138
diff
changeset
|
149 else: |
|
9c5ddad06430
get() now has a default arg - for migration only.
Richard Jones <richard@users.sourceforge.net>
parents:
138
diff
changeset
|
150 return hyperdb.Class.get(self, nodeid, propname) |
|
44
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
151 |
|
262
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
152 def getprops(self, protected=1): |
|
44
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
153 """In addition to the actual properties on the node, these |
|
262
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
154 methods provide the "creation" and "activity" properties. If the |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
155 "protected" flag is true, we include protected properties - those |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
156 which may not be modified. |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
157 """ |
|
263
e13d55912cd4
Forgot to pass the protected flag down *sigh*.
Richard Jones <richard@users.sourceforge.net>
parents:
262
diff
changeset
|
158 d = hyperdb.Class.getprops(self, protected=protected).copy() |
|
262
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
159 if protected: |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
160 d['creation'] = hyperdb.Date() |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
161 d['activity'] = hyperdb.Date() |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
162 d['creator'] = hyperdb.Link("user") |
|
44
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
163 return d |
|
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
164 |
|
118
a55c1301ba1f
Added the fabricated property "id".
Richard Jones <richard@users.sourceforge.net>
parents:
44
diff
changeset
|
165 # |
|
a55c1301ba1f
Added the fabricated property "id".
Richard Jones <richard@users.sourceforge.net>
parents:
44
diff
changeset
|
166 # Detector interface |
|
a55c1301ba1f
Added the fabricated property "id".
Richard Jones <richard@users.sourceforge.net>
parents:
44
diff
changeset
|
167 # |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
168 def audit(self, event, detector): |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
169 """Register a detector |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
170 """ |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
171 self.auditors[event].append(detector) |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
172 |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
173 def react(self, event, detector): |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
174 """Register a detector |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
175 """ |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
176 self.reactors[event].append(detector) |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
177 |
|
118
a55c1301ba1f
Added the fabricated property "id".
Richard Jones <richard@users.sourceforge.net>
parents:
44
diff
changeset
|
178 |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
179 class FileClass(Class): |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
180 def create(self, **propvalues): |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
181 ''' snaffle the file propvalue and store in a file |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
182 ''' |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
183 content = propvalues['content'] |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
184 del propvalues['content'] |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
185 newid = Class.create(self, **propvalues) |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
186 self.setcontent(self.classname, newid, content) |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
187 return newid |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
188 |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
189 def filename(self, classname, nodeid): |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
190 # TODO: split into multiple files directories |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
191 return os.path.join(self.db.dir, 'files', '%s%s'%(classname, nodeid)) |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
192 |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
193 def setcontent(self, classname, nodeid, content): |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
194 ''' set the content file for this file |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
195 ''' |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
196 open(self.filename(classname, nodeid), 'wb').write(content) |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
197 |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
198 def getcontent(self, classname, nodeid): |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
199 ''' get the content file for this file |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
200 ''' |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
201 return open(self.filename(classname, nodeid), 'rb').read() |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
202 |
|
156
9c5ddad06430
get() now has a default arg - for migration only.
Richard Jones <richard@users.sourceforge.net>
parents:
138
diff
changeset
|
203 def get(self, nodeid, propname, default=_marker): |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
204 ''' trap the content propname and get it from the file |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
205 ''' |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
206 if propname == 'content': |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
207 return self.getcontent(self.classname, nodeid) |
|
156
9c5ddad06430
get() now has a default arg - for migration only.
Richard Jones <richard@users.sourceforge.net>
parents:
138
diff
changeset
|
208 if default is not _marker: |
|
9c5ddad06430
get() now has a default arg - for migration only.
Richard Jones <richard@users.sourceforge.net>
parents:
138
diff
changeset
|
209 return Class.get(self, nodeid, propname, default) |
|
9c5ddad06430
get() now has a default arg - for migration only.
Richard Jones <richard@users.sourceforge.net>
parents:
138
diff
changeset
|
210 else: |
|
9c5ddad06430
get() now has a default arg - for migration only.
Richard Jones <richard@users.sourceforge.net>
parents:
138
diff
changeset
|
211 return Class.get(self, nodeid, propname) |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
212 |
|
262
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
213 def getprops(self, protected=1): |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
214 ''' In addition to the actual properties on the node, these methods |
|
262
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
215 provide the "content" property. If the "protected" flag is true, |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
216 we include protected properties - those which may not be |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
217 modified. |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
218 ''' |
|
263
e13d55912cd4
Forgot to pass the protected flag down *sigh*.
Richard Jones <richard@users.sourceforge.net>
parents:
262
diff
changeset
|
219 d = Class.getprops(self, protected=protected).copy() |
|
262
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
220 if protected: |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
221 d['content'] = hyperdb.String() |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
222 return d |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
223 |
|
380
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
224 class MessageSendError(RuntimeError): |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
225 pass |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
226 |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
227 class DetectorError(RuntimeError): |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
228 pass |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
229 |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
230 # XXX deviation from spec - was called ItemClass |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
231 class IssueClass(Class): |
| 337 | 232 # configuration |
| 233 MESSAGES_TO_AUTHOR = 'no' | |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
234 INSTANCE_NAME = 'Roundup issue tracker' |
|
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
235 EMAIL_SIGNATURE_POSITION = 'bottom' |
| 337 | 236 |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
237 # Overridden methods: |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
238 |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
239 def __init__(self, db, classname, **properties): |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
240 """The newly-created class automatically includes the "messages", |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
241 "files", "nosy", and "superseder" properties. If the 'properties' |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
242 dictionary attempts to specify any of these properties or a |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
243 "creation" or "activity" property, a ValueError is raised.""" |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
244 if not properties.has_key('title'): |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
245 properties['title'] = hyperdb.String() |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
246 if not properties.has_key('messages'): |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
247 properties['messages'] = hyperdb.Multilink("msg") |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
248 if not properties.has_key('files'): |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
249 properties['files'] = hyperdb.Multilink("file") |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
250 if not properties.has_key('nosy'): |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
251 properties['nosy'] = hyperdb.Multilink("user") |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
252 if not properties.has_key('superseder'): |
|
138
e012bb958238
Fixed IssueClass so that superseders links to its classname...
Richard Jones <richard@users.sourceforge.net>
parents:
127
diff
changeset
|
253 properties['superseder'] = hyperdb.Multilink(classname) |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
254 Class.__init__(self, db, classname, **properties) |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
255 |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
256 # New methods: |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
257 |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
258 def addmessage(self, nodeid, summary, text): |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
259 """Add a message to an issue's mail spool. |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
260 |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
261 A new "msg" node is constructed using the current date, the user that |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
262 owns the database connection as the author, and the specified summary |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
263 text. |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
264 |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
265 The "files" and "recipients" fields are left empty. |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
266 |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
267 The given text is saved as the body of the message and the node is |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
268 appended to the "messages" field of the specified issue. |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
269 """ |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
270 |
|
434
2441743e335b
Removed generation of change note from "sendmessage" in roundupdb.py.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
428
diff
changeset
|
271 def sendmessage(self, nodeid, msgid): |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
272 """Send a message to the members of an issue's nosy list. |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
273 |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
274 The message is sent only to users on the nosy list who are not |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
275 already on the "recipients" list for the message. |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
276 |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
277 These users are then added to the message's "recipients" list. |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
278 """ |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
279 # figure the recipient ids |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
280 recipients = self.db.msg.get(msgid, 'recipients') |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
281 r = {} |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
282 for recipid in recipients: |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
283 r[recipid] = 1 |
|
380
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
284 rlen = len(recipients) |
| 337 | 285 |
| 286 # figure the author's id, and indicate they've received the message | |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
287 authid = self.db.msg.get(msgid, 'author') |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
288 |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
289 # get the current nosy list, we'll need it |
|
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
290 nosy = self.get(nodeid, 'nosy') |
|
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
291 |
| 337 | 292 # ... but duplicate the message to the author as long as it's not |
| 293 # the anonymous user | |
| 294 if (self.MESSAGES_TO_AUTHOR == 'yes' and | |
| 295 self.db.user.get(authid, 'username') != 'anonymous'): | |
|
380
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
296 if not r.has_key(authid): |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
297 recipients.append(authid) |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
298 r[authid] = 1 |
| 337 | 299 |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
300 # now figure the nosy people who weren't recipients |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
301 for nosyid in nosy: |
| 337 | 302 # Don't send nosy mail to the anonymous user (that user |
| 303 # shouldn't appear in the nosy list, but just in case they | |
| 304 # do...) | |
| 305 if self.db.user.get(nosyid, 'username') == 'anonymous': continue | |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
306 if not r.has_key(nosyid): |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
307 recipients.append(nosyid) |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
308 |
|
380
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
309 # no new recipients |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
310 if rlen == len(recipients): |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
311 return |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
312 |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
313 # update the message's recipients list |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
314 self.db.msg.set(msgid, recipients=recipients) |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
315 |
|
380
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
316 # send an email to the people who missed out |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
317 sendto = [self.db.user.get(i, 'address') for i in recipients] |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
318 cn = self.classname |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
319 title = self.get(nodeid, 'title') or '%s message copy'%cn |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
320 # figure author information |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
321 authname = self.db.user.get(authid, 'realname') |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
322 if not authname: |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
323 authname = self.db.user.get(authid, 'username') |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
324 authaddr = self.db.user.get(authid, 'address') |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
325 if authaddr: |
| 416 | 326 authaddr = ' <%s>'%authaddr |
|
380
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
327 else: |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
328 authaddr = '' |
|
425
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
329 |
|
393
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
330 # make the message body |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
331 m = [''] |
|
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
332 |
|
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
333 # put in roundup's signature |
|
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
334 if self.EMAIL_SIGNATURE_POSITION == 'top': |
|
428
7956563d49ae
Property changes are now completely traceable, whether changes are
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
425
diff
changeset
|
335 m.append(self.email_signature(nodeid, msgid)) |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
336 |
|
380
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
337 # add author information |
|
434
2441743e335b
Removed generation of change note from "sendmessage" in roundupdb.py.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
428
diff
changeset
|
338 if len(self.get(nodeid,'messages')) == 1: |
|
2441743e335b
Removed generation of change note from "sendmessage" in roundupdb.py.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
428
diff
changeset
|
339 m.append("New submission from %s%s:"%(authname, authaddr)) |
|
2441743e335b
Removed generation of change note from "sendmessage" in roundupdb.py.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
428
diff
changeset
|
340 else: |
|
425
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
341 m.append("%s%s added the comment:"%(authname, authaddr)) |
|
380
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
342 m.append('') |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
343 |
|
380
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
344 # add the content |
|
434
2441743e335b
Removed generation of change note from "sendmessage" in roundupdb.py.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
428
diff
changeset
|
345 m.append(self.db.msg.get(msgid, 'content')) |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
346 |
|
425
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
347 # put in roundup's signature |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
348 if self.EMAIL_SIGNATURE_POSITION == 'bottom': |
|
428
7956563d49ae
Property changes are now completely traceable, whether changes are
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
425
diff
changeset
|
349 m.append(self.email_signature(nodeid, msgid)) |
|
393
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
350 |
|
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
351 # get the files for this message |
|
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
352 files = self.db.msg.get(msgid, 'files') |
|
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
353 |
|
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
354 # create the message |
|
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
355 message = cStringIO.StringIO() |
|
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
356 writer = MimeWriter.MimeWriter(message) |
|
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
357 writer.addheader('Subject', '[%s%s] %s'%(cn, nodeid, title)) |
|
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
358 writer.addheader('To', ', '.join(sendto)) |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
359 writer.addheader('From', '%s <%s>'%(self.INSTANCE_NAME, |
|
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
360 self.ISSUE_TRACKER_EMAIL)) |
|
428
7956563d49ae
Property changes are now completely traceable, whether changes are
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
425
diff
changeset
|
361 writer.addheader('Reply-To', '%s <%s>'%(self.INSTANCE_NAME, |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
362 self.ISSUE_TRACKER_EMAIL)) |
|
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
363 writer.addheader('MIME-Version', '1.0') |
|
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
364 |
|
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
365 # attach files |
|
393
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
366 if files: |
|
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
367 part = writer.startmultipartbody('mixed') |
|
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
368 part = writer.nextpart() |
|
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
369 body = part.startbody('text/plain') |
|
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
370 body.write('\n'.join(m)) |
|
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
371 for fileid in files: |
|
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
372 name = self.db.file.get(fileid, 'name') |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
373 mime_type = self.db.file.get(fileid, 'type') |
|
393
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
374 content = self.db.file.get(fileid, 'content') |
|
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
375 part = writer.nextpart() |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
376 if mime_type == 'text/plain': |
|
393
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
377 part.addheader('Content-Disposition', |
|
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
378 'attachment;\n filename="%s"'%name) |
|
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
379 part.addheader('Content-Transfer-Encoding', '7bit') |
|
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
380 body = part.startbody('text/plain') |
|
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
381 body.write(content) |
|
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
382 else: |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
383 # some other type, so encode it |
|
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
384 if not mime_type: |
|
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
385 # this should have been done when the file was saved |
|
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
386 mime_type = mimetypes.guess_type(name)[0] |
|
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
387 if mime_type is None: |
|
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
388 mime_type = 'application/octet-stream' |
|
393
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
389 part.addheader('Content-Disposition', |
|
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
390 'attachment;\n filename="%s"'%name) |
|
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
391 part.addheader('Content-Transfer-Encoding', 'base64') |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
392 body = part.startbody(mime_type) |
|
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
393 body.write(base64.encodestring(content)) |
|
393
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
394 writer.lastpart() |
|
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
395 else: |
|
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
396 body = writer.startbody('text/plain') |
|
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
397 body.write('\n'.join(m)) |
|
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
398 |
|
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
399 # now try to send the message |
|
380
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
400 try: |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
401 smtp = smtplib.SMTP(self.MAILHOST) |
|
393
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
402 smtp.sendmail(self.ISSUE_TRACKER_EMAIL, sendto, message.getvalue()) |
|
380
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
403 except socket.error, value: |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
404 raise MessageSendError, \ |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
405 "Couldn't send confirmation email: mailhost %s"%value |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
406 except smtplib.SMTPException, value: |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
407 raise MessageSendError, \ |
|
393
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
408 "Couldn't send confirmation email: %s"%value |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
409 |
|
428
7956563d49ae
Property changes are now completely traceable, whether changes are
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
425
diff
changeset
|
410 def email_signature(self, nodeid, msgid): |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
411 ''' Add a signature to the e-mail with some useful information |
|
188
1536be43d2fa
Roundupdb now appends "mailing list" information to its messages...
Richard Jones <richard@users.sourceforge.net>
parents:
156
diff
changeset
|
412 ''' |
|
393
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
413 web = self.ISSUE_TRACKER_WEB + 'issue'+ nodeid |
|
414
fc6d03e9dbc1
couple of bugfixes from latest patch integration
Richard Jones <richard@users.sourceforge.net>
parents:
411
diff
changeset
|
414 email = '"%s" <%s>'%(self.INSTANCE_NAME, self.ISSUE_TRACKER_EMAIL) |
|
fc6d03e9dbc1
couple of bugfixes from latest patch integration
Richard Jones <richard@users.sourceforge.net>
parents:
411
diff
changeset
|
415 line = '_' * max(len(web), len(email)) |
|
428
7956563d49ae
Property changes are now completely traceable, whether changes are
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
425
diff
changeset
|
416 return '%s\n%s\n%s\n%s'%(line, email, web, line) |
|
425
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
417 |
|
434
2441743e335b
Removed generation of change note from "sendmessage" in roundupdb.py.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
428
diff
changeset
|
418 def generateChangeNote(self, nodeid, newvalues): |
|
425
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
419 """Generate a change note that lists property changes |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
420 """ |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
421 cn = self.classname |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
422 cl = self.db.classes[cn] |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
423 changed = {} |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
424 props = cl.getprops(protected=0) |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
425 |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
426 # determine what changed |
|
434
2441743e335b
Removed generation of change note from "sendmessage" in roundupdb.py.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
428
diff
changeset
|
427 for key in newvalues.keys(): |
|
425
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
428 if key in ['files','messages']: continue |
|
434
2441743e335b
Removed generation of change note from "sendmessage" in roundupdb.py.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
428
diff
changeset
|
429 new_value = newvalues[key] |
|
425
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
430 # the old value might be non existent |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
431 try: |
|
434
2441743e335b
Removed generation of change note from "sendmessage" in roundupdb.py.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
428
diff
changeset
|
432 old_value = cl.get(nodeid, key) |
|
425
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
433 if type(old_value) is type([]): |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
434 old_value.sort() |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
435 new_value.sort() |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
436 if old_value != new_value: |
|
434
2441743e335b
Removed generation of change note from "sendmessage" in roundupdb.py.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
428
diff
changeset
|
437 changed[key] = new_value |
|
425
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
438 except: |
|
434
2441743e335b
Removed generation of change note from "sendmessage" in roundupdb.py.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
428
diff
changeset
|
439 changed[key] = new_value |
|
425
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
440 |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
441 # list the changes |
|
440
de5bf4191f11
Enabled transaction support in the bsddb backend.
Richard Jones <richard@users.sourceforge.net>
parents:
439
diff
changeset
|
442 m = [] |
|
434
2441743e335b
Removed generation of change note from "sendmessage" in roundupdb.py.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
428
diff
changeset
|
443 for propname, value in changed.items(): |
|
425
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
444 prop = cl.properties[propname] |
|
434
2441743e335b
Removed generation of change note from "sendmessage" in roundupdb.py.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
428
diff
changeset
|
445 oldvalue = cl.get(nodeid, propname, None) |
|
425
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
446 change = '%s -> %s'%(oldvalue, value) |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
447 if isinstance(prop, hyperdb.Link): |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
448 link = self.db.classes[prop.classname] |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
449 key = link.labelprop(default_to_id=1) |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
450 if key: |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
451 if value: |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
452 value = link.get(value, key) |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
453 else: |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
454 value = '' |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
455 if oldvalue: |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
456 oldvalue = link.get(oldvalue, key) |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
457 else: |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
458 oldvalue = '' |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
459 change = '%s -> %s'%(oldvalue, value) |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
460 elif isinstance(prop, hyperdb.Multilink): |
|
428
7956563d49ae
Property changes are now completely traceable, whether changes are
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
425
diff
changeset
|
461 change = '' |
|
425
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
462 if value is None: value = [] |
|
434
2441743e335b
Removed generation of change note from "sendmessage" in roundupdb.py.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
428
diff
changeset
|
463 if oldvalue is None: oldvalue = [] |
|
425
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
464 l = [] |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
465 link = self.db.classes[prop.classname] |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
466 key = link.labelprop(default_to_id=1) |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
467 # check for additions |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
468 for entry in value: |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
469 if entry in oldvalue: continue |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
470 if key: |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
471 l.append(link.get(entry, key)) |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
472 else: |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
473 l.append(entry) |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
474 if l: |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
475 change = '+%s'%(', '.join(l)) |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
476 l = [] |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
477 # check for removals |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
478 for entry in oldvalue: |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
479 if entry in value: continue |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
480 if key: |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
481 l.append(link.get(entry, key)) |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
482 else: |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
483 l.append(entry) |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
484 if l: |
|
428
7956563d49ae
Property changes are now completely traceable, whether changes are
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
425
diff
changeset
|
485 change += ' -%s'%(', '.join(l)) |
|
425
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
486 m.append('%s: %s'%(propname, change)) |
|
439
6e27cb83aacb
only insert the -------- change note marker if there is a change note
Richard Jones <richard@users.sourceforge.net>
parents:
434
diff
changeset
|
487 if m: |
|
6e27cb83aacb
only insert the -------- change note marker if there is a change note
Richard Jones <richard@users.sourceforge.net>
parents:
434
diff
changeset
|
488 m.insert(0, '') |
|
6e27cb83aacb
only insert the -------- change note marker if there is a change note
Richard Jones <richard@users.sourceforge.net>
parents:
434
diff
changeset
|
489 m.insert(0, '----------') |
|
425
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
490 return '\n'.join(m) |
|
188
1536be43d2fa
Roundupdb now appends "mailing list" information to its messages...
Richard Jones <richard@users.sourceforge.net>
parents:
156
diff
changeset
|
491 |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
492 # |
|
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
493 # $Log: not supported by cvs2svn $ |
|
440
de5bf4191f11
Enabled transaction support in the bsddb backend.
Richard Jones <richard@users.sourceforge.net>
parents:
439
diff
changeset
|
494 # Revision 1.27 2001/12/10 21:02:53 richard |
|
de5bf4191f11
Enabled transaction support in the bsddb backend.
Richard Jones <richard@users.sourceforge.net>
parents:
439
diff
changeset
|
495 # only insert the -------- change note marker if there is a change note |
|
de5bf4191f11
Enabled transaction support in the bsddb backend.
Richard Jones <richard@users.sourceforge.net>
parents:
439
diff
changeset
|
496 # |
|
439
6e27cb83aacb
only insert the -------- change note marker if there is a change note
Richard Jones <richard@users.sourceforge.net>
parents:
434
diff
changeset
|
497 # Revision 1.26 2001/12/05 14:26:44 rochecompaan |
|
6e27cb83aacb
only insert the -------- change note marker if there is a change note
Richard Jones <richard@users.sourceforge.net>
parents:
434
diff
changeset
|
498 # Removed generation of change note from "sendmessage" in roundupdb.py. |
|
6e27cb83aacb
only insert the -------- change note marker if there is a change note
Richard Jones <richard@users.sourceforge.net>
parents:
434
diff
changeset
|
499 # The change note is now generated when the message is created. |
|
6e27cb83aacb
only insert the -------- change note marker if there is a change note
Richard Jones <richard@users.sourceforge.net>
parents:
434
diff
changeset
|
500 # |
|
434
2441743e335b
Removed generation of change note from "sendmessage" in roundupdb.py.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
428
diff
changeset
|
501 # Revision 1.25 2001/11/30 20:28:10 rochecompaan |
|
2441743e335b
Removed generation of change note from "sendmessage" in roundupdb.py.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
428
diff
changeset
|
502 # Property changes are now completely traceable, whether changes are |
|
2441743e335b
Removed generation of change note from "sendmessage" in roundupdb.py.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
428
diff
changeset
|
503 # made through the web or by email |
|
2441743e335b
Removed generation of change note from "sendmessage" in roundupdb.py.
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
428
diff
changeset
|
504 # |
|
428
7956563d49ae
Property changes are now completely traceable, whether changes are
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
425
diff
changeset
|
505 # Revision 1.24 2001/11/30 11:29:04 rochecompaan |
|
7956563d49ae
Property changes are now completely traceable, whether changes are
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
425
diff
changeset
|
506 # Property changes are now listed in emails generated by Roundup |
|
7956563d49ae
Property changes are now completely traceable, whether changes are
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
425
diff
changeset
|
507 # |
|
425
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
508 # Revision 1.23 2001/11/27 03:17:13 richard |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
509 # oops |
|
fc907b6ef135
Property changes are now listed in emails generated by Roundup
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
416
diff
changeset
|
510 # |
| 416 | 511 # Revision 1.22 2001/11/27 03:00:50 richard |
| 512 # couple of bugfixes from latest patch integration | |
| 513 # | |
|
414
fc6d03e9dbc1
couple of bugfixes from latest patch integration
Richard Jones <richard@users.sourceforge.net>
parents:
411
diff
changeset
|
514 # Revision 1.21 2001/11/26 22:55:56 richard |
|
fc6d03e9dbc1
couple of bugfixes from latest patch integration
Richard Jones <richard@users.sourceforge.net>
parents:
411
diff
changeset
|
515 # Feature: |
|
fc6d03e9dbc1
couple of bugfixes from latest patch integration
Richard Jones <richard@users.sourceforge.net>
parents:
411
diff
changeset
|
516 # . Added INSTANCE_NAME to configuration - used in web and email to identify |
|
fc6d03e9dbc1
couple of bugfixes from latest patch integration
Richard Jones <richard@users.sourceforge.net>
parents:
411
diff
changeset
|
517 # the instance. |
|
fc6d03e9dbc1
couple of bugfixes from latest patch integration
Richard Jones <richard@users.sourceforge.net>
parents:
411
diff
changeset
|
518 # . Added EMAIL_SIGNATURE_POSITION to indicate where to place the roundup |
|
fc6d03e9dbc1
couple of bugfixes from latest patch integration
Richard Jones <richard@users.sourceforge.net>
parents:
411
diff
changeset
|
519 # signature info in e-mails. |
|
fc6d03e9dbc1
couple of bugfixes from latest patch integration
Richard Jones <richard@users.sourceforge.net>
parents:
411
diff
changeset
|
520 # . Some more flexibility in the mail gateway and more error handling. |
|
fc6d03e9dbc1
couple of bugfixes from latest patch integration
Richard Jones <richard@users.sourceforge.net>
parents:
411
diff
changeset
|
521 # . Login now takes you to the page you back to the were denied access to. |
|
fc6d03e9dbc1
couple of bugfixes from latest patch integration
Richard Jones <richard@users.sourceforge.net>
parents:
411
diff
changeset
|
522 # |
|
fc6d03e9dbc1
couple of bugfixes from latest patch integration
Richard Jones <richard@users.sourceforge.net>
parents:
411
diff
changeset
|
523 # Fixed: |
|
fc6d03e9dbc1
couple of bugfixes from latest patch integration
Richard Jones <richard@users.sourceforge.net>
parents:
411
diff
changeset
|
524 # . Lots of bugs, thanks Roché and others on the devel mailing list! |
|
fc6d03e9dbc1
couple of bugfixes from latest patch integration
Richard Jones <richard@users.sourceforge.net>
parents:
411
diff
changeset
|
525 # |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
526 # Revision 1.20 2001/11/25 10:11:14 jhermann |
|
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
527 # Typo fix |
|
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
410
diff
changeset
|
528 # |
| 410 | 529 # Revision 1.19 2001/11/22 15:46:42 jhermann |
| 530 # Added module docstrings to all modules. | |
| 531 # | |
|
406
bdc2ea127ae9
Added module docstrings to all modules.
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
393
diff
changeset
|
532 # Revision 1.18 2001/11/15 10:36:17 richard |
|
bdc2ea127ae9
Added module docstrings to all modules.
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
393
diff
changeset
|
533 # . incorporated patch from Roch'e Compaan implementing attachments in nosy |
|
bdc2ea127ae9
Added module docstrings to all modules.
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
393
diff
changeset
|
534 # e-mail |
|
bdc2ea127ae9
Added module docstrings to all modules.
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
393
diff
changeset
|
535 # |
|
393
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
536 # Revision 1.17 2001/11/12 22:01:06 richard |
|
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
537 # Fixed issues with nosy reaction and author copies. |
|
f40388721e40
incorporated patch from Roch'e Compaan implementing attachments in nosy e-mail
Richard Jones <richard@users.sourceforge.net>
parents:
380
diff
changeset
|
538 # |
|
380
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
539 # Revision 1.16 2001/10/30 00:54:45 richard |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
540 # Features: |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
541 # . #467129 ] Lossage when username=e-mail-address |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
542 # . #473123 ] Change message generation for author |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
543 # . MailGW now moves 'resolved' to 'chatting' on receiving e-mail for an issue. |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
337
diff
changeset
|
544 # |
| 337 | 545 # Revision 1.15 2001/10/23 01:00:18 richard |
| 546 # Re-enabled login and registration access after lopping them off via | |
| 547 # disabling access for anonymous users. | |
| 548 # Major re-org of the htmltemplate code, cleaning it up significantly. Fixed | |
| 549 # a couple of bugs while I was there. Probably introduced a couple, but | |
| 550 # things seem to work OK at the moment. | |
| 551 # | |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
313
diff
changeset
|
552 # Revision 1.14 2001/10/21 07:26:35 richard |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
313
diff
changeset
|
553 # feature #473127: Filenames. I modified the file.index and htmltemplate |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
313
diff
changeset
|
554 # source so that the filename is used in the link and the creation |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
313
diff
changeset
|
555 # information is displayed. |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
313
diff
changeset
|
556 # |
|
313
489b70c37f32
feature [SF#473127]: Filenames.
Richard Jones <richard@users.sourceforge.net>
parents:
308
diff
changeset
|
557 # Revision 1.13 2001/10/21 00:45:15 richard |
|
489b70c37f32
feature [SF#473127]: Filenames.
Richard Jones <richard@users.sourceforge.net>
parents:
308
diff
changeset
|
558 # Added author identification to e-mail messages from roundup. |
|
489b70c37f32
feature [SF#473127]: Filenames.
Richard Jones <richard@users.sourceforge.net>
parents:
308
diff
changeset
|
559 # |
|
308
e32af1eff4ea
Added author identification to e-mail messages from roundup.
Richard Jones <richard@users.sourceforge.net>
parents:
263
diff
changeset
|
560 # Revision 1.12 2001/10/04 02:16:15 richard |
|
e32af1eff4ea
Added author identification to e-mail messages from roundup.
Richard Jones <richard@users.sourceforge.net>
parents:
263
diff
changeset
|
561 # Forgot to pass the protected flag down *sigh*. |
|
e32af1eff4ea
Added author identification to e-mail messages from roundup.
Richard Jones <richard@users.sourceforge.net>
parents:
263
diff
changeset
|
562 # |
|
263
e13d55912cd4
Forgot to pass the protected flag down *sigh*.
Richard Jones <richard@users.sourceforge.net>
parents:
262
diff
changeset
|
563 # Revision 1.11 2001/10/04 02:12:42 richard |
|
e13d55912cd4
Forgot to pass the protected flag down *sigh*.
Richard Jones <richard@users.sourceforge.net>
parents:
262
diff
changeset
|
564 # Added nicer command-line item adding: passing no arguments will enter an |
|
e13d55912cd4
Forgot to pass the protected flag down *sigh*.
Richard Jones <richard@users.sourceforge.net>
parents:
262
diff
changeset
|
565 # interactive more which asks for each property in turn. While I was at it, I |
|
e13d55912cd4
Forgot to pass the protected flag down *sigh*.
Richard Jones <richard@users.sourceforge.net>
parents:
262
diff
changeset
|
566 # fixed an implementation problem WRT the spec - I wasn't raising a |
|
e13d55912cd4
Forgot to pass the protected flag down *sigh*.
Richard Jones <richard@users.sourceforge.net>
parents:
262
diff
changeset
|
567 # ValueError if the key property was missing from a create(). Also added a |
|
e13d55912cd4
Forgot to pass the protected flag down *sigh*.
Richard Jones <richard@users.sourceforge.net>
parents:
262
diff
changeset
|
568 # protected=boolean argument to getprops() so we can list only the mutable |
|
e13d55912cd4
Forgot to pass the protected flag down *sigh*.
Richard Jones <richard@users.sourceforge.net>
parents:
262
diff
changeset
|
569 # properties (defaults to yes, which lists the immutables). |
|
e13d55912cd4
Forgot to pass the protected flag down *sigh*.
Richard Jones <richard@users.sourceforge.net>
parents:
262
diff
changeset
|
570 # |
|
262
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
571 # Revision 1.10 2001/08/07 00:24:42 richard |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
572 # stupid typo |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
573 # |
| 214 | 574 # Revision 1.9 2001/08/07 00:15:51 richard |
| 575 # Added the copyright/license notice to (nearly) all files at request of | |
| 576 # Bizar Software. | |
| 577 # | |
|
213
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
188
diff
changeset
|
578 # Revision 1.8 2001/08/02 06:38:17 richard |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
188
diff
changeset
|
579 # Roundupdb now appends "mailing list" information to its messages which |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
188
diff
changeset
|
580 # include the e-mail address and web interface address. Templates may |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
188
diff
changeset
|
581 # override this in their db classes to include specific information (support |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
188
diff
changeset
|
582 # instructions, etc). |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
188
diff
changeset
|
583 # |
|
188
1536be43d2fa
Roundupdb now appends "mailing list" information to its messages...
Richard Jones <richard@users.sourceforge.net>
parents:
156
diff
changeset
|
584 # Revision 1.7 2001/07/30 02:38:31 richard |
|
1536be43d2fa
Roundupdb now appends "mailing list" information to its messages...
Richard Jones <richard@users.sourceforge.net>
parents:
156
diff
changeset
|
585 # get() now has a default arg - for migration only. |
|
1536be43d2fa
Roundupdb now appends "mailing list" information to its messages...
Richard Jones <richard@users.sourceforge.net>
parents:
156
diff
changeset
|
586 # |
|
156
9c5ddad06430
get() now has a default arg - for migration only.
Richard Jones <richard@users.sourceforge.net>
parents:
138
diff
changeset
|
587 # Revision 1.6 2001/07/30 00:05:54 richard |
|
9c5ddad06430
get() now has a default arg - for migration only.
Richard Jones <richard@users.sourceforge.net>
parents:
138
diff
changeset
|
588 # Fixed IssueClass so that superseders links to its classname rather than |
|
9c5ddad06430
get() now has a default arg - for migration only.
Richard Jones <richard@users.sourceforge.net>
parents:
138
diff
changeset
|
589 # hard-coded to "issue". |
|
9c5ddad06430
get() now has a default arg - for migration only.
Richard Jones <richard@users.sourceforge.net>
parents:
138
diff
changeset
|
590 # |
|
138
e012bb958238
Fixed IssueClass so that superseders links to its classname...
Richard Jones <richard@users.sourceforge.net>
parents:
127
diff
changeset
|
591 # Revision 1.5 2001/07/29 07:01:39 richard |
|
e012bb958238
Fixed IssueClass so that superseders links to its classname...
Richard Jones <richard@users.sourceforge.net>
parents:
127
diff
changeset
|
592 # Added vim command to all source so that we don't get no steenkin' tabs :) |
|
e012bb958238
Fixed IssueClass so that superseders links to its classname...
Richard Jones <richard@users.sourceforge.net>
parents:
127
diff
changeset
|
593 # |
|
127
0791d13baea7
Added vim command to all source so that we don't get no steenkin' tabs :)
Richard Jones <richard@users.sourceforge.net>
parents:
118
diff
changeset
|
594 # Revision 1.4 2001/07/29 04:05:37 richard |
|
0791d13baea7
Added vim command to all source so that we don't get no steenkin' tabs :)
Richard Jones <richard@users.sourceforge.net>
parents:
118
diff
changeset
|
595 # Added the fabricated property "id". |
|
0791d13baea7
Added vim command to all source so that we don't get no steenkin' tabs :)
Richard Jones <richard@users.sourceforge.net>
parents:
118
diff
changeset
|
596 # |
|
118
a55c1301ba1f
Added the fabricated property "id".
Richard Jones <richard@users.sourceforge.net>
parents:
44
diff
changeset
|
597 # Revision 1.3 2001/07/23 07:14:41 richard |
|
a55c1301ba1f
Added the fabricated property "id".
Richard Jones <richard@users.sourceforge.net>
parents:
44
diff
changeset
|
598 # Moved the database backends off into backends. |
|
a55c1301ba1f
Added the fabricated property "id".
Richard Jones <richard@users.sourceforge.net>
parents:
44
diff
changeset
|
599 # |
|
44
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
600 # Revision 1.2 2001/07/22 12:09:32 richard |
|
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
601 # Final commit of Grande Splite |
|
c1f3e058c58d
Moved the database backends off into backends.
Richard Jones <richard@users.sourceforge.net>
parents:
26
diff
changeset
|
602 # |
|
26
c7c14960f413
Final commit of Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
25
diff
changeset
|
603 # Revision 1.1 2001/07/22 11:58:35 richard |
|
c7c14960f413
Final commit of Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
25
diff
changeset
|
604 # More Grande Splite |
|
25
4cf1daf2f2eb
More Grande Splite
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
605 # |
|
127
0791d13baea7
Added vim command to all source so that we don't get no steenkin' tabs :)
Richard Jones <richard@users.sourceforge.net>
parents:
118
diff
changeset
|
606 # |
|
0791d13baea7
Added vim command to all source so that we don't get no steenkin' tabs :)
Richard Jones <richard@users.sourceforge.net>
parents:
118
diff
changeset
|
607 # vim: set filetype=python ts=4 sw=4 et si |
