summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 98f86bb)
raw | patch | inline | side by side (parent: 98f86bb)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 10 Dec 2001 00:57:38 +0000 (00:57 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 10 Dec 2001 00:57:38 +0000 (00:57 +0000) |
. Added the "display" command to the admin tool - displays a node's values
. #489760 ] [issue] only subject
. fixed the doc/index.html to include the quoting in the mail alias.
Also:
. fixed roundup-admin so it works with transactions
. disabled the back_anydbm module if anydbm tries to use dumbdbm
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@450 57a73879-2fb5-44c3-a270-3262357dd7e2
. #489760 ] [issue] only subject
. fixed the doc/index.html to include the quoting in the mail alias.
Also:
. fixed roundup-admin so it works with transactions
. disabled the back_anydbm module if anydbm tries to use dumbdbm
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@450 57a73879-2fb5-44c3-a270-3262357dd7e2
diff --git a/CHANGES.txt b/CHANGES.txt
index bd0eb609b768664a3c56d510c7c2dde59071c0a1..50ea6fa29d7c8a85be05b4b46eed47224990ff4d 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
. We now have basic transaction support. Information is only written to
the database when the commit() method is called. Only the anydbm backend
is modified in this way - neither of the bsddb backends have been.
+ - the CGI and mailgw automatically commit() at the end of processing a
+ single transaction
+ - the admin tool requires an explicit "commit" - it will prompt at exit
+ if there are unsaved changes. A "rollback" removes all changes made
+ during the session (up to the last commit).
+ . Added the "display" command to the admin tool - displays a node's values
Fixed:
the close() method on the database is no longer needed.
. #487480 ] roundup-server
. #487476 ] INSTALL.txt
+ . #489760 ] [issue] only subject
+ . fixed doc/index.html to include the quoting in the mail alias.
2001-11-23 - 0.3.0
diff --git a/INSTALL.txt b/INSTALL.txt
index 272f94ef0e21221c61b51608e4210021ff2fa415..2b4783c9122bceec07a2c87325e09de83073b08e 100644 (file)
--- a/INSTALL.txt
+++ b/INSTALL.txt
In some installations (e.g. RedHat 6.2 I think) you'll need to set up smrsh
so sendmail will accept the pipe command. In that case, symlink
/etc/smrsh/roundup-mailgw to /usr/local/bin/roundup-mailgw and change the
-command to:
+command to (include the quote marks):
"|roundup-mailgw <instance_home>"
To test the mail gateway on unix systems, try:
diff --git a/doc/index.html b/doc/index.html
index 1f0712e1b62898f0fb438b7ffb62d8e968c434fd..342e02d10658b1f149e5cdfb449463351030cecf 100644 (file)
--- a/doc/index.html
+++ b/doc/index.html
<h2><a name="startweb">E-Mail Interface</a></h2>
<h3>Setup 1: As a mail alias pipe process</h3>
-Set up a mail alias called "issue_tracker" as:
+Set up a mail alias called "issue_tracker" as (include the quote marks):
<blockquote>
- <tt>|/usr/bin/python /usr/local/bin/roundup-mailgw
- <instance_home></tt>
+ <tt>"|/usr/bin/python /usr/local/bin/roundup-mailgw <instance_home>"</tt>
</blockquote>
In some installations (e.g. RedHat 6.2 I think) you'll need to set up smrsh
<p> </p>
<hr>
-$Id: index.html,v 1.19 2001-11-21 23:42:54 richard Exp $
+$Id: index.html,v 1.20 2001-12-10 00:57:38 richard Exp $
<p> </p>
</body></html>
diff --git a/roundup-admin b/roundup-admin
index 948c5663f4d684e110f8d15b6739e30fc17055cb..b9cdc9f9a0267eddbd22a7e84ac8e913a910f250 100755 (executable)
--- a/roundup-admin
+++ b/roundup-admin
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: roundup-admin,v 1.50 2001-12-02 05:06:16 richard Exp $
+# $Id: roundup-admin,v 1.51 2001-12-10 00:57:38 richard Exp $
import sys
if not hasattr(sys, 'version_info') or sys.version_info[:2] < (2,1):
for k in AdminTool.__dict__.keys():
if k[:5] == 'help_':
self.help[k[5:]] = getattr(self, k)
+ self.instance_home = ''
self.db = None
def usage(self, message=''):
See also initopts help.
'''
+ if len(args) < 1:
+ raise UsageError, 'Not enough arguments supplied'
# select template
import roundup.templates
templates = roundup.templates.listTemplates()
Retrieves the property value of the nodes specified by the designators.
'''
+ if len(args) < 2:
+ raise UsageError, 'Not enough arguments supplied'
propname = args[0]
designators = string.split(args[1], ',')
l = []
Sets the property to the value for all designators given.
'''
+ if len(args) < 2:
+ raise UsageError, 'Not enough arguments supplied'
from roundup import hyperdb
designators = string.split(args[0], ',')
Find the nodes of the given class with a given link property value. The
value may be either the nodeid of the linked node, or its key value.
'''
+ if len(args) < 1:
+ raise UsageError, 'Not enough arguments supplied'
classname = args[0]
# get the class
try:
This lists the properties for a given class.
'''
+ if len(args) < 1:
+ raise UsageError, 'Not enough arguments supplied'
classname = args[0]
# get the class
try:
else:
print '%s: %s'%(key, value)
+ def do_display(self, args):
+ '''Usage: display designator
+ Show the property values for the given node.
+
+ This lists the properties and their associated values for the given
+ node.
+ '''
+ if len(args) < 1:
+ raise UsageError, 'Not enough arguments supplied'
+
+ # decode the node designator
+ try:
+ classname, nodeid = roundupdb.splitDesignator(args[0])
+ except roundupdb.DesignatorError, message:
+ raise UsageError, message
+
+ # get the class
+ try:
+ cl = self.db.getclass(classname)
+ except KeyError:
+ raise UsageError, 'invalid class "%s"'%classname
+
+ # display the values
+ for key in cl.properties.keys():
+ value = cl.get(nodeid, key)
+ print '%s: %s'%(key, value)
+
def do_create(self, args):
'''Usage: create classname property=value ...
Create a new entry of a given class.
name=value arguments provided on the command line after the "create"
command.
'''
+ if len(args) < 1:
+ raise UsageError, 'Not enough arguments supplied'
from roundup import hyperdb
classname = args[0]
in order: the key, "name", "title" and then the first property,
alphabetically.
'''
+ if len(args) < 1:
+ raise UsageError, 'Not enough arguments supplied'
classname = args[0]
# get the class
3 usability
4 feature
'''
+ if len(args) < 1:
+ raise UsageError, 'Not enough arguments supplied'
classname = args[0]
# get the class
Lists the journal entries for the node identified by the designator.
'''
+ if len(args) < 1:
+ raise UsageError, 'Not enough arguments supplied'
try:
classname, nodeid = roundupdb.splitDesignator(args[0])
except roundupdb.DesignatorError, message:
manually. This command undoes all those changes, so a commit
immediately after would make no changes to the database.
'''
- self.db.commit()
+ self.db.rollback()
return 0
def do_retire(self, args):
This action indicates that a particular node is not to be retrieved by
the list or find commands, and its key value may be re-used.
'''
+ if len(args) < 1:
+ raise UsageError, 'Not enough arguments supplied'
designators = string.split(args[0], ',')
for designator in designators:
try:
directory. The journals are not exported.
'''
if len(args) < 2:
- print do_export.__doc__
- return 1
+ raise UsageError, 'Not enough arguments supplied'
classes = string.split(args[0], ',')
dir = args[1]
try:
instance = roundup.instance.open(self.instance_home)
except ValueError, message:
+ self.instance_home = ''
print "Couldn't open instance: %s"%message
return 1
- self.db = instance.open('admin')
- if len(args) < 2:
- print function.__doc__
- return 1
+ # only open the database once!
+ if not self.db:
+ self.db = instance.open('admin')
# do the command
ret = 0
try:
command = raw_input('roundup> ')
except EOFError:
- print '.. exit'
- return 0
+ print 'exit...'
+ break
+ if not command: continue
args = ws_re.split(command)
if not args: continue
- if args[0] in ('quit', 'exit'): return 0
+ if args[0] in ('quit', 'exit'): break
self.run_command(args)
+ # exit.. check for transactions
+ if self.db and self.db.transactions:
+ commit = raw_input("There are unsaved changes. Commit them (y/N)? ")
+ if commit[0].lower() == 'y':
+ self.db.commit()
+ return 0
+
def main(self):
try:
opts, args = getopt.getopt(sys.argv[1:], 'i:u:hc')
#
# $Log: not supported by cvs2svn $
+# Revision 1.50 2001/12/02 05:06:16 richard
+# . We now use weakrefs in the Classes to keep the database reference, so
+# the close() method on the database is no longer needed.
+# I bumped the minimum python requirement up to 2.1 accordingly.
+# . #487480 ] roundup-server
+# . #487476 ] INSTALL.txt
+#
+# I also cleaned up the change message / post-edit stuff in the cgi client.
+# There's now a clearly marked "TODO: append the change note" where I believe
+# the change note should be added there. The "changes" list will obviously
+# have to be modified to be a dict of the changes, or somesuch.
+#
+# More testing needed.
+#
# Revision 1.49 2001/12/01 07:17:50 richard
# . We now have basic transaction support! Information is only written to
# the database when the commit() method is called. Only the anydbm
index ca6856969189492e19b89cc6302be65277161f84..cb01a567c64ebf2b2bf50060a47c1ca52e9d1cbe 100644 (file)
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: __init__.py,v 1.6 2001-08-07 00:24:42 richard Exp $
+# $Id: __init__.py,v 1.7 2001-12-10 00:57:38 richard Exp $
__all__ = []
try:
+ import anydbm, dumbdbm
+ # dumbdbm in python 2,2b2, 2.1.1 and earlier is seriously broken
+ assert anydbm._defaultmod != dumbdbm
+ del anydbm
+ del dumbdbm
import back_anydbm
anydbm = back_anydbm
del back_anydbm
#
# $Log: not supported by cvs2svn $
+# Revision 1.6 2001/08/07 00:24:42 richard
+# stupid typo
+#
# Revision 1.5 2001/08/07 00:15:51 richard
# Added the copyright/license notice to (nearly) all files at request of
# Bizar Software.
diff --git a/roundup/mailgw.py b/roundup/mailgw.py
index 54de2499c4e4854bdf422f1595068caa2c5ab3ee..1f0a48ab6984585f1c4ef30bc690eb3eea7a8a25 100644 (file)
--- a/roundup/mailgw.py
+++ b/roundup/mailgw.py
an exception, the original message is bounced back to the sender with the
explanatory message given in the exception.
-$Id: mailgw.py,v 1.40 2001-12-05 14:26:44 rochecompaan Exp $
+$Id: mailgw.py,v 1.41 2001-12-10 00:57:38 richard Exp $
'''
previous subject title intact so I can match that.
Subject was: "%s"
-'''%(classname, subject)
+'''%subject
# extract the args
subject_args = m.group('args')
#
# $Log: not supported by cvs2svn $
+# Revision 1.40 2001/12/05 14:26:44 rochecompaan
+# Removed generation of change note from "sendmessage" in roundupdb.py.
+# The change note is now generated when the message is created.
+#
# Revision 1.39 2001/12/02 05:06:16 richard
# . We now use weakrefs in the Classes to keep the database reference, so
# the close() method on the database is no longer needed.