Mercurial > p > roundup > code
annotate roundup-admin @ 274:79226fbb7741
Spit out command help if roundup-admin command doesn't get an argument.
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Tue, 09 Oct 2001 23:36:25 +0000 |
| parents | a4241ddd22d7 |
| children | a5dabf2430c5 |
| rev | line source |
|---|---|
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1 #! /usr/bin/python |
|
213
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
204
diff
changeset
|
2 # |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
204
diff
changeset
|
3 # 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:
204
diff
changeset
|
4 # 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:
204
diff
changeset
|
5 # 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:
204
diff
changeset
|
6 # disclaimer are retained in their original form. |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
204
diff
changeset
|
7 # |
| 214 | 8 # 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:
204
diff
changeset
|
9 # 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:
204
diff
changeset
|
10 # 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:
204
diff
changeset
|
11 # POSSIBILITY OF SUCH DAMAGE. |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
204
diff
changeset
|
12 # |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
204
diff
changeset
|
13 # 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:
204
diff
changeset
|
14 # 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:
204
diff
changeset
|
15 # 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:
204
diff
changeset
|
16 # 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:
204
diff
changeset
|
17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
204
diff
changeset
|
18 # |
|
274
79226fbb7741
Spit out command help if roundup-admin command doesn't get an argument.
Richard Jones <richard@users.sourceforge.net>
parents:
270
diff
changeset
|
19 # $Id: roundup-admin,v 1.23 2001-10-09 23:36:25 richard Exp $ |
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
20 |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
21 import sys |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
22 if int(sys.version[0]) < 2: |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
23 print 'Roundup requires python 2.0 or later.' |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
24 sys.exit(1) |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
25 |
|
204
c1461733cbf9
Instances are now opened by a special function...
Richard Jones <richard@users.sourceforge.net>
parents:
193
diff
changeset
|
26 import string, os, getpass, getopt, re |
|
270
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
27 from roundup import date, roundupdb, init, password |
|
204
c1461733cbf9
Instances are now opened by a special function...
Richard Jones <richard@users.sourceforge.net>
parents:
193
diff
changeset
|
28 import roundup.instance |
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
29 |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
30 def usage(message=''): |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
31 if message: message = 'Problem: '+message+'\n' |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
32 commands = [] |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
33 for command in figureCommands().values(): |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
34 h = command.__doc__.split('\n')[0] |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
35 commands.append(h[7:]) |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
36 commands.sort() |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
37 print '''%sUsage: roundup-admin [-i instance home] [-u login] [-c] <command> <arguments> |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
38 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
39 Commands: |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
40 %s |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
41 Help: |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
42 roundup-admin -h |
|
248
96cdd8ef0581
Added some more help to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
235
diff
changeset
|
43 roundup-admin help -- this help |
|
96cdd8ef0581
Added some more help to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
235
diff
changeset
|
44 roundup-admin help <command> -- command-specific help |
|
96cdd8ef0581
Added some more help to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
235
diff
changeset
|
45 roundup-admin morehelp -- even more detailed help |
|
96cdd8ef0581
Added some more help to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
235
diff
changeset
|
46 Options: |
|
96cdd8ef0581
Added some more help to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
235
diff
changeset
|
47 -i instance home -- specify the issue tracker "home directory" to administer |
|
96cdd8ef0581
Added some more help to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
235
diff
changeset
|
48 -u -- the user[:password] to use for commands |
|
96cdd8ef0581
Added some more help to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
235
diff
changeset
|
49 -c -- when outputting lists of data, just comma-separate them'''%( |
|
96cdd8ef0581
Added some more help to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
235
diff
changeset
|
50 message, '\n '.join(commands)) |
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
51 |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
52 def moreusage(message=''): |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
53 usage(message) |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
54 print ''' |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
55 All commands (except help) require an instance specifier. This is just the path |
|
248
96cdd8ef0581
Added some more help to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
235
diff
changeset
|
56 to the roundup instance you're working with. A roundup instance is where |
|
96cdd8ef0581
Added some more help to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
235
diff
changeset
|
57 roundup keeps the database and configuration file that defines an issue |
|
96cdd8ef0581
Added some more help to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
235
diff
changeset
|
58 tracker. It may be thought of as the issue tracker's "home directory". It may |
|
96cdd8ef0581
Added some more help to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
235
diff
changeset
|
59 be specified in the environment variable ROUNDUP_INSTANCE or on the command |
|
96cdd8ef0581
Added some more help to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
235
diff
changeset
|
60 line as "-i instance". |
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
61 |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
62 A designator is a classname and a nodeid concatenated, eg. bug1, user10, ... |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
63 |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
64 Property values are represented as strings in command arguments and in the |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
65 printed results: |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
66 . Strings are, well, strings. |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
67 . Date values are printed in the full date format in the local time zone, and |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
68 accepted in the full format or any of the partial formats explained below. |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
69 . Link values are printed as node designators. When given as an argument, |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
70 node designators and key strings are both accepted. |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
71 . Multilink values are printed as lists of node designators joined by commas. |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
72 When given as an argument, node designators and key strings are both |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
73 accepted; an empty string, a single node, or a list of nodes joined by |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
74 commas is accepted. |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
75 |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
76 When multiple nodes are specified to the roundup get or roundup set |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
77 commands, the specified properties are retrieved or set on all the listed |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
78 nodes. |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
79 |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
80 When multiple results are returned by the roundup get or roundup find |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
81 commands, they are printed one per line (default) or joined by commas (with |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
82 the -c) option. |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
83 |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
84 Where the command changes data, a login name/password is required. The |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
85 login may be specified as either "name" or "name:password". |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
86 . ROUNDUP_LOGIN environment variable |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
87 . the -u command-line option |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
88 If either the name or password is not supplied, they are obtained from the |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
89 command-line. |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
90 |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
91 Date format examples: |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
92 "2000-04-17.03:45" means <Date 2000-04-17.08:45:00> |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
93 "2000-04-17" means <Date 2000-04-17.00:00:00> |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
94 "01-25" means <Date yyyy-01-25.00:00:00> |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
95 "08-13.22:13" means <Date yyyy-08-14.03:13:00> |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
96 "11-07.09:32:43" means <Date yyyy-11-07.14:32:43> |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
97 "14:25" means <Date yyyy-mm-dd.19:25:00> |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
98 "8:47:11" means <Date yyyy-mm-dd.13:47:11> |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
99 "." means "right now" |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
100 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
101 Command help: |
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
102 ''' |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
103 for name, command in figureCommands().items(): |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
104 print '%s:'%name |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
105 print ' ',command.__doc__ |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
106 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
107 def do_init(instance_home, args): |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
108 '''Usage: init [template [backend [admin password]]] |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
109 Initialise a new Roundup instance. |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
110 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
111 The command will prompt for the instance home directory (if not supplied |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
112 through INSTANCE_HOME or the -i option. The template, backend and admin |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
113 password may be specified on the command-line as arguments, in that order. |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
114 ''' |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
115 # select template |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
116 import roundup.templates |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
117 templates = roundup.templates.listTemplates() |
| 147 | 118 template = len(args) > 1 and args[1] or '' |
| 119 if template not in templates: | |
| 120 print 'Templates:', ', '.join(templates) | |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
121 while template not in templates: |
|
264
a671e5917b33
Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
262
diff
changeset
|
122 template = raw_input('Select template [extended]: ').strip() |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
123 if not template: |
|
264
a671e5917b33
Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
262
diff
changeset
|
124 template = 'extended' |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
125 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
126 import roundup.backends |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
127 backends = roundup.backends.__all__ |
| 147 | 128 backend = len(args) > 2 and args[2] or '' |
| 129 if backend not in backends: | |
| 130 print 'Back ends:', ', '.join(backends) | |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
131 while backend not in backends: |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
132 backend = raw_input('Select backend [anydbm]: ').strip() |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
133 if not backend: |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
134 backend = 'anydbm' |
| 147 | 135 if len(args) > 3: |
| 136 adminpw = confirm = args[3] | |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
137 else: |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
138 adminpw = '' |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
139 confirm = 'x' |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
140 while adminpw != confirm: |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
141 adminpw = getpass.getpass('Admin Password: ') |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
142 confirm = getpass.getpass(' Confirm: ') |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
143 init.init(instance_home, template, backend, adminpw) |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
144 return 0 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
145 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
146 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
147 def do_get(db, args): |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
148 '''Usage: get property designator[,designator]* |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
149 Get the given property of one or more designator(s). |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
150 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
151 Retrieves the property value of the nodes specified by the designators. |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
152 ''' |
|
261
0ca5381a72b5
made do_get have the args in the correct order
Richard Jones <richard@users.sourceforge.net>
parents:
248
diff
changeset
|
153 propname = args[0] |
|
0ca5381a72b5
made do_get have the args in the correct order
Richard Jones <richard@users.sourceforge.net>
parents:
248
diff
changeset
|
154 designators = string.split(args[1], ',') |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
155 # TODO: handle the -c option |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
156 for designator in designators: |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
157 classname, nodeid = roundupdb.splitDesignator(designator) |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
158 print db.getclass(classname).get(nodeid, propname) |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
159 return 0 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
160 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
161 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
162 def do_set(db, args): |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
163 '''Usage: set designator[,designator]* propname=value ... |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
164 Set the given property of one or more designator(s). |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
165 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
166 Sets the property to the value for all designators given. |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
167 ''' |
|
235
d7d358408537
added missing 'import' statements.
Anthony Baxter <anthonybaxter@users.sourceforge.net>
parents:
224
diff
changeset
|
168 from roundup import hyperdb |
|
d7d358408537
added missing 'import' statements.
Anthony Baxter <anthonybaxter@users.sourceforge.net>
parents:
224
diff
changeset
|
169 |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
170 designators = string.split(args[0], ',') |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
171 props = {} |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
172 for prop in args[1:]: |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
173 key, value = prop.split('=') |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
174 props[key] = value |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
175 for designator in designators: |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
176 classname, nodeid = roundupdb.splitDesignator(designator) |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
177 cl = db.getclass(classname) |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
178 properties = cl.getprops() |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
179 for key, value in props.items(): |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
180 type = properties[key] |
|
224
ad2c98faec97
using isinstance(blah, Foo) now instead of isFooType
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
181 if isinstance(type, hyperdb.String): |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
182 continue |
|
270
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
183 elif isinstance(type, hyperdb.Password): |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
184 props[key] = password.Password(value) |
|
224
ad2c98faec97
using isinstance(blah, Foo) now instead of isFooType
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
185 elif isinstance(type, hyperdb.Date): |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
186 props[key] = date.Date(value) |
|
224
ad2c98faec97
using isinstance(blah, Foo) now instead of isFooType
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
187 elif isinstance(type, hyperdb.Interval): |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
188 props[key] = date.Interval(value) |
|
224
ad2c98faec97
using isinstance(blah, Foo) now instead of isFooType
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
189 elif isinstance(type, hyperdb.Link): |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
190 props[key] = value |
|
224
ad2c98faec97
using isinstance(blah, Foo) now instead of isFooType
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
191 elif isinstance(type, hyperdb.Multilink): |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
192 props[key] = value.split(',') |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
193 apply(cl.set, (nodeid, ), props) |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
194 return 0 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
195 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
196 def do_find(db, args): |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
197 '''Usage: find classname propname=value ... |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
198 Find the nodes of the given class with a given property value. |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
199 |
|
167
a49c8a2ddd26
Added time logging and file uploading to the templates.
Richard Jones <richard@users.sourceforge.net>
parents:
160
diff
changeset
|
200 Find the nodes of the given class with a given property value. The |
|
a49c8a2ddd26
Added time logging and file uploading to the templates.
Richard Jones <richard@users.sourceforge.net>
parents:
160
diff
changeset
|
201 value may be either the nodeid of the linked node, or its key value. |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
202 ''' |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
203 classname = args[0] |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
204 cl = db.getclass(classname) |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
205 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
206 # look up the linked-to class and get the nodeid that has the value |
|
167
a49c8a2ddd26
Added time logging and file uploading to the templates.
Richard Jones <richard@users.sourceforge.net>
parents:
160
diff
changeset
|
207 propname, value = args[1].split('=') |
|
a49c8a2ddd26
Added time logging and file uploading to the templates.
Richard Jones <richard@users.sourceforge.net>
parents:
160
diff
changeset
|
208 num_re = re.compile('^\d+$') |
|
a49c8a2ddd26
Added time logging and file uploading to the templates.
Richard Jones <richard@users.sourceforge.net>
parents:
160
diff
changeset
|
209 if num_re.match(value): |
|
a49c8a2ddd26
Added time logging and file uploading to the templates.
Richard Jones <richard@users.sourceforge.net>
parents:
160
diff
changeset
|
210 nodeid = value |
|
a49c8a2ddd26
Added time logging and file uploading to the templates.
Richard Jones <richard@users.sourceforge.net>
parents:
160
diff
changeset
|
211 else: |
|
a49c8a2ddd26
Added time logging and file uploading to the templates.
Richard Jones <richard@users.sourceforge.net>
parents:
160
diff
changeset
|
212 propcl = cl.properties[propname].classname |
|
a49c8a2ddd26
Added time logging and file uploading to the templates.
Richard Jones <richard@users.sourceforge.net>
parents:
160
diff
changeset
|
213 propcl = db.getclass(propcl) |
|
a49c8a2ddd26
Added time logging and file uploading to the templates.
Richard Jones <richard@users.sourceforge.net>
parents:
160
diff
changeset
|
214 nodeid = propcl.lookup(value) |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
215 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
216 # now do the find |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
217 # TODO: handle the -c option |
|
167
a49c8a2ddd26
Added time logging and file uploading to the templates.
Richard Jones <richard@users.sourceforge.net>
parents:
160
diff
changeset
|
218 print cl.find(**{propname: nodeid}) |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
219 return 0 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
220 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
221 def do_spec(db, args): |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
222 '''Usage: spec classname |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
223 Show the properties for a classname. |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
224 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
225 This lists the properties for a given class. |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
226 ''' |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
227 classname = args[0] |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
228 cl = db.getclass(classname) |
|
262
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
229 keyprop = cl.getkey() |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
230 for key, value in cl.properties.items(): |
|
262
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
231 if keyprop == key: |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
232 print '%s: %s (key property)'%(key, value) |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
233 else: |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
234 print '%s: %s'%(key, value) |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
235 |
|
262
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
236 def do_create(db, args, pretty_re=re.compile(r'<roundup\.hyperdb\.(.*)>')): |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
237 '''Usage: create classname property=value ... |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
238 Create a new entry of a given class. |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
239 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
240 This creates a new entry of the given class using the property |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
241 name=value arguments provided on the command line after the "create" |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
242 command. |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
243 ''' |
|
235
d7d358408537
added missing 'import' statements.
Anthony Baxter <anthonybaxter@users.sourceforge.net>
parents:
224
diff
changeset
|
244 from roundup import hyperdb |
|
d7d358408537
added missing 'import' statements.
Anthony Baxter <anthonybaxter@users.sourceforge.net>
parents:
224
diff
changeset
|
245 |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
246 classname = args[0] |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
247 cl = db.getclass(classname) |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
248 props = {} |
|
262
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
249 properties = cl.getprops(protected = 0) |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
250 if len(args) == 1: |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
251 # ask for the properties |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
252 for key, value in properties.items(): |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
253 if key == 'id': continue |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
254 m = pretty_re.match(str(value)) |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
255 if m: |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
256 value = m.group(1) |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
257 value = raw_input('%s (%s): '%(key.capitalize(), value)) |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
258 if value: |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
259 props[key] = value |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
260 else: |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
261 # use the args |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
262 for prop in args[1:]: |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
263 key, value = prop.split('=') |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
264 props[key] = value |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
265 |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
266 # convert types |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
267 for key in props.keys(): |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
268 type = properties[key] |
|
262
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
269 if isinstance(type, hyperdb.Date): |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
270 props[key] = date.Date(value) |
|
224
ad2c98faec97
using isinstance(blah, Foo) now instead of isFooType
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
271 elif isinstance(type, hyperdb.Interval): |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
272 props[key] = date.Interval(value) |
|
224
ad2c98faec97
using isinstance(blah, Foo) now instead of isFooType
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
273 elif isinstance(type, hyperdb.Multilink): |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
274 props[key] = value.split(',') |
|
262
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
275 |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
276 if cl.getkey() and not props.has_key(cl.getkey()): |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
277 print "You must provide the '%s' property."%cl.getkey() |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
278 else: |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
279 print apply(cl.create, (), props) |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
280 |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
281 return 0 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
282 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
283 def do_list(db, args): |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
284 '''Usage: list classname [property] |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
285 List the instances of a class. |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
286 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
287 Lists all instances of the given class along. If the property is not |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
288 specified, the "label" property is used. The label property is tried |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
289 in order: the key, "name", "title" and then the first property, |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
290 alphabetically. |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
291 ''' |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
292 classname = args[0] |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
293 cl = db.getclass(classname) |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
294 if len(args) > 1: |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
295 key = args[1] |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
296 else: |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
297 key = cl.labelprop() |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
298 # TODO: handle the -c option |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
299 for nodeid in cl.list(): |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
300 value = cl.get(nodeid, key) |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
301 print "%4s: %s"%(nodeid, value) |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
302 return 0 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
303 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
304 def do_history(db, args): |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
305 '''Usage: history designator |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
306 Show the history entries of a designator. |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
307 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
308 Lists the journal entries for the node identified by the designator. |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
309 ''' |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
310 classname, nodeid = roundupdb.splitDesignator(args[0]) |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
311 # TODO: handle the -c option |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
312 print db.getclass(classname).history(nodeid) |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
313 return 0 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
314 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
315 def do_retire(db, args): |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
316 '''Usage: retire designator[,designator]* |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
317 Retire the node specified by designator. |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
318 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
319 This action indicates that a particular node is not to be retrieved by |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
320 the list or find commands, and its key value may be re-used. |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
321 ''' |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
322 designators = string.split(args[0], ',') |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
323 for designator in designators: |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
324 classname, nodeid = roundupdb.splitDesignator(designator) |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
325 db.getclass(classname).retire(nodeid) |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
326 return 0 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
327 |
|
153
b07b9a5b6aa9
Freshen is really broken. Commented out.
Richard Jones <richard@users.sourceforge.net>
parents:
147
diff
changeset
|
328 def do_freshen(db, args): |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
329 '''Usage: freshen |
|
153
b07b9a5b6aa9
Freshen is really broken. Commented out.
Richard Jones <richard@users.sourceforge.net>
parents:
147
diff
changeset
|
330 Freshen an existing instance. **DO NOT USE** |
|
b07b9a5b6aa9
Freshen is really broken. Commented out.
Richard Jones <richard@users.sourceforge.net>
parents:
147
diff
changeset
|
331 |
|
b07b9a5b6aa9
Freshen is really broken. Commented out.
Richard Jones <richard@users.sourceforge.net>
parents:
147
diff
changeset
|
332 This currently kills databases!!!! |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
333 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
334 This action should generally not be used. It reads in an instance |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
335 database and writes it again. In the future, is may also update |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
336 instance code to account for changes in templates. It's probably wise |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
337 not to use it anyway. Until we're sure it won't break things... |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
338 ''' |
|
153
b07b9a5b6aa9
Freshen is really broken. Commented out.
Richard Jones <richard@users.sourceforge.net>
parents:
147
diff
changeset
|
339 # for classname, cl in db.classes.items(): |
|
b07b9a5b6aa9
Freshen is really broken. Commented out.
Richard Jones <richard@users.sourceforge.net>
parents:
147
diff
changeset
|
340 # properties = cl.properties.items() |
|
b07b9a5b6aa9
Freshen is really broken. Commented out.
Richard Jones <richard@users.sourceforge.net>
parents:
147
diff
changeset
|
341 # for nodeid in cl.list(): |
|
b07b9a5b6aa9
Freshen is really broken. Commented out.
Richard Jones <richard@users.sourceforge.net>
parents:
147
diff
changeset
|
342 # node = {} |
|
b07b9a5b6aa9
Freshen is really broken. Commented out.
Richard Jones <richard@users.sourceforge.net>
parents:
147
diff
changeset
|
343 # for name, type in properties: |
|
224
ad2c98faec97
using isinstance(blah, Foo) now instead of isFooType
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
344 # isinstance( if type, hyperdb.Multilink): |
|
153
b07b9a5b6aa9
Freshen is really broken. Commented out.
Richard Jones <richard@users.sourceforge.net>
parents:
147
diff
changeset
|
345 # node[name] = cl.get(nodeid, name, []) |
|
b07b9a5b6aa9
Freshen is really broken. Commented out.
Richard Jones <richard@users.sourceforge.net>
parents:
147
diff
changeset
|
346 # else: |
|
b07b9a5b6aa9
Freshen is really broken. Commented out.
Richard Jones <richard@users.sourceforge.net>
parents:
147
diff
changeset
|
347 # node[name] = cl.get(nodeid, name, None) |
|
b07b9a5b6aa9
Freshen is really broken. Commented out.
Richard Jones <richard@users.sourceforge.net>
parents:
147
diff
changeset
|
348 # db.setnode(classname, nodeid, node) |
|
b07b9a5b6aa9
Freshen is really broken. Commented out.
Richard Jones <richard@users.sourceforge.net>
parents:
147
diff
changeset
|
349 return 1 |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
350 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
351 def figureCommands(): |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
352 d = {} |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
353 for k, v in globals().items(): |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
354 if k[:3] == 'do_': |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
355 d[k[3:]] = v |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
356 return d |
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
357 |
|
160
002249ffa5d0
init help now lists templates and backends
Richard Jones <richard@users.sourceforge.net>
parents:
153
diff
changeset
|
358 def printInitOptions(): |
|
002249ffa5d0
init help now lists templates and backends
Richard Jones <richard@users.sourceforge.net>
parents:
153
diff
changeset
|
359 import roundup.templates |
|
002249ffa5d0
init help now lists templates and backends
Richard Jones <richard@users.sourceforge.net>
parents:
153
diff
changeset
|
360 templates = roundup.templates.listTemplates() |
|
002249ffa5d0
init help now lists templates and backends
Richard Jones <richard@users.sourceforge.net>
parents:
153
diff
changeset
|
361 print 'Templates:', ', '.join(templates) |
|
002249ffa5d0
init help now lists templates and backends
Richard Jones <richard@users.sourceforge.net>
parents:
153
diff
changeset
|
362 import roundup.backends |
|
002249ffa5d0
init help now lists templates and backends
Richard Jones <richard@users.sourceforge.net>
parents:
153
diff
changeset
|
363 backends = roundup.backends.__all__ |
|
002249ffa5d0
init help now lists templates and backends
Richard Jones <richard@users.sourceforge.net>
parents:
153
diff
changeset
|
364 print 'Back ends:', ', '.join(backends) |
|
002249ffa5d0
init help now lists templates and backends
Richard Jones <richard@users.sourceforge.net>
parents:
153
diff
changeset
|
365 |
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
366 def main(): |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
367 opts, args = getopt.getopt(sys.argv[1:], 'i:u:hc') |
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
368 |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
369 # handle command-line args |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
370 instance_home = os.environ.get('ROUNDUP_INSTANCE', '') |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
371 name = password = '' |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
372 if os.environ.has_key('ROUNDUP_LOGIN'): |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
373 l = os.environ['ROUNDUP_LOGIN'].split(':') |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
374 name = l[0] |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
375 if len(l) > 1: |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
376 password = l[1] |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
377 comma_sep = 0 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
378 for opt, arg in opts: |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
379 if opt == '-h': |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
380 usage() |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
381 return 0 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
382 if opt == '-i': |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
383 instance_home = arg |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
384 if opt == '-c': |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
385 comma_sep = 1 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
386 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
387 # figure the command |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
388 if not args: |
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
389 usage('No command specified') |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
390 return 1 |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
391 command = args[0] |
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
392 |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
393 # handle help now |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
394 if command == 'help': |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
395 if len(args)>1: |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
396 command = figureCommands().get(args[1], None) |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
397 if not command: |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
398 usage('no such command "%s"'%args[1]) |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
399 return 1 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
400 print command.__doc__ |
|
160
002249ffa5d0
init help now lists templates and backends
Richard Jones <richard@users.sourceforge.net>
parents:
153
diff
changeset
|
401 if args[1] == 'init': |
|
002249ffa5d0
init help now lists templates and backends
Richard Jones <richard@users.sourceforge.net>
parents:
153
diff
changeset
|
402 printInitOptions() |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
403 return 0 |
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
404 usage() |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
405 return 0 |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
406 if command == 'morehelp': |
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
407 moreusage() |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
408 return 0 |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
409 |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
410 # make sure we have an instance_home |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
411 while not instance_home: |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
412 instance_home = raw_input('Enter instance home: ').strip() |
|
137
4a87e0b0d3f7
Made the "init" prompting more friendly.
Richard Jones <richard@users.sourceforge.net>
parents:
127
diff
changeset
|
413 |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
414 # before we open the db, we may be doing an init |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
415 if command == 'init': |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
416 return do_init(instance_home, args) |
|
137
4a87e0b0d3f7
Made the "init" prompting more friendly.
Richard Jones <richard@users.sourceforge.net>
parents:
127
diff
changeset
|
417 |
|
153
b07b9a5b6aa9
Freshen is really broken. Commented out.
Richard Jones <richard@users.sourceforge.net>
parents:
147
diff
changeset
|
418 function = figureCommands().get(command, None) |
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
419 |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
420 # not a valid command |
|
153
b07b9a5b6aa9
Freshen is really broken. Commented out.
Richard Jones <richard@users.sourceforge.net>
parents:
147
diff
changeset
|
421 if function is None: |
|
b07b9a5b6aa9
Freshen is really broken. Commented out.
Richard Jones <richard@users.sourceforge.net>
parents:
147
diff
changeset
|
422 usage('Unknown command "%s"'%command) |
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
423 return 1 |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
424 |
|
270
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
425 # get the instance |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
426 instance = roundup.instance.open(instance_home) |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
427 db = instance.open('admin') |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
428 |
|
274
79226fbb7741
Spit out command help if roundup-admin command doesn't get an argument.
Richard Jones <richard@users.sourceforge.net>
parents:
270
diff
changeset
|
429 if len(args) < 2: |
|
79226fbb7741
Spit out command help if roundup-admin command doesn't get an argument.
Richard Jones <richard@users.sourceforge.net>
parents:
270
diff
changeset
|
430 print function.__doc__ |
|
79226fbb7741
Spit out command help if roundup-admin command doesn't get an argument.
Richard Jones <richard@users.sourceforge.net>
parents:
270
diff
changeset
|
431 return 1 |
|
79226fbb7741
Spit out command help if roundup-admin command doesn't get an argument.
Richard Jones <richard@users.sourceforge.net>
parents:
270
diff
changeset
|
432 |
|
270
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
433 # do the command |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
434 try: |
|
153
b07b9a5b6aa9
Freshen is really broken. Commented out.
Richard Jones <richard@users.sourceforge.net>
parents:
147
diff
changeset
|
435 return function(db, args[1:]) |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
436 finally: |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
437 db.close() |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
438 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
439 return 1 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
440 |
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
441 |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
442 if __name__ == '__main__': |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
443 sys.exit(main()) |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
444 |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
445 # |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
446 # $Log: not supported by cvs2svn $ |
|
274
79226fbb7741
Spit out command help if roundup-admin command doesn't get an argument.
Richard Jones <richard@users.sourceforge.net>
parents:
270
diff
changeset
|
447 # Revision 1.22 2001/10/09 07:25:59 richard |
|
79226fbb7741
Spit out command help if roundup-admin command doesn't get an argument.
Richard Jones <richard@users.sourceforge.net>
parents:
270
diff
changeset
|
448 # Added the Password property type. See "pydoc roundup.password" for |
|
79226fbb7741
Spit out command help if roundup-admin command doesn't get an argument.
Richard Jones <richard@users.sourceforge.net>
parents:
270
diff
changeset
|
449 # implementation details. Have updated some of the documentation too. |
|
79226fbb7741
Spit out command help if roundup-admin command doesn't get an argument.
Richard Jones <richard@users.sourceforge.net>
parents:
270
diff
changeset
|
450 # |
|
270
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
451 # Revision 1.21 2001/10/05 02:23:24 richard |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
452 # . roundup-admin create now prompts for property info if none is supplied |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
453 # on the command-line. |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
454 # . hyperdb Class getprops() method may now return only the mutable |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
455 # properties. |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
456 # . Login now uses cookies, which makes it a whole lot more flexible. We can |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
457 # now support anonymous user access (read-only, unless there's an |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
458 # "anonymous" user, in which case write access is permitted). Login |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
459 # handling has been moved into cgi_client.Client.main() |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
460 # . The "extended" schema is now the default in roundup init. |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
461 # . The schemas have had their page headings modified to cope with the new |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
462 # login handling. Existing installations should copy the interfaces.py |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
463 # file from the roundup lib directory to their instance home. |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
464 # . Incorrectly had a Bizar Software copyright on the cgitb.py module from |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
465 # Ping - has been removed. |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
466 # . Fixed a whole bunch of places in the CGI interface where we should have |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
467 # been returning Not Found instead of throwing an exception. |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
468 # . Fixed a deviation from the spec: trying to modify the 'id' property of |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
469 # an item now throws an exception. |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
470 # |
|
264
a671e5917b33
Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
262
diff
changeset
|
471 # Revision 1.20 2001/10/04 02:12:42 richard |
|
a671e5917b33
Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
262
diff
changeset
|
472 # Added nicer command-line item adding: passing no arguments will enter an |
|
a671e5917b33
Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
262
diff
changeset
|
473 # interactive more which asks for each property in turn. While I was at it, I |
|
a671e5917b33
Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
262
diff
changeset
|
474 # fixed an implementation problem WRT the spec - I wasn't raising a |
|
a671e5917b33
Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
262
diff
changeset
|
475 # ValueError if the key property was missing from a create(). Also added a |
|
a671e5917b33
Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
262
diff
changeset
|
476 # protected=boolean argument to getprops() so we can list only the mutable |
|
a671e5917b33
Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
262
diff
changeset
|
477 # properties (defaults to yes, which lists the immutables). |
|
a671e5917b33
Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
262
diff
changeset
|
478 # |
|
262
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
479 # Revision 1.19 2001/10/01 06:40:43 richard |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
480 # made do_get have the args in the correct order |
|
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
481 # |
|
261
0ca5381a72b5
made do_get have the args in the correct order
Richard Jones <richard@users.sourceforge.net>
parents:
248
diff
changeset
|
482 # Revision 1.18 2001/09/18 22:58:37 richard |
|
0ca5381a72b5
made do_get have the args in the correct order
Richard Jones <richard@users.sourceforge.net>
parents:
248
diff
changeset
|
483 # |
|
0ca5381a72b5
made do_get have the args in the correct order
Richard Jones <richard@users.sourceforge.net>
parents:
248
diff
changeset
|
484 # Added some more help to roundu-admin |
|
0ca5381a72b5
made do_get have the args in the correct order
Richard Jones <richard@users.sourceforge.net>
parents:
248
diff
changeset
|
485 # |
|
248
96cdd8ef0581
Added some more help to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
235
diff
changeset
|
486 # Revision 1.17 2001/08/28 05:58:33 anthonybaxter |
|
96cdd8ef0581
Added some more help to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
235
diff
changeset
|
487 # added missing 'import' statements. |
|
96cdd8ef0581
Added some more help to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
235
diff
changeset
|
488 # |
|
235
d7d358408537
added missing 'import' statements.
Anthony Baxter <anthonybaxter@users.sourceforge.net>
parents:
224
diff
changeset
|
489 # Revision 1.16 2001/08/12 06:32:36 richard |
|
d7d358408537
added missing 'import' statements.
Anthony Baxter <anthonybaxter@users.sourceforge.net>
parents:
224
diff
changeset
|
490 # using isinstance(blah, Foo) now instead of isFooType |
|
d7d358408537
added missing 'import' statements.
Anthony Baxter <anthonybaxter@users.sourceforge.net>
parents:
224
diff
changeset
|
491 # |
|
224
ad2c98faec97
using isinstance(blah, Foo) now instead of isFooType
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
492 # Revision 1.15 2001/08/07 00:24:42 richard |
|
ad2c98faec97
using isinstance(blah, Foo) now instead of isFooType
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
493 # stupid typo |
|
ad2c98faec97
using isinstance(blah, Foo) now instead of isFooType
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
494 # |
| 214 | 495 # Revision 1.14 2001/08/07 00:15:51 richard |
| 496 # Added the copyright/license notice to (nearly) all files at request of | |
| 497 # Bizar Software. | |
| 498 # | |
|
213
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
204
diff
changeset
|
499 # Revision 1.13 2001/08/05 07:44:13 richard |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
204
diff
changeset
|
500 # Instances are now opened by a special function that generates a unique |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
204
diff
changeset
|
501 # module name for the instances on import time. |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
204
diff
changeset
|
502 # |
|
204
c1461733cbf9
Instances are now opened by a special function...
Richard Jones <richard@users.sourceforge.net>
parents:
193
diff
changeset
|
503 # Revision 1.12 2001/08/03 01:28:33 richard |
|
c1461733cbf9
Instances are now opened by a special function...
Richard Jones <richard@users.sourceforge.net>
parents:
193
diff
changeset
|
504 # Used the much nicer load_package, pointed out by Steve Majewski. |
|
c1461733cbf9
Instances are now opened by a special function...
Richard Jones <richard@users.sourceforge.net>
parents:
193
diff
changeset
|
505 # |
|
193
241a0323aacb
Used the much nicer load_package, pointed out by Steve Majewski.
Richard Jones <richard@users.sourceforge.net>
parents:
190
diff
changeset
|
506 # Revision 1.11 2001/08/03 00:59:34 richard |
|
241a0323aacb
Used the much nicer load_package, pointed out by Steve Majewski.
Richard Jones <richard@users.sourceforge.net>
parents:
190
diff
changeset
|
507 # Instance import now imports the instance using imp.load_module so that |
|
241a0323aacb
Used the much nicer load_package, pointed out by Steve Majewski.
Richard Jones <richard@users.sourceforge.net>
parents:
190
diff
changeset
|
508 # we can have instance homes of "roundup" or other existing python package |
|
241a0323aacb
Used the much nicer load_package, pointed out by Steve Majewski.
Richard Jones <richard@users.sourceforge.net>
parents:
190
diff
changeset
|
509 # names. |
|
241a0323aacb
Used the much nicer load_package, pointed out by Steve Majewski.
Richard Jones <richard@users.sourceforge.net>
parents:
190
diff
changeset
|
510 # |
|
190
996eaf90c01e
Instance import now imports the instance using imp.load_module...
Richard Jones <richard@users.sourceforge.net>
parents:
167
diff
changeset
|
511 # Revision 1.10 2001/07/30 08:12:17 richard |
|
996eaf90c01e
Instance import now imports the instance using imp.load_module...
Richard Jones <richard@users.sourceforge.net>
parents:
167
diff
changeset
|
512 # Added time logging and file uploading to the templates. |
|
996eaf90c01e
Instance import now imports the instance using imp.load_module...
Richard Jones <richard@users.sourceforge.net>
parents:
167
diff
changeset
|
513 # |
|
167
a49c8a2ddd26
Added time logging and file uploading to the templates.
Richard Jones <richard@users.sourceforge.net>
parents:
160
diff
changeset
|
514 # Revision 1.9 2001/07/30 03:52:55 richard |
|
a49c8a2ddd26
Added time logging and file uploading to the templates.
Richard Jones <richard@users.sourceforge.net>
parents:
160
diff
changeset
|
515 # init help now lists templates and backends |
|
a49c8a2ddd26
Added time logging and file uploading to the templates.
Richard Jones <richard@users.sourceforge.net>
parents:
160
diff
changeset
|
516 # |
|
160
002249ffa5d0
init help now lists templates and backends
Richard Jones <richard@users.sourceforge.net>
parents:
153
diff
changeset
|
517 # Revision 1.8 2001/07/30 02:37:07 richard |
|
002249ffa5d0
init help now lists templates and backends
Richard Jones <richard@users.sourceforge.net>
parents:
153
diff
changeset
|
518 # Freshen is really broken. Commented out. |
|
002249ffa5d0
init help now lists templates and backends
Richard Jones <richard@users.sourceforge.net>
parents:
153
diff
changeset
|
519 # |
|
153
b07b9a5b6aa9
Freshen is really broken. Commented out.
Richard Jones <richard@users.sourceforge.net>
parents:
147
diff
changeset
|
520 # Revision 1.7 2001/07/30 01:28:46 richard |
|
b07b9a5b6aa9
Freshen is really broken. Commented out.
Richard Jones <richard@users.sourceforge.net>
parents:
147
diff
changeset
|
521 # Bugfixes |
|
b07b9a5b6aa9
Freshen is really broken. Commented out.
Richard Jones <richard@users.sourceforge.net>
parents:
147
diff
changeset
|
522 # |
| 147 | 523 # Revision 1.6 2001/07/30 00:57:51 richard |
| 524 # Now uses getopt, much improved command-line parsing. Much fuller help. Much | |
| 525 # better internal structure. It's just BETTER. :) | |
| 526 # | |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
527 # Revision 1.5 2001/07/30 00:04:48 richard |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
528 # Made the "init" prompting more friendly. |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
529 # |
|
137
4a87e0b0d3f7
Made the "init" prompting more friendly.
Richard Jones <richard@users.sourceforge.net>
parents:
127
diff
changeset
|
530 # Revision 1.4 2001/07/29 07:01:39 richard |
|
4a87e0b0d3f7
Made the "init" prompting more friendly.
Richard Jones <richard@users.sourceforge.net>
parents:
127
diff
changeset
|
531 # Added vim command to all source so that we don't get no steenkin' tabs :) |
|
4a87e0b0d3f7
Made the "init" prompting more friendly.
Richard Jones <richard@users.sourceforge.net>
parents:
127
diff
changeset
|
532 # |
|
127
0791d13baea7
Added vim command to all source so that we don't get no steenkin' tabs :)
Richard Jones <richard@users.sourceforge.net>
parents:
51
diff
changeset
|
533 # Revision 1.3 2001/07/23 08:45:28 richard |
|
0791d13baea7
Added vim command to all source so that we don't get no steenkin' tabs :)
Richard Jones <richard@users.sourceforge.net>
parents:
51
diff
changeset
|
534 # ok, so now "./roundup-admin init" will ask questions in an attempt to get a |
|
0791d13baea7
Added vim command to all source so that we don't get no steenkin' tabs :)
Richard Jones <richard@users.sourceforge.net>
parents:
51
diff
changeset
|
535 # workable instance_home set up :) |
|
0791d13baea7
Added vim command to all source so that we don't get no steenkin' tabs :)
Richard Jones <richard@users.sourceforge.net>
parents:
51
diff
changeset
|
536 # _and_ anydbm has had its first test :) |
|
0791d13baea7
Added vim command to all source so that we don't get no steenkin' tabs :)
Richard Jones <richard@users.sourceforge.net>
parents:
51
diff
changeset
|
537 # |
|
51
3a7e5515c1bd
ok, so now "./roundup-admin init" will ask questions...
Richard Jones <richard@users.sourceforge.net>
parents:
48
diff
changeset
|
538 # Revision 1.2 2001/07/23 08:20:44 richard |
|
3a7e5515c1bd
ok, so now "./roundup-admin init" will ask questions...
Richard Jones <richard@users.sourceforge.net>
parents:
48
diff
changeset
|
539 # Moved over to using marshal in the bsddb and anydbm backends. |
|
3a7e5515c1bd
ok, so now "./roundup-admin init" will ask questions...
Richard Jones <richard@users.sourceforge.net>
parents:
48
diff
changeset
|
540 # roundup-admin now has a "freshen" command that'll load/save all nodes (not |
|
3a7e5515c1bd
ok, so now "./roundup-admin init" will ask questions...
Richard Jones <richard@users.sourceforge.net>
parents:
48
diff
changeset
|
541 # retired - mod hyperdb.Class.list() so it lists retired nodes) |
|
3a7e5515c1bd
ok, so now "./roundup-admin init" will ask questions...
Richard Jones <richard@users.sourceforge.net>
parents:
48
diff
changeset
|
542 # |
|
48
671203878652
Moved over to using marshal in the bsddb and anydbm backends.
Richard Jones <richard@users.sourceforge.net>
parents:
27
diff
changeset
|
543 # Revision 1.1 2001/07/23 03:46:48 richard |
|
671203878652
Moved over to using marshal in the bsddb and anydbm backends.
Richard Jones <richard@users.sourceforge.net>
parents:
27
diff
changeset
|
544 # moving the bin files to facilitate out-of-the-boxness |
|
671203878652
Moved over to using marshal in the bsddb and anydbm backends.
Richard Jones <richard@users.sourceforge.net>
parents:
27
diff
changeset
|
545 # |
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
546 # Revision 1.1 2001/07/22 11:15:45 richard |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
547 # More Grande Splite stuff |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
548 # |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
549 # |
|
127
0791d13baea7
Added vim command to all source so that we don't get no steenkin' tabs :)
Richard Jones <richard@users.sourceforge.net>
parents:
51
diff
changeset
|
550 # vim: set filetype=python ts=4 sw=4 et si |
