Mercurial > p > roundup > code
comparison roundup-admin @ 445:208697858c8b
Message author's name appears in From: instead of roundup instance name
(which still appears in the Reply-To:)
envelope-from is now set to the roundup-admin and not roundup itself so
delivery reports aren't sent to roundup (thanks Patrick Ohly)
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Wed, 12 Dec 2001 21:47:45 +0000 |
| parents | 9d97c1a4ddad |
| children | 141aacfdb34f |
comparison
equal
deleted
inserted
replaced
| 444:3fa2268041a8 | 445:208697858c8b |
|---|---|
| 14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" | 15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" |
| 16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, | 16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
| 17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 18 # | 18 # |
| 19 # $Id: roundup-admin,v 1.51 2001-12-10 00:57:38 richard Exp $ | 19 # $Id: roundup-admin,v 1.52 2001-12-12 21:47:45 richard Exp $ |
| 20 | 20 |
| 21 import sys | 21 import sys |
| 22 if not hasattr(sys, 'version_info') or sys.version_info[:2] < (2,1): | 22 if not hasattr(sys, 'version_info') or sys.version_info[:2] < (2,1): |
| 23 print 'Roundup requires python 2.1 or later.' | 23 print 'Roundup requires python 2.1 or later.' |
| 24 sys.exit(1) | 24 sys.exit(1) |
| 601 raise UsageError, 'invalid class "%s"'%classname | 601 raise UsageError, 'invalid class "%s"'%classname |
| 602 | 602 |
| 603 # figure the property names to display | 603 # figure the property names to display |
| 604 if len(args) > 1: | 604 if len(args) > 1: |
| 605 prop_names = args[1].split(',') | 605 prop_names = args[1].split(',') |
| 606 all_props = cl.getprops() | |
| 607 for prop_name in prop_names: | |
| 608 if not all_props.has_key(prop_name): | |
| 609 raise UsageError, '%s has no property "%s"'%(classname, | |
| 610 prop_name) | |
| 606 else: | 611 else: |
| 607 prop_names = cl.getprops().keys() | 612 prop_names = cl.getprops().keys() |
| 608 | 613 |
| 609 # now figure column widths | 614 # now figure column widths |
| 610 props = [] | 615 props = [] |
| 627 for name, width in props: | 632 for name, width in props: |
| 628 if name != 'id': | 633 if name != 'id': |
| 629 try: | 634 try: |
| 630 value = str(cl.get(nodeid, name)) | 635 value = str(cl.get(nodeid, name)) |
| 631 except KeyError: | 636 except KeyError: |
| 632 raise UsageError, '%s has no property "%s"'%(classname, | 637 # we already checked if the property is valid - a |
| 633 name) | 638 # KeyError here means the node just doesn't have a |
| 639 # value for it | |
| 640 value = '' | |
| 634 else: | 641 else: |
| 635 value = str(nodeid) | 642 value = str(nodeid) |
| 636 f = '%%-%ds'%width | 643 f = '%%-%ds'%width |
| 637 l.append(f%value[:width]) | 644 l.append(f%value[:width]) |
| 638 print ' '.join(l) | 645 print ' '.join(l) |
| 971 tool = AdminTool() | 978 tool = AdminTool() |
| 972 sys.exit(tool.main()) | 979 sys.exit(tool.main()) |
| 973 | 980 |
| 974 # | 981 # |
| 975 # $Log: not supported by cvs2svn $ | 982 # $Log: not supported by cvs2svn $ |
| 983 # Revision 1.51 2001/12/10 00:57:38 richard | |
| 984 # From CHANGES: | |
| 985 # . Added the "display" command to the admin tool - displays a node's values | |
| 986 # . #489760 ] [issue] only subject | |
| 987 # . fixed the doc/index.html to include the quoting in the mail alias. | |
| 988 # | |
| 989 # Also: | |
| 990 # . fixed roundup-admin so it works with transactions | |
| 991 # . disabled the back_anydbm module if anydbm tries to use dumbdbm | |
| 992 # | |
| 976 # Revision 1.50 2001/12/02 05:06:16 richard | 993 # Revision 1.50 2001/12/02 05:06:16 richard |
| 977 # . We now use weakrefs in the Classes to keep the database reference, so | 994 # . We now use weakrefs in the Classes to keep the database reference, so |
| 978 # the close() method on the database is no longer needed. | 995 # the close() method on the database is no longer needed. |
| 979 # I bumped the minimum python requirement up to 2.1 accordingly. | 996 # I bumped the minimum python requirement up to 2.1 accordingly. |
| 980 # . #487480 ] roundup-server | 997 # . #487480 ] roundup-server |
