summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 384a4d0)
raw | patch | inline | side by side (parent: 384a4d0)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 11 Oct 2001 23:43:04 +0000 (23:43 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 11 Oct 2001 23:43:04 +0000 (23:43 +0000) |
Fixed a typo (more of a vim-o actually :) in mailgw.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@297 57a73879-2fb5-44c3-a270-3262357dd7e2
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@297 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup-admin | patch | blob | history | |
roundup/mailgw.py | patch | blob | history |
diff --git a/roundup-admin b/roundup-admin
index 2ee3c6e5c6c5788f7d4155b30bacea7e60663140..ee9942c523010dc291cda586c4bf83b6ac6a116a 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.26 2001-10-11 05:03:51 richard Exp $
+# $Id: roundup-admin,v 1.27 2001-10-11 23:43:04 richard Exp $
import sys
if int(sys.version[0]) < 2:
print '%s:'%name
print ' ',command.__doc__
-def do_init(instance_home, args):
+def do_init(instance_home, args, comma_sep=0):
'''Usage: init [template [backend [admin password]]]
Initialise a new Roundup instance.
return 0
-def do_get(db, args):
+def do_get(db, args, comma_sep=0):
'''Usage: get property designator[,designator]*
Get the given property of one or more designator(s).
'''
propname = args[0]
designators = string.split(args[1], ',')
- # TODO: handle the -c option
+ l = []
for designator in designators:
classname, nodeid = roundupdb.splitDesignator(designator)
- print db.getclass(classname).get(nodeid, propname)
+ if comma_sep:
+ l.append(db.getclass(classname).get(nodeid, propname))
+ else:
+ print db.getclass(classname).get(nodeid, propname)
+ if comma_sep:
+ print ','.join(l)
return 0
-def do_set(db, args):
+def do_set(db, args, comma_sep=0):
'''Usage: set designator[,designator]* propname=value ...
Set the given property of one or more designator(s).
apply(cl.set, (nodeid, ), props)
return 0
-def do_find(db, args):
+def do_find(db, args, comma_sep=0):
'''Usage: find classname propname=value ...
Find the nodes of the given class with a given property value.
# look up the linked-to class and get the nodeid that has the value
propname, value = args[1].split('=')
num_re = re.compile('^\d+$')
- if num_re.match(value):
- nodeid = value
- else:
+ if not num_re.match(value):
propcl = cl.properties[propname].classname
propcl = db.getclass(propcl)
- nodeid = propcl.lookup(value)
+ value = propcl.lookup(value)
# now do the find
- # TODO: handle the -c option
- print cl.find(**{propname: nodeid})
+ if comma_sep:
+ print ','.join(cl.find(**{propname: value}))
+ else:
+ print cl.find(**{propname: value})
return 0
-def do_spec(db, args):
+def do_spec(db, args, comma_sep=0):
'''Usage: spec classname
Show the properties for a classname.
else:
print '%s: %s'%(key, value)
-def do_create(db, args):
+def do_create(db, args, comma_sep=0):
'''Usage: create classname property=value ...
Create a new entry of a given class.
return 0
-def do_list(db, args):
+def do_list(db, args, comma_sep=0):
'''Usage: list classname [property]
List the instances of a class.
key = args[1]
else:
key = cl.labelprop()
- # TODO: handle the -c option
- for nodeid in cl.list():
- value = cl.get(nodeid, key)
- print "%4s: %s"%(nodeid, value)
+ if comma_sep:
+ print ','.join(cl.list())
+ else:
+ for nodeid in cl.list():
+ value = cl.get(nodeid, key)
+ print "%4s: %s"%(nodeid, value)
return 0
-def do_history(db, args):
+def do_history(db, args, comma_sep=0):
'''Usage: history designator
Show the history entries of a designator.
Lists the journal entries for the node identified by the designator.
'''
classname, nodeid = roundupdb.splitDesignator(args[0])
- # TODO: handle the -c option
+ # TODO: handle the -c option?
print db.getclass(classname).history(nodeid)
return 0
-def do_retire(db, args):
+def do_retire(db, args, comma_sep=0):
'''Usage: retire designator[,designator]*
Retire the node specified by designator.
db.getclass(classname).retire(nodeid)
return 0
-def do_export(db, args):
+def do_export(db, args, comma_sep=0):
'''Usage: export class[,class] destination_dir
** EXPERIMENTAL **
Export the database to CSV files by class in the given directory.
f.write(','.join(l) + '\n')
return 0
-def do_import(db, args):
+def do_import(db, args, comma_sep=0):
'''Usage: import class file
** EXPERIMENTAL **
Import the contents of the CSV file as new nodes for the given class.
apply(cl.create, (), d)
return 0
-def do_freshen(db, args):
+def do_freshen(db, args, comma_sep=0):
'''Usage: freshen
Freshen an existing instance. **DO NOT USE**
# do the command
try:
- return function(db, args[1:])
+ return function(db, args[1:], comma_sep=comma_sep)
finally:
db.close()
#
# $Log: not supported by cvs2svn $
+# Revision 1.26 2001/10/11 05:03:51 richard
+# Marked the roundup-admin import/export as experimental since they're not fully
+# operational.
+#
# Revision 1.25 2001/10/10 04:12:32 richard
# The setup.cfg file is just causing pain. Away it goes.
#
diff --git a/roundup/mailgw.py b/roundup/mailgw.py
index 74c30ab12d16d81d2e459328b5d86ba603bb03cb..702fd559de9ebf610c6ce2eb1bebdb0f7e0ab384 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.18 2001-10-11 06:38:57 richard Exp $
+$Id: mailgw.py,v 1.19 2001-10-11 23:43:04 richard Exp $
'''
args = m.group('args')
if args:
for prop in string.split(args, ';'):
- Try:
+ try:
key, value = prop.split('=')
except ValueError, message:
raise MailUsageError, '''
#
# $Log: not supported by cvs2svn $
+# Revision 1.18 2001/10/11 06:38:57 richard
+# Initial cut at trying to handle people responding to CC'ed messages that
+# create an issue.
+#
# Revision 1.17 2001/10/09 07:25:59 richard
# Added the Password property type. See "pydoc roundup.password" for
# implementation details. Have updated some of the documentation too.