Mercurial > p > roundup > code
annotate roundup-admin @ 474:ef06a66a0b72
[SF#496360] table width does not work
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Mon, 31 Dec 2001 05:20:34 +0000 |
| parents | e18210e77a39 |
| children | b35f229dd049 |
| rev | line source |
|---|---|
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
1 #! /usr/bin/env 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 # |
|
474
ef06a66a0b72
[SF#496360] table width does not work
Richard Jones <richard@users.sourceforge.net>
parents:
472
diff
changeset
|
19 # $Id: roundup-admin,v 1.59 2001-12-31 05:20:34 richard Exp $ |
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
20 |
|
449
141aacfdb34f
Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents:
445
diff
changeset
|
21 # python version check |
|
141aacfdb34f
Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents:
445
diff
changeset
|
22 from roundup import version_check |
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
23 |
|
470
9f7320624bc2
Added better tokenising to roundup-admin - handles spaces and stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
461
diff
changeset
|
24 import sys, os, getpass, getopt, re, UserDict, shlex |
|
278
a5dabf2430c5
Added database importing and exporting through CSV files.
Richard Jones <richard@users.sourceforge.net>
parents:
274
diff
changeset
|
25 try: |
|
a5dabf2430c5
Added database importing and exporting through CSV files.
Richard Jones <richard@users.sourceforge.net>
parents:
274
diff
changeset
|
26 import csv |
|
a5dabf2430c5
Added database importing and exporting through CSV files.
Richard Jones <richard@users.sourceforge.net>
parents:
274
diff
changeset
|
27 except ImportError: |
|
a5dabf2430c5
Added database importing and exporting through CSV files.
Richard Jones <richard@users.sourceforge.net>
parents:
274
diff
changeset
|
28 csv = None |
|
470
9f7320624bc2
Added better tokenising to roundup-admin - handles spaces and stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
461
diff
changeset
|
29 from roundup import date, hyperdb, roundupdb, init, password, token |
|
204
c1461733cbf9
Instances are now opened by a special function...
Richard Jones <richard@users.sourceforge.net>
parents:
193
diff
changeset
|
30 import roundup.instance |
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
31 |
|
371
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
32 class CommandDict(UserDict.UserDict): |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
33 '''Simple dictionary that lets us do lookups using partial keys. |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
34 |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
35 Original code submitted by Engelbert Gruber. |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
36 ''' |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
37 _marker = [] |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
38 def get(self, key, default=_marker): |
|
372
3b9410cb8b61
Expanded the already-abbreviated "initialise" and "specification" commands...
Richard Jones <richard@users.sourceforge.net>
parents:
371
diff
changeset
|
39 if self.data.has_key(key): |
|
3b9410cb8b61
Expanded the already-abbreviated "initialise" and "specification" commands...
Richard Jones <richard@users.sourceforge.net>
parents:
371
diff
changeset
|
40 return [(key, self.data[key])] |
|
371
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
41 keylist = self.data.keys() |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
42 keylist.sort() |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
43 l = [] |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
44 for ki in keylist: |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
45 if ki.startswith(key): |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
46 l.append((ki, self.data[ki])) |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
47 if not l and default is self._marker: |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
48 raise KeyError, key |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
49 return l |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
50 |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
51 class UsageError(ValueError): |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
52 pass |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
53 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
54 class AdminTool: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
55 |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
56 def __init__(self): |
|
371
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
57 self.commands = CommandDict() |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
308
diff
changeset
|
58 for k in AdminTool.__dict__.keys(): |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
59 if k[:3] == 'do_': |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
308
diff
changeset
|
60 self.commands[k[3:]] = getattr(self, k) |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
61 self.help = {} |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
308
diff
changeset
|
62 for k in AdminTool.__dict__.keys(): |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
63 if k[:5] == 'help_': |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
308
diff
changeset
|
64 self.help[k[5:]] = getattr(self, k) |
|
438
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
65 self.instance_home = '' |
|
380
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
379
diff
changeset
|
66 self.db = None |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
67 |
|
386
59ed29a879f6
Fixed option & associated error handling
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
380
diff
changeset
|
68 def usage(self, message=''): |
|
59ed29a879f6
Fixed option & associated error handling
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
380
diff
changeset
|
69 if message: message = 'Problem: '+message+'\n\n' |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
70 print '''%sUsage: roundup-admin [-i instance home] [-u login] [-c] <command> <arguments> |
|
291
ee7705d7bb06
More help in admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
287
diff
changeset
|
71 |
|
ee7705d7bb06
More help in admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
287
diff
changeset
|
72 Help: |
|
ee7705d7bb06
More help in admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
287
diff
changeset
|
73 roundup-admin -h |
|
ee7705d7bb06
More help in admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
287
diff
changeset
|
74 roundup-admin help -- this help |
|
ee7705d7bb06
More help in admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
287
diff
changeset
|
75 roundup-admin help <command> -- command-specific help |
|
ee7705d7bb06
More help in admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
287
diff
changeset
|
76 roundup-admin help all -- all available help |
|
ee7705d7bb06
More help in admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
287
diff
changeset
|
77 Options: |
|
ee7705d7bb06
More help in admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
287
diff
changeset
|
78 -i instance home -- specify the issue tracker "home directory" to administer |
|
ee7705d7bb06
More help in admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
287
diff
changeset
|
79 -u -- the user[:password] to use for commands |
|
ee7705d7bb06
More help in admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
287
diff
changeset
|
80 -c -- when outputting lists of data, just comma-separate them'''%message |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
81 self.help_commands() |
|
291
ee7705d7bb06
More help in admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
287
diff
changeset
|
82 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
83 def help_commands(self): |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
84 print 'Commands:', |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
85 commands = [''] |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
86 for command in self.commands.values(): |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
87 h = command.__doc__.split('\n')[0] |
|
372
3b9410cb8b61
Expanded the already-abbreviated "initialise" and "specification" commands...
Richard Jones <richard@users.sourceforge.net>
parents:
371
diff
changeset
|
88 commands.append(' '+h[7:]) |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
89 commands.sort() |
|
372
3b9410cb8b61
Expanded the already-abbreviated "initialise" and "specification" commands...
Richard Jones <richard@users.sourceforge.net>
parents:
371
diff
changeset
|
90 commands.append( |
|
3b9410cb8b61
Expanded the already-abbreviated "initialise" and "specification" commands...
Richard Jones <richard@users.sourceforge.net>
parents:
371
diff
changeset
|
91 'Commands may be abbreviated as long as the abbreviation matches only one') |
|
3b9410cb8b61
Expanded the already-abbreviated "initialise" and "specification" commands...
Richard Jones <richard@users.sourceforge.net>
parents:
371
diff
changeset
|
92 commands.append('command, e.g. l == li == lis == list.') |
|
3b9410cb8b61
Expanded the already-abbreviated "initialise" and "specification" commands...
Richard Jones <richard@users.sourceforge.net>
parents:
371
diff
changeset
|
93 print '\n'.join(commands) |
|
386
59ed29a879f6
Fixed option & associated error handling
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
380
diff
changeset
|
94 print |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
95 |
|
461
b579418f7ed1
Implemented file store rollback.
Richard Jones <richard@users.sourceforge.net>
parents:
455
diff
changeset
|
96 def help_commands_html(self, indent_re=re.compile(r'^(\s+)\S+')): |
|
b579418f7ed1
Implemented file store rollback.
Richard Jones <richard@users.sourceforge.net>
parents:
455
diff
changeset
|
97 commands = self.commands.values() |
|
b579418f7ed1
Implemented file store rollback.
Richard Jones <richard@users.sourceforge.net>
parents:
455
diff
changeset
|
98 def sortfun(a, b): |
|
b579418f7ed1
Implemented file store rollback.
Richard Jones <richard@users.sourceforge.net>
parents:
455
diff
changeset
|
99 return cmp(a.__name__, b.__name__) |
|
b579418f7ed1
Implemented file store rollback.
Richard Jones <richard@users.sourceforge.net>
parents:
455
diff
changeset
|
100 commands.sort(sortfun) |
|
b579418f7ed1
Implemented file store rollback.
Richard Jones <richard@users.sourceforge.net>
parents:
455
diff
changeset
|
101 for command in commands: |
|
b579418f7ed1
Implemented file store rollback.
Richard Jones <richard@users.sourceforge.net>
parents:
455
diff
changeset
|
102 h = command.__doc__.split('\n') |
|
b579418f7ed1
Implemented file store rollback.
Richard Jones <richard@users.sourceforge.net>
parents:
455
diff
changeset
|
103 name = command.__name__[3:] |
|
b579418f7ed1
Implemented file store rollback.
Richard Jones <richard@users.sourceforge.net>
parents:
455
diff
changeset
|
104 usage = h[0] |
|
b579418f7ed1
Implemented file store rollback.
Richard Jones <richard@users.sourceforge.net>
parents:
455
diff
changeset
|
105 print ''' |
|
b579418f7ed1
Implemented file store rollback.
Richard Jones <richard@users.sourceforge.net>
parents:
455
diff
changeset
|
106 <tr><td valign=top><strong>%(name)s</strong></td> |
|
b579418f7ed1
Implemented file store rollback.
Richard Jones <richard@users.sourceforge.net>
parents:
455
diff
changeset
|
107 <td><tt>%(usage)s</tt><p> |
|
b579418f7ed1
Implemented file store rollback.
Richard Jones <richard@users.sourceforge.net>
parents:
455
diff
changeset
|
108 <pre>'''%locals() |
|
b579418f7ed1
Implemented file store rollback.
Richard Jones <richard@users.sourceforge.net>
parents:
455
diff
changeset
|
109 indent = indent_re.match(h[3]) |
|
b579418f7ed1
Implemented file store rollback.
Richard Jones <richard@users.sourceforge.net>
parents:
455
diff
changeset
|
110 if indent: indent = len(indent.group(1)) |
|
b579418f7ed1
Implemented file store rollback.
Richard Jones <richard@users.sourceforge.net>
parents:
455
diff
changeset
|
111 for line in h[3:]: |
|
b579418f7ed1
Implemented file store rollback.
Richard Jones <richard@users.sourceforge.net>
parents:
455
diff
changeset
|
112 if indent: |
|
b579418f7ed1
Implemented file store rollback.
Richard Jones <richard@users.sourceforge.net>
parents:
455
diff
changeset
|
113 print line[indent:] |
|
b579418f7ed1
Implemented file store rollback.
Richard Jones <richard@users.sourceforge.net>
parents:
455
diff
changeset
|
114 else: |
|
b579418f7ed1
Implemented file store rollback.
Richard Jones <richard@users.sourceforge.net>
parents:
455
diff
changeset
|
115 print line |
|
b579418f7ed1
Implemented file store rollback.
Richard Jones <richard@users.sourceforge.net>
parents:
455
diff
changeset
|
116 print '</pre></td></tr>\n' |
|
b579418f7ed1
Implemented file store rollback.
Richard Jones <richard@users.sourceforge.net>
parents:
455
diff
changeset
|
117 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
118 def help_all(self): |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
119 print ''' |
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
120 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
|
121 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
|
122 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
|
123 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
|
124 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
|
125 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
|
126 |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
127 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
|
128 |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
129 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
|
130 printed results: |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
131 . Strings are, well, strings. |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
132 . 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
|
133 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
|
134 . 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
|
135 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
|
136 . 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
|
137 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
|
138 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
|
139 commas is accepted. |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
140 |
|
471
f51b017eff05
added some quoting instructions to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
470
diff
changeset
|
141 When property values must contain spaces, just surround the value with |
|
f51b017eff05
added some quoting instructions to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
470
diff
changeset
|
142 quotes, either ' or ". A single space may also be backslash-quoted. If a |
|
f51b017eff05
added some quoting instructions to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
470
diff
changeset
|
143 valuu must contain a quote character, it must be backslash-quoted or inside |
|
f51b017eff05
added some quoting instructions to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
470
diff
changeset
|
144 quotes. Examples: |
|
f51b017eff05
added some quoting instructions to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
470
diff
changeset
|
145 hello world (2 tokens: hello, world) |
|
f51b017eff05
added some quoting instructions to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
470
diff
changeset
|
146 "hello world" (1 token: hello world) |
|
f51b017eff05
added some quoting instructions to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
470
diff
changeset
|
147 "Roch'e" Compaan (2 tokens: Roch'e Compaan) |
|
f51b017eff05
added some quoting instructions to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
470
diff
changeset
|
148 Roch\'e Compaan (2 tokens: Roch'e Compaan) |
|
f51b017eff05
added some quoting instructions to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
470
diff
changeset
|
149 address="1 2 3" (1 token: address=1 2 3) |
|
f51b017eff05
added some quoting instructions to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
470
diff
changeset
|
150 \\ (1 token: \) |
|
f51b017eff05
added some quoting instructions to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
470
diff
changeset
|
151 \n\r\t (1 token: a newline, carriage-return and tab) |
|
f51b017eff05
added some quoting instructions to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
470
diff
changeset
|
152 |
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
153 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
|
154 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
|
155 nodes. |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
156 |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
157 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
|
158 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
|
159 the -c) option. |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
160 |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
161 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
|
162 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
|
163 . ROUNDUP_LOGIN environment variable |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
164 . 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
|
165 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
|
166 command-line. |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
167 |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
168 Date format examples: |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
169 "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
|
170 "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
|
171 "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
|
172 "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
|
173 "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
|
174 "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
|
175 "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
|
176 "." means "right now" |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
177 |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
178 Command help: |
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
179 ''' |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
180 for name, command in self.commands.items(): |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
181 print '%s:'%name |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
182 print ' ',command.__doc__ |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
183 |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
184 def do_help(self, args, nl_re=re.compile('[\r\n]'), |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
185 indent_re=re.compile(r'^(\s+)\S+')): |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
186 '''Usage: help topic |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
187 Give help about topic. |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
188 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
189 commands -- list commands |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
190 <command> -- help specific to a command |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
191 initopts -- init command options |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
192 all -- all available help |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
193 ''' |
|
371
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
194 topic = args[0] |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
195 |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
196 # try help_ methods |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
197 if self.help.has_key(topic): |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
198 self.help[topic]() |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
199 return 0 |
|
371
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
200 |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
201 # try command docstrings |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
202 try: |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
203 l = self.commands.get(topic) |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
204 except KeyError: |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
205 print 'Sorry, no help for "%s"'%topic |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
206 return 1 |
|
371
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
207 |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
208 # display the help for each match, removing the docsring indent |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
209 for name, help in l: |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
210 lines = nl_re.split(help.__doc__) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
211 print lines[0] |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
212 indent = indent_re.match(lines[1]) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
213 if indent: indent = len(indent.group(1)) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
214 for line in lines[1:]: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
215 if indent: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
216 print line[indent:] |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
217 else: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
218 print line |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
219 return 0 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
220 |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
221 def help_initopts(self): |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
222 import roundup.templates |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
223 templates = roundup.templates.listTemplates() |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
224 print 'Templates:', ', '.join(templates) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
225 import roundup.backends |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
226 backends = roundup.backends.__all__ |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
227 print 'Back ends:', ', '.join(backends) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
228 |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
229 |
|
372
3b9410cb8b61
Expanded the already-abbreviated "initialise" and "specification" commands...
Richard Jones <richard@users.sourceforge.net>
parents:
371
diff
changeset
|
230 def do_initialise(self, instance_home, args): |
|
3b9410cb8b61
Expanded the already-abbreviated "initialise" and "specification" commands...
Richard Jones <richard@users.sourceforge.net>
parents:
371
diff
changeset
|
231 '''Usage: initialise [template [backend [admin password]]] |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
232 Initialise a new Roundup instance. |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
233 |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
234 The command will prompt for the instance home directory (if not supplied |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
235 through INSTANCE_HOME or the -i option. The template, backend and admin |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
236 password may be specified on the command-line as arguments, in that |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
237 order. |
|
291
ee7705d7bb06
More help in admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
287
diff
changeset
|
238 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
239 See also initopts help. |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
240 ''' |
|
438
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
241 if len(args) < 1: |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
242 raise UsageError, 'Not enough arguments supplied' |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
243 # select template |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
244 import roundup.templates |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
245 templates = roundup.templates.listTemplates() |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
246 template = len(args) > 1 and args[1] or '' |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
247 if template not in templates: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
248 print 'Templates:', ', '.join(templates) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
249 while template not in templates: |
|
354
f90abe9e811d
Fixed newuser_action so it sets the cookie with the unencrypted password.
Richard Jones <richard@users.sourceforge.net>
parents:
318
diff
changeset
|
250 template = raw_input('Select template [classic]: ').strip() |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
251 if not template: |
|
354
f90abe9e811d
Fixed newuser_action so it sets the cookie with the unencrypted password.
Richard Jones <richard@users.sourceforge.net>
parents:
318
diff
changeset
|
252 template = 'classic' |
|
291
ee7705d7bb06
More help in admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
287
diff
changeset
|
253 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
254 import roundup.backends |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
255 backends = roundup.backends.__all__ |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
256 backend = len(args) > 2 and args[2] or '' |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
257 if backend not in backends: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
258 print 'Back ends:', ', '.join(backends) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
259 while backend not in backends: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
260 backend = raw_input('Select backend [anydbm]: ').strip() |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
261 if not backend: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
262 backend = 'anydbm' |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
263 if len(args) > 3: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
264 adminpw = confirm = args[3] |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
265 else: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
266 adminpw = '' |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
267 confirm = 'x' |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
268 while adminpw != confirm: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
269 adminpw = getpass.getpass('Admin Password: ') |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
270 confirm = getpass.getpass(' Confirm: ') |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
271 init.init(instance_home, template, backend, adminpw) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
272 return 0 |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
273 |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
274 |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
275 def do_get(self, args): |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
276 '''Usage: get property designator[,designator]* |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
277 Get the given property of one or more designator(s). |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
278 |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
279 Retrieves the property value of the nodes specified by the designators. |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
280 ''' |
|
438
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
281 if len(args) < 2: |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
282 raise UsageError, 'Not enough arguments supplied' |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
283 propname = args[0] |
|
455
2198e5445d6b
Some cleanups in roundup-admin, also made it work again...
Richard Jones <richard@users.sourceforge.net>
parents:
449
diff
changeset
|
284 designators = args[1].split(',') |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
285 l = [] |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
286 for designator in designators: |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
287 # decode the node designator |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
308
diff
changeset
|
288 try: |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
308
diff
changeset
|
289 classname, nodeid = roundupdb.splitDesignator(designator) |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
308
diff
changeset
|
290 except roundupdb.DesignatorError, message: |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
291 raise UsageError, message |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
292 |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
293 # get the class |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
294 try: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
295 cl = self.db.getclass(classname) |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
296 except KeyError: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
297 raise UsageError, 'invalid class "%s"'%classname |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
298 try: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
299 if self.comma_sep: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
300 l.append(cl.get(nodeid, propname)) |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
301 else: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
302 print cl.get(nodeid, propname) |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
303 except IndexError: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
304 raise UsageError, 'no such %s node "%s"'%(classname, nodeid) |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
305 except KeyError: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
306 raise UsageError, 'no such %s property "%s"'%(classname, |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
307 propname) |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
308 if self.comma_sep: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
309 print ','.join(l) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
310 return 0 |
|
291
ee7705d7bb06
More help in admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
287
diff
changeset
|
311 |
|
ee7705d7bb06
More help in admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
287
diff
changeset
|
312 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
313 def do_set(self, args): |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
314 '''Usage: set designator[,designator]* propname=value ... |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
315 Set the given property of one or more designator(s). |
|
291
ee7705d7bb06
More help in admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
287
diff
changeset
|
316 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
317 Sets the property to the value for all designators given. |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
318 ''' |
|
438
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
319 if len(args) < 2: |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
320 raise UsageError, 'Not enough arguments supplied' |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
321 from roundup import hyperdb |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
322 |
|
455
2198e5445d6b
Some cleanups in roundup-admin, also made it work again...
Richard Jones <richard@users.sourceforge.net>
parents:
449
diff
changeset
|
323 designators = args[0].split(',') |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
324 props = {} |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
325 for prop in args[1:]: |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
326 if prop.find('=') == -1: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
327 raise UsageError, 'argument "%s" not propname=value'%prop |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
328 try: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
329 key, value = prop.split('=') |
|
379
c7b5b1aa6b4a
More error handling fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
377
diff
changeset
|
330 except ValueError: |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
331 raise UsageError, 'argument "%s" not propname=value'%prop |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
332 props[key] = value |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
333 for designator in designators: |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
334 # decode the node designator |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
308
diff
changeset
|
335 try: |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
308
diff
changeset
|
336 classname, nodeid = roundupdb.splitDesignator(designator) |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
308
diff
changeset
|
337 except roundupdb.DesignatorError, message: |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
338 raise UsageError, message |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
339 |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
340 # get the class |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
341 try: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
342 cl = self.db.getclass(classname) |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
343 except KeyError: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
344 raise UsageError, 'invalid class "%s"'%classname |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
345 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
346 properties = cl.getprops() |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
347 for key, value in props.items(): |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
397
diff
changeset
|
348 proptype = properties[key] |
|
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
397
diff
changeset
|
349 if isinstance(proptype, hyperdb.String): |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
350 continue |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
397
diff
changeset
|
351 elif isinstance(proptype, hyperdb.Password): |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
352 props[key] = password.Password(value) |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
397
diff
changeset
|
353 elif isinstance(proptype, hyperdb.Date): |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
354 try: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
355 props[key] = date.Date(value) |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
356 except ValueError, message: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
357 raise UsageError, '"%s": %s'%(value, message) |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
397
diff
changeset
|
358 elif isinstance(proptype, hyperdb.Interval): |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
359 try: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
360 props[key] = date.Interval(value) |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
361 except ValueError, message: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
362 raise UsageError, '"%s": %s'%(value, message) |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
397
diff
changeset
|
363 elif isinstance(proptype, hyperdb.Link): |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
364 props[key] = value |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
397
diff
changeset
|
365 elif isinstance(proptype, hyperdb.Multilink): |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
366 props[key] = value.split(',') |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
367 |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
368 # try the set |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
369 try: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
370 apply(cl.set, (nodeid, ), props) |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
371 except (TypeError, IndexError, ValueError), message: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
372 raise UsageError, message |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
373 return 0 |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
374 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
375 def do_find(self, args): |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
376 '''Usage: find classname propname=value ... |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
377 Find the nodes of the given class with a given link property value. |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
378 |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
379 Find the nodes of the given class with a given link property value. The |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
380 value may be either the nodeid of the linked node, or its key value. |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
381 ''' |
|
438
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
382 if len(args) < 1: |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
383 raise UsageError, 'Not enough arguments supplied' |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
384 classname = args[0] |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
385 # get the class |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
386 try: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
387 cl = self.db.getclass(classname) |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
388 except KeyError: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
389 raise UsageError, 'invalid class "%s"'%classname |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
390 |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
391 # TODO: handle > 1 argument |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
392 # handle the propname=value argument |
|
397
d47818b09265
more new property handling
Richard Jones <richard@users.sourceforge.net>
parents:
386
diff
changeset
|
393 if args[1].find('=') == -1: |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
394 raise UsageError, 'argument "%s" not propname=value'%prop |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
395 try: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
396 propname, value = args[1].split('=') |
|
379
c7b5b1aa6b4a
More error handling fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
377
diff
changeset
|
397 except ValueError: |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
398 raise UsageError, 'argument "%s" not propname=value'%prop |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
399 |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
400 # if the value isn't a number, look up the linked class to get the |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
401 # number |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
402 num_re = re.compile('^\d+$') |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
403 if not num_re.match(value): |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
404 # get the property |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
405 try: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
406 property = cl.properties[propname] |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
407 except KeyError: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
408 raise UsageError, '%s has no property "%s"'%(classname, |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
409 propname) |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
410 |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
411 # make sure it's a link |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
412 if (not isinstance(property, hyperdb.Link) and not |
| 418 | 413 isinstance(property, hyperdb.Multilink)): |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
414 raise UsageError, 'You may only "find" link properties' |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
415 |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
416 # get the linked-to class and look up the key property |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
417 link_class = self.db.getclass(property.classname) |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
418 try: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
419 value = link_class.lookup(value) |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
420 except TypeError: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
421 raise UsageError, '%s has no key property"'%link_class.classname |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
422 except KeyError: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
423 raise UsageError, '%s has no entry "%s"'%(link_class.classname, |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
424 propname) |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
425 |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
426 # now do the find |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
427 try: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
428 if self.comma_sep: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
429 print ','.join(apply(cl.find, (), {propname: value})) |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
430 else: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
431 print apply(cl.find, (), {propname: value}) |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
432 except KeyError: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
433 raise UsageError, '%s has no property "%s"'%(classname, |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
434 propname) |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
435 except (ValueError, TypeError), message: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
436 raise UsageError, message |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
437 return 0 |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
438 |
|
372
3b9410cb8b61
Expanded the already-abbreviated "initialise" and "specification" commands...
Richard Jones <richard@users.sourceforge.net>
parents:
371
diff
changeset
|
439 def do_specification(self, args): |
|
3b9410cb8b61
Expanded the already-abbreviated "initialise" and "specification" commands...
Richard Jones <richard@users.sourceforge.net>
parents:
371
diff
changeset
|
440 '''Usage: specification classname |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
441 Show the properties for a classname. |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
442 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
443 This lists the properties for a given class. |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
444 ''' |
|
438
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
445 if len(args) < 1: |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
446 raise UsageError, 'Not enough arguments supplied' |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
447 classname = args[0] |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
448 # get the class |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
449 try: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
450 cl = self.db.getclass(classname) |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
451 except KeyError: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
452 raise UsageError, 'invalid class "%s"'%classname |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
453 |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
454 # get the key property |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
455 keyprop = cl.getkey() |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
456 for key, value in cl.properties.items(): |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
457 if keyprop == key: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
458 print '%s: %s (key property)'%(key, value) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
459 else: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
460 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
|
461 |
|
438
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
462 def do_display(self, args): |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
463 '''Usage: display designator |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
464 Show the property values for the given node. |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
465 |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
466 This lists the properties and their associated values for the given |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
467 node. |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
468 ''' |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
469 if len(args) < 1: |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
470 raise UsageError, 'Not enough arguments supplied' |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
471 |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
472 # decode the node designator |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
473 try: |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
474 classname, nodeid = roundupdb.splitDesignator(args[0]) |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
475 except roundupdb.DesignatorError, message: |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
476 raise UsageError, message |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
477 |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
478 # get the class |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
479 try: |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
480 cl = self.db.getclass(classname) |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
481 except KeyError: |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
482 raise UsageError, 'invalid class "%s"'%classname |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
483 |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
484 # display the values |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
485 for key in cl.properties.keys(): |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
486 value = cl.get(nodeid, key) |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
487 print '%s: %s'%(key, value) |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
488 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
489 def do_create(self, args): |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
490 '''Usage: create classname property=value ... |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
491 Create a new entry of a given class. |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
492 |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
493 This creates a new entry of the given class using the property |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
494 name=value arguments provided on the command line after the "create" |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
495 command. |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
496 ''' |
|
438
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
497 if len(args) < 1: |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
498 raise UsageError, 'Not enough arguments supplied' |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
499 from roundup import hyperdb |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
500 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
501 classname = args[0] |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
502 |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
503 # get the class |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
504 try: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
505 cl = self.db.getclass(classname) |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
506 except KeyError: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
507 raise UsageError, 'invalid class "%s"'%classname |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
508 |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
509 # now do a create |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
510 props = {} |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
511 properties = cl.getprops(protected = 0) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
512 if len(args) == 1: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
513 # ask for the properties |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
514 for key, value in properties.items(): |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
515 if key == 'id': continue |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
516 name = value.__class__.__name__ |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
517 if isinstance(value , hyperdb.Password): |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
518 again = None |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
519 while value != again: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
520 value = getpass.getpass('%s (Password): '%key.capitalize()) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
521 again = getpass.getpass(' %s (Again): '%key.capitalize()) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
522 if value != again: print 'Sorry, try again...' |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
523 if value: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
524 props[key] = value |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
525 else: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
526 value = raw_input('%s (%s): '%(key.capitalize(), name)) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
527 if value: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
528 props[key] = value |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
529 else: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
530 # use the args |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
531 for prop in args[1:]: |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
532 if prop.find('=') == -1: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
533 raise UsageError, 'argument "%s" not propname=value'%prop |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
534 try: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
535 key, value = prop.split('=') |
|
379
c7b5b1aa6b4a
More error handling fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
377
diff
changeset
|
536 except ValueError: |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
537 raise UsageError, 'argument "%s" not propname=value'%prop |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
538 props[key] = value |
|
235
d7d358408537
added missing 'import' statements.
Anthony Baxter <anthonybaxter@users.sourceforge.net>
parents:
224
diff
changeset
|
539 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
540 # convert types |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
541 for key in props.keys(): |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
542 # get the property |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
543 try: |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
397
diff
changeset
|
544 proptype = properties[key] |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
545 except KeyError: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
546 raise UsageError, '%s has no property "%s"'%(classname, key) |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
547 |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
397
diff
changeset
|
548 if isinstance(proptype, hyperdb.Date): |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
549 try: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
550 props[key] = date.Date(value) |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
551 except ValueError, message: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
552 raise UsageError, '"%s": %s'%(value, message) |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
397
diff
changeset
|
553 elif isinstance(proptype, hyperdb.Interval): |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
554 try: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
555 props[key] = date.Interval(value) |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
556 except ValueError, message: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
557 raise UsageError, '"%s": %s'%(value, message) |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
397
diff
changeset
|
558 elif isinstance(proptype, hyperdb.Password): |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
559 props[key] = password.Password(value) |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
397
diff
changeset
|
560 elif isinstance(proptype, hyperdb.Multilink): |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
561 props[key] = value.split(',') |
|
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
562 |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
563 # check for the key property |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
564 if cl.getkey() and not props.has_key(cl.getkey()): |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
565 raise UsageError, "you must provide the '%s' property."%cl.getkey() |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
566 |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
567 # do the actual create |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
568 try: |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
569 print apply(cl.create, (), props) |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
570 except (TypeError, IndexError, ValueError), message: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
571 raise UsageError, message |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
572 return 0 |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
573 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
574 def do_list(self, args): |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
575 '''Usage: list classname [property] |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
576 List the instances of a class. |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
577 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
578 Lists all instances of the given class. If the property is not |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
579 specified, the "label" property is used. The label property is tried |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
580 in order: the key, "name", "title" and then the first property, |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
581 alphabetically. |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
582 ''' |
|
438
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
583 if len(args) < 1: |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
584 raise UsageError, 'Not enough arguments supplied' |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
585 classname = args[0] |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
586 |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
587 # get the class |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
588 try: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
589 cl = self.db.getclass(classname) |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
590 except KeyError: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
591 raise UsageError, 'invalid class "%s"'%classname |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
592 |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
593 # figure the property |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
594 if len(args) > 1: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
595 key = args[1] |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
596 else: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
597 key = cl.labelprop() |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
598 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
599 if self.comma_sep: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
600 print ','.join(cl.list()) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
601 else: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
602 for nodeid in cl.list(): |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
603 try: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
604 value = cl.get(nodeid, key) |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
605 except KeyError: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
606 raise UsageError, '%s has no property "%s"'%(classname, key) |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
607 print "%4s: %s"%(nodeid, value) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
608 return 0 |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
609 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
610 def do_table(self, args): |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
611 '''Usage: table classname [property[,property]*] |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
612 List the instances of a class in tabular form. |
|
299
fd9835c1e58d
Did a fair bit of work on the admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
298
diff
changeset
|
613 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
614 Lists all instances of the given class. If the properties are not |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
615 specified, all properties are displayed. By default, the column widths |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
616 are the width of the property names. The width may be explicitly defined |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
617 by defining the property as "name:width". For example:: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
618 roundup> table priority id,name:10 |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
619 Id Name |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
620 1 fatal-bug |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
621 2 bug |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
622 3 usability |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
623 4 feature |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
624 ''' |
|
438
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
625 if len(args) < 1: |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
626 raise UsageError, 'Not enough arguments supplied' |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
627 classname = args[0] |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
628 |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
629 # get the class |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
630 try: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
631 cl = self.db.getclass(classname) |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
632 except KeyError: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
633 raise UsageError, 'invalid class "%s"'%classname |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
634 |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
635 # figure the property names to display |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
636 if len(args) > 1: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
637 prop_names = args[1].split(',') |
|
445
208697858c8b
Message author's name appears in From: instead of roundup instance name
Richard Jones <richard@users.sourceforge.net>
parents:
438
diff
changeset
|
638 all_props = cl.getprops() |
|
474
ef06a66a0b72
[SF#496360] table width does not work
Richard Jones <richard@users.sourceforge.net>
parents:
472
diff
changeset
|
639 for spec in prop_names: |
|
ef06a66a0b72
[SF#496360] table width does not work
Richard Jones <richard@users.sourceforge.net>
parents:
472
diff
changeset
|
640 if ':' in spec: |
|
ef06a66a0b72
[SF#496360] table width does not work
Richard Jones <richard@users.sourceforge.net>
parents:
472
diff
changeset
|
641 try: |
|
ef06a66a0b72
[SF#496360] table width does not work
Richard Jones <richard@users.sourceforge.net>
parents:
472
diff
changeset
|
642 name, width = spec.split(':') |
|
ef06a66a0b72
[SF#496360] table width does not work
Richard Jones <richard@users.sourceforge.net>
parents:
472
diff
changeset
|
643 except (ValueError, TypeError): |
|
ef06a66a0b72
[SF#496360] table width does not work
Richard Jones <richard@users.sourceforge.net>
parents:
472
diff
changeset
|
644 raise UsageError, '"%s" not name:width'%spec |
|
ef06a66a0b72
[SF#496360] table width does not work
Richard Jones <richard@users.sourceforge.net>
parents:
472
diff
changeset
|
645 else: |
|
ef06a66a0b72
[SF#496360] table width does not work
Richard Jones <richard@users.sourceforge.net>
parents:
472
diff
changeset
|
646 name = spec |
|
ef06a66a0b72
[SF#496360] table width does not work
Richard Jones <richard@users.sourceforge.net>
parents:
472
diff
changeset
|
647 if not all_props.has_key(name): |
|
445
208697858c8b
Message author's name appears in From: instead of roundup instance name
Richard Jones <richard@users.sourceforge.net>
parents:
438
diff
changeset
|
648 raise UsageError, '%s has no property "%s"'%(classname, |
|
474
ef06a66a0b72
[SF#496360] table width does not work
Richard Jones <richard@users.sourceforge.net>
parents:
472
diff
changeset
|
649 name) |
|
299
fd9835c1e58d
Did a fair bit of work on the admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
298
diff
changeset
|
650 else: |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
651 prop_names = cl.getprops().keys() |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
652 |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
653 # now figure column widths |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
654 props = [] |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
655 for spec in prop_names: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
656 if ':' in spec: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
657 try: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
658 name, width = spec.split(':') |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
659 except (ValueError, TypeError): |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
660 raise UsageError, '"%s" not name:width'%spec |
|
474
ef06a66a0b72
[SF#496360] table width does not work
Richard Jones <richard@users.sourceforge.net>
parents:
472
diff
changeset
|
661 props.append((name, int(width))) |
|
299
fd9835c1e58d
Did a fair bit of work on the admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
298
diff
changeset
|
662 else: |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
663 props.append((spec, len(spec))) |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
664 |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
665 # now display the heading |
|
474
ef06a66a0b72
[SF#496360] table width does not work
Richard Jones <richard@users.sourceforge.net>
parents:
472
diff
changeset
|
666 print ' '.join([name.capitalize().ljust(width) for name,width in props]) |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
667 |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
668 # and the table data |
|
278
a5dabf2430c5
Added database importing and exporting through CSV files.
Richard Jones <richard@users.sourceforge.net>
parents:
274
diff
changeset
|
669 for nodeid in cl.list(): |
|
299
fd9835c1e58d
Did a fair bit of work on the admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
298
diff
changeset
|
670 l = [] |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
671 for name, width in props: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
672 if name != 'id': |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
673 try: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
674 value = str(cl.get(nodeid, name)) |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
675 except KeyError: |
|
445
208697858c8b
Message author's name appears in From: instead of roundup instance name
Richard Jones <richard@users.sourceforge.net>
parents:
438
diff
changeset
|
676 # we already checked if the property is valid - a |
|
208697858c8b
Message author's name appears in From: instead of roundup instance name
Richard Jones <richard@users.sourceforge.net>
parents:
438
diff
changeset
|
677 # KeyError here means the node just doesn't have a |
|
208697858c8b
Message author's name appears in From: instead of roundup instance name
Richard Jones <richard@users.sourceforge.net>
parents:
438
diff
changeset
|
678 # value for it |
|
208697858c8b
Message author's name appears in From: instead of roundup instance name
Richard Jones <richard@users.sourceforge.net>
parents:
438
diff
changeset
|
679 value = '' |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
680 else: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
681 value = str(nodeid) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
682 f = '%%-%ds'%width |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
683 l.append(f%value[:width]) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
684 print ' '.join(l) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
685 return 0 |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
686 |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
687 def do_history(self, args): |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
688 '''Usage: history designator |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
689 Show the history entries of a designator. |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
690 |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
691 Lists the journal entries for the node identified by the designator. |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
692 ''' |
|
438
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
693 if len(args) < 1: |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
694 raise UsageError, 'Not enough arguments supplied' |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
308
diff
changeset
|
695 try: |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
308
diff
changeset
|
696 classname, nodeid = roundupdb.splitDesignator(args[0]) |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
308
diff
changeset
|
697 except roundupdb.DesignatorError, message: |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
698 raise UsageError, message |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
699 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
700 # TODO: handle the -c option? |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
701 try: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
702 print self.db.getclass(classname).history(nodeid) |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
703 except KeyError: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
704 raise UsageError, 'no such class "%s"'%classname |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
705 except IndexError: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
706 raise UsageError, 'no such %s node "%s"'%(classname, nodeid) |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
707 return 0 |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
708 |
|
431
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
709 def do_commit(self, args): |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
710 '''Usage: commit |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
711 Commit all changes made to the database. |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
712 |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
713 The changes made during an interactive session are not |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
714 automatically written to the database - they must be committed |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
715 using this command. |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
716 |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
717 One-off commands on the command-line are automatically committed if |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
718 they are successful. |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
719 ''' |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
720 self.db.commit() |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
721 return 0 |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
722 |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
723 def do_rollback(self, args): |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
724 '''Usage: rollback |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
725 Undo all changes that are pending commit to the database. |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
726 |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
727 The changes made during an interactive session are not |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
728 automatically written to the database - they must be committed |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
729 manually. This command undoes all those changes, so a commit |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
730 immediately after would make no changes to the database. |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
731 ''' |
|
438
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
732 self.db.rollback() |
|
431
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
733 return 0 |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
734 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
735 def do_retire(self, args): |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
736 '''Usage: retire designator[,designator]* |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
737 Retire the node specified by designator. |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
738 |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
739 This action indicates that a particular node is not to be retrieved by |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
740 the list or find commands, and its key value may be re-used. |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
741 ''' |
|
438
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
742 if len(args) < 1: |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
743 raise UsageError, 'Not enough arguments supplied' |
|
455
2198e5445d6b
Some cleanups in roundup-admin, also made it work again...
Richard Jones <richard@users.sourceforge.net>
parents:
449
diff
changeset
|
744 designators = args[0].split(',') |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
745 for designator in designators: |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
308
diff
changeset
|
746 try: |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
308
diff
changeset
|
747 classname, nodeid = roundupdb.splitDesignator(designator) |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
308
diff
changeset
|
748 except roundupdb.DesignatorError, message: |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
749 raise UsageError, message |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
750 try: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
751 self.db.getclass(classname).retire(nodeid) |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
752 except KeyError: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
753 raise UsageError, 'no such class "%s"'%classname |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
754 except IndexError: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
755 raise UsageError, 'no such %s node "%s"'%(classname, nodeid) |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
756 return 0 |
|
299
fd9835c1e58d
Did a fair bit of work on the admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
298
diff
changeset
|
757 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
758 def do_export(self, args): |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
759 '''Usage: export class[,class] destination_dir |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
760 Export the database to tab-separated-value files. |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
761 |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
762 This action exports the current data from the database into |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
763 tab-separated-value files that are placed in the nominated destination |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
764 directory. The journals are not exported. |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
765 ''' |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
766 if len(args) < 2: |
|
438
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
767 raise UsageError, 'Not enough arguments supplied' |
|
455
2198e5445d6b
Some cleanups in roundup-admin, also made it work again...
Richard Jones <richard@users.sourceforge.net>
parents:
449
diff
changeset
|
768 classes = args[0].split(',') |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
769 dir = args[1] |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
770 |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
771 # use the csv parser if we can - it's faster |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
772 if csv is not None: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
773 p = csv.parser(field_sep=':') |
|
278
a5dabf2430c5
Added database importing and exporting through CSV files.
Richard Jones <richard@users.sourceforge.net>
parents:
274
diff
changeset
|
774 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
775 # do all the classes specified |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
776 for classname in classes: |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
777 try: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
778 cl = self.db.getclass(classname) |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
779 except KeyError: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
780 raise UsageError, 'no such class "%s"'%classname |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
781 f = open(os.path.join(dir, classname+'.csv'), 'w') |
|
455
2198e5445d6b
Some cleanups in roundup-admin, also made it work again...
Richard Jones <richard@users.sourceforge.net>
parents:
449
diff
changeset
|
782 f.write(':'.join(cl.properties.keys()) + '\n') |
|
278
a5dabf2430c5
Added database importing and exporting through CSV files.
Richard Jones <richard@users.sourceforge.net>
parents:
274
diff
changeset
|
783 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
784 # all nodes for this class |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
785 properties = cl.properties.items() |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
786 for nodeid in cl.list(): |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
787 l = [] |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
397
diff
changeset
|
788 for prop, proptype in properties: |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
789 value = cl.get(nodeid, prop) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
790 # convert data where needed |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
397
diff
changeset
|
791 if isinstance(proptype, hyperdb.Date): |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
792 value = value.get_tuple() |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
397
diff
changeset
|
793 elif isinstance(proptype, hyperdb.Interval): |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
794 value = value.get_tuple() |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
397
diff
changeset
|
795 elif isinstance(proptype, hyperdb.Password): |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
796 value = str(value) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
797 l.append(repr(value)) |
|
278
a5dabf2430c5
Added database importing and exporting through CSV files.
Richard Jones <richard@users.sourceforge.net>
parents:
274
diff
changeset
|
798 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
799 # now write |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
800 if csv is not None: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
801 f.write(p.join(l) + '\n') |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
802 else: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
803 # escape the individual entries to they're valid CSV |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
804 m = [] |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
805 for entry in l: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
806 if '"' in entry: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
807 entry = '""'.join(entry.split('"')) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
808 if ':' in entry: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
809 entry = '"%s"'%entry |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
810 m.append(entry) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
811 f.write(':'.join(m) + '\n') |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
812 return 0 |
|
278
a5dabf2430c5
Added database importing and exporting through CSV files.
Richard Jones <richard@users.sourceforge.net>
parents:
274
diff
changeset
|
813 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
814 def do_import(self, args): |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
815 '''Usage: import class file |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
816 Import the contents of the tab-separated-value file. |
|
278
a5dabf2430c5
Added database importing and exporting through CSV files.
Richard Jones <richard@users.sourceforge.net>
parents:
274
diff
changeset
|
817 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
818 The file must define the same properties as the class (including having |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
819 a "header" line with those property names.) The new nodes are added to |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
820 the existing database - if you want to create a new database using the |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
821 imported data, then create a new database (or, tediously, retire all |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
822 the old data.) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
823 ''' |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
824 if len(args) < 2: |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
825 raise UsageError, 'Not enough arguments supplied' |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
826 if csv is None: |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
827 raise UsageError, \ |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
828 'Sorry, you need the csv module to use this function.\n'\ |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
829 'Get it from: http://www.object-craft.com.au/projects/csv/' |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
830 |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
831 from roundup import hyperdb |
|
278
a5dabf2430c5
Added database importing and exporting through CSV files.
Richard Jones <richard@users.sourceforge.net>
parents:
274
diff
changeset
|
832 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
833 # ensure that the properties and the CSV file headings match |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
397
diff
changeset
|
834 classname = args[0] |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
835 try: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
836 cl = self.db.getclass(classname) |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
837 except KeyError: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
838 raise UsageError, 'no such class "%s"'%classname |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
839 f = open(args[1]) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
840 p = csv.parser(field_sep=':') |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
841 file_props = p.parse(f.readline()) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
842 props = cl.properties.keys() |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
843 m = file_props[:] |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
844 m.sort() |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
845 props.sort() |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
846 if m != props: |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
847 raise UsageError, 'Import file doesn\'t define the same '\ |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
848 'properties as "%s".'%args[0] |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
849 |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
850 # loop through the file and create a node for each entry |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
851 n = range(len(props)) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
852 while 1: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
853 line = f.readline() |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
854 if not line: break |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
855 |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
856 # parse lines until we get a complete entry |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
857 while 1: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
858 l = p.parse(line) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
859 if l: break |
|
278
a5dabf2430c5
Added database importing and exporting through CSV files.
Richard Jones <richard@users.sourceforge.net>
parents:
274
diff
changeset
|
860 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
861 # make the new node's property map |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
862 d = {} |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
863 for i in n: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
864 # Use eval to reverse the repr() used to output the CSV |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
865 value = eval(l[i]) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
866 # Figure the property for this column |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
867 key = file_props[i] |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
397
diff
changeset
|
868 proptype = cl.properties[key] |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
869 # Convert for property type |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
397
diff
changeset
|
870 if isinstance(proptype, hyperdb.Date): |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
871 value = date.Date(value) |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
397
diff
changeset
|
872 elif isinstance(proptype, hyperdb.Interval): |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
873 value = date.Interval(value) |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
397
diff
changeset
|
874 elif isinstance(proptype, hyperdb.Password): |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
875 pwd = password.Password() |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
876 pwd.unpack(value) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
877 value = pwd |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
878 if value is not None: |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
879 d[key] = value |
|
278
a5dabf2430c5
Added database importing and exporting through CSV files.
Richard Jones <richard@users.sourceforge.net>
parents:
274
diff
changeset
|
880 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
881 # and create the new node |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
882 apply(cl.create, (), d) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
883 return 0 |
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
884 |
|
296
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
885 def run_command(self, args): |
|
299
fd9835c1e58d
Did a fair bit of work on the admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
298
diff
changeset
|
886 '''Run a single command |
|
fd9835c1e58d
Did a fair bit of work on the admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
298
diff
changeset
|
887 ''' |
|
296
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
888 command = args[0] |
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
889 |
|
296
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
890 # handle help now |
|
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
891 if command == 'help': |
|
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
892 if len(args)>1: |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
893 self.do_help(args[1:]) |
|
296
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
894 return 0 |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
895 self.do_help(['help']) |
|
296
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
896 return 0 |
|
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
897 if command == 'morehelp': |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
898 self.do_help(['help']) |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
899 self.help_commands() |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
900 self.help_all() |
|
296
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
901 return 0 |
|
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
902 |
|
371
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
903 # figure what the command is |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
904 try: |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
905 functions = self.commands.get(command) |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
906 except KeyError: |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
907 # not a valid command |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
908 print 'Unknown command "%s" ("help commands" for a list)'%command |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
909 return 1 |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
910 |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
911 # check for multiple matches |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
912 if len(functions) > 1: |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
913 print 'Multiple commands match "%s": %s'%(command, |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
914 ', '.join([i[0] for i in functions])) |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
915 return 1 |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
916 command, function = functions[0] |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
917 |
|
296
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
918 # make sure we have an instance_home |
|
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
919 while not self.instance_home: |
|
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
920 self.instance_home = raw_input('Enter instance home: ').strip() |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
921 |
|
296
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
922 # before we open the db, we may be doing an init |
|
380
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
379
diff
changeset
|
923 if command == 'initialise': |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
379
diff
changeset
|
924 return self.do_initialise(self.instance_home, args) |
|
296
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
925 |
|
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
926 # get the instance |
|
380
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
379
diff
changeset
|
927 try: |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
379
diff
changeset
|
928 instance = roundup.instance.open(self.instance_home) |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
379
diff
changeset
|
929 except ValueError, message: |
|
438
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
930 self.instance_home = '' |
|
380
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
379
diff
changeset
|
931 print "Couldn't open instance: %s"%message |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
379
diff
changeset
|
932 return 1 |
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
933 |
|
438
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
934 # only open the database once! |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
935 if not self.db: |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
936 self.db = instance.open('admin') |
|
137
4a87e0b0d3f7
Made the "init" prompting more friendly.
Richard Jones <richard@users.sourceforge.net>
parents:
127
diff
changeset
|
937 |
|
296
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
938 # do the command |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
939 ret = 0 |
|
296
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
940 try: |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
941 ret = function(args[1:]) |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
942 except UsageError, message: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
943 print 'Error: %s'%message |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
944 print function.__doc__ |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
945 ret = 1 |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
946 except: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
947 import traceback |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
948 traceback.print_exc() |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
949 ret = 1 |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
950 return ret |
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
951 |
|
470
9f7320624bc2
Added better tokenising to roundup-admin - handles spaces and stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
461
diff
changeset
|
952 def interactive(self): |
|
296
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
953 '''Run in an interactive mode |
|
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
954 ''' |
|
298
07a64ec2a79d
Interactive startup blurb - need to figure how to get the version in there.
Richard Jones <richard@users.sourceforge.net>
parents:
297
diff
changeset
|
955 print 'Roundup {version} ready for input.' |
|
07a64ec2a79d
Interactive startup blurb - need to figure how to get the version in there.
Richard Jones <richard@users.sourceforge.net>
parents:
297
diff
changeset
|
956 print 'Type "help" for help.' |
|
297
1bbc16563d89
Now with readline support :)
Richard Jones <richard@users.sourceforge.net>
parents:
296
diff
changeset
|
957 try: |
|
1bbc16563d89
Now with readline support :)
Richard Jones <richard@users.sourceforge.net>
parents:
296
diff
changeset
|
958 import readline |
|
1bbc16563d89
Now with readline support :)
Richard Jones <richard@users.sourceforge.net>
parents:
296
diff
changeset
|
959 except ImportError: |
|
1bbc16563d89
Now with readline support :)
Richard Jones <richard@users.sourceforge.net>
parents:
296
diff
changeset
|
960 print "Note: command history and editing not available" |
|
1bbc16563d89
Now with readline support :)
Richard Jones <richard@users.sourceforge.net>
parents:
296
diff
changeset
|
961 |
|
296
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
962 while 1: |
|
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
963 try: |
|
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
964 command = raw_input('roundup> ') |
|
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
965 except EOFError: |
|
438
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
966 print 'exit...' |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
967 break |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
968 if not command: continue |
|
470
9f7320624bc2
Added better tokenising to roundup-admin - handles spaces and stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
461
diff
changeset
|
969 args = token.token_split(command) |
|
296
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
970 if not args: continue |
|
438
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
971 if args[0] in ('quit', 'exit'): break |
|
296
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
972 self.run_command(args) |
|
270
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
973 |
|
438
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
974 # exit.. check for transactions |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
975 if self.db and self.db.transactions: |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
976 commit = raw_input("There are unsaved changes. Commit them (y/N)? ") |
|
472
e18210e77a39
actually handle the advertised <cr> response to "commit y/N?"
Richard Jones <richard@users.sourceforge.net>
parents:
471
diff
changeset
|
977 if commit and commit[0].lower() == 'y': |
|
438
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
978 self.db.commit() |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
979 return 0 |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
980 |
|
296
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
981 def main(self): |
|
386
59ed29a879f6
Fixed option & associated error handling
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
380
diff
changeset
|
982 try: |
|
59ed29a879f6
Fixed option & associated error handling
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
380
diff
changeset
|
983 opts, args = getopt.getopt(sys.argv[1:], 'i:u:hc') |
|
59ed29a879f6
Fixed option & associated error handling
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
380
diff
changeset
|
984 except getopt.GetoptError, e: |
|
59ed29a879f6
Fixed option & associated error handling
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
380
diff
changeset
|
985 self.usage(str(e)) |
|
59ed29a879f6
Fixed option & associated error handling
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
380
diff
changeset
|
986 return 1 |
|
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
|
987 |
|
296
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
988 # handle command-line args |
|
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
989 self.instance_home = os.environ.get('ROUNDUP_INSTANCE', '') |
|
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
990 name = password = '' |
|
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
991 if os.environ.has_key('ROUNDUP_LOGIN'): |
|
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
992 l = os.environ['ROUNDUP_LOGIN'].split(':') |
|
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
993 name = l[0] |
|
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
994 if len(l) > 1: |
|
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
995 password = l[1] |
|
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
996 self.comma_sep = 0 |
|
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
997 for opt, arg in opts: |
|
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
998 if opt == '-h': |
|
386
59ed29a879f6
Fixed option & associated error handling
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
380
diff
changeset
|
999 self.usage() |
|
296
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
1000 return 0 |
|
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
1001 if opt == '-i': |
|
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
1002 self.instance_home = arg |
|
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
1003 if opt == '-c': |
|
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
1004 self.comma_sep = 1 |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
1005 |
|
296
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
1006 # if no command - go interactive |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
1007 ret = 0 |
|
296
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
1008 if not args: |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
1009 self.interactive() |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
1010 else: |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
1011 ret = self.run_command(args) |
|
430
350685601f37
Database transactions.
Richard Jones <richard@users.sourceforge.net>
parents:
418
diff
changeset
|
1012 if self.db: self.db.commit() |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
1013 return ret |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
1014 |
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1015 |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1016 if __name__ == '__main__': |
|
296
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
1017 tool = AdminTool() |
|
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
1018 sys.exit(tool.main()) |
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1019 |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1020 # |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1021 # $Log: not supported by cvs2svn $ |
|
474
ef06a66a0b72
[SF#496360] table width does not work
Richard Jones <richard@users.sourceforge.net>
parents:
472
diff
changeset
|
1022 # Revision 1.58 2001/12/31 05:12:52 richard |
|
ef06a66a0b72
[SF#496360] table width does not work
Richard Jones <richard@users.sourceforge.net>
parents:
472
diff
changeset
|
1023 # actually handle the advertised <cr> response to "commit y/N?" |
|
ef06a66a0b72
[SF#496360] table width does not work
Richard Jones <richard@users.sourceforge.net>
parents:
472
diff
changeset
|
1024 # |
|
472
e18210e77a39
actually handle the advertised <cr> response to "commit y/N?"
Richard Jones <richard@users.sourceforge.net>
parents:
471
diff
changeset
|
1025 # Revision 1.57 2001/12/31 05:12:01 richard |
|
e18210e77a39
actually handle the advertised <cr> response to "commit y/N?"
Richard Jones <richard@users.sourceforge.net>
parents:
471
diff
changeset
|
1026 # added some quoting instructions to roundup-admin |
|
e18210e77a39
actually handle the advertised <cr> response to "commit y/N?"
Richard Jones <richard@users.sourceforge.net>
parents:
471
diff
changeset
|
1027 # |
|
471
f51b017eff05
added some quoting instructions to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
470
diff
changeset
|
1028 # Revision 1.56 2001/12/31 05:09:20 richard |
|
f51b017eff05
added some quoting instructions to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
470
diff
changeset
|
1029 # Added better tokenising to roundup-admin - handles spaces and stuff. Can |
|
f51b017eff05
added some quoting instructions to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
470
diff
changeset
|
1030 # use quoting or backslashes. See the roundup.token pydoc. |
|
f51b017eff05
added some quoting instructions to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
470
diff
changeset
|
1031 # |
|
470
9f7320624bc2
Added better tokenising to roundup-admin - handles spaces and stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
461
diff
changeset
|
1032 # Revision 1.55 2001/12/17 03:52:47 richard |
|
9f7320624bc2
Added better tokenising to roundup-admin - handles spaces and stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
461
diff
changeset
|
1033 # Implemented file store rollback. As a bonus, the hyperdb is now capable of |
|
9f7320624bc2
Added better tokenising to roundup-admin - handles spaces and stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
461
diff
changeset
|
1034 # storing more than one file per node - if a property name is supplied, |
|
9f7320624bc2
Added better tokenising to roundup-admin - handles spaces and stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
461
diff
changeset
|
1035 # the file is called designator.property. |
|
9f7320624bc2
Added better tokenising to roundup-admin - handles spaces and stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
461
diff
changeset
|
1036 # I decided not to migrate the existing files stored over to the new naming |
|
9f7320624bc2
Added better tokenising to roundup-admin - handles spaces and stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
461
diff
changeset
|
1037 # scheme - the FileClass just doesn't specify the property name. |
|
9f7320624bc2
Added better tokenising to roundup-admin - handles spaces and stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
461
diff
changeset
|
1038 # |
|
461
b579418f7ed1
Implemented file store rollback.
Richard Jones <richard@users.sourceforge.net>
parents:
455
diff
changeset
|
1039 # Revision 1.54 2001/12/15 23:09:23 richard |
|
b579418f7ed1
Implemented file store rollback.
Richard Jones <richard@users.sourceforge.net>
parents:
455
diff
changeset
|
1040 # Some cleanups in roundup-admin, also made it work again... |
|
b579418f7ed1
Implemented file store rollback.
Richard Jones <richard@users.sourceforge.net>
parents:
455
diff
changeset
|
1041 # |
|
455
2198e5445d6b
Some cleanups in roundup-admin, also made it work again...
Richard Jones <richard@users.sourceforge.net>
parents:
449
diff
changeset
|
1042 # Revision 1.53 2001/12/13 00:20:00 richard |
|
2198e5445d6b
Some cleanups in roundup-admin, also made it work again...
Richard Jones <richard@users.sourceforge.net>
parents:
449
diff
changeset
|
1043 # . Centralised the python version check code, bumped version to 2.1.1 (really |
|
2198e5445d6b
Some cleanups in roundup-admin, also made it work again...
Richard Jones <richard@users.sourceforge.net>
parents:
449
diff
changeset
|
1044 # needs to be 2.1.2, but that isn't released yet :) |
|
2198e5445d6b
Some cleanups in roundup-admin, also made it work again...
Richard Jones <richard@users.sourceforge.net>
parents:
449
diff
changeset
|
1045 # |
|
449
141aacfdb34f
Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents:
445
diff
changeset
|
1046 # Revision 1.52 2001/12/12 21:47:45 richard |
|
141aacfdb34f
Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents:
445
diff
changeset
|
1047 # . Message author's name appears in From: instead of roundup instance name |
|
141aacfdb34f
Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents:
445
diff
changeset
|
1048 # (which still appears in the Reply-To:) |
|
141aacfdb34f
Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents:
445
diff
changeset
|
1049 # . envelope-from is now set to the roundup-admin and not roundup itself so |
|
141aacfdb34f
Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents:
445
diff
changeset
|
1050 # delivery reports aren't sent to roundup (thanks Patrick Ohly) |
|
141aacfdb34f
Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents:
445
diff
changeset
|
1051 # |
|
445
208697858c8b
Message author's name appears in From: instead of roundup instance name
Richard Jones <richard@users.sourceforge.net>
parents:
438
diff
changeset
|
1052 # Revision 1.51 2001/12/10 00:57:38 richard |
|
208697858c8b
Message author's name appears in From: instead of roundup instance name
Richard Jones <richard@users.sourceforge.net>
parents:
438
diff
changeset
|
1053 # From CHANGES: |
|
208697858c8b
Message author's name appears in From: instead of roundup instance name
Richard Jones <richard@users.sourceforge.net>
parents:
438
diff
changeset
|
1054 # . Added the "display" command to the admin tool - displays a node's values |
|
208697858c8b
Message author's name appears in From: instead of roundup instance name
Richard Jones <richard@users.sourceforge.net>
parents:
438
diff
changeset
|
1055 # . #489760 ] [issue] only subject |
|
208697858c8b
Message author's name appears in From: instead of roundup instance name
Richard Jones <richard@users.sourceforge.net>
parents:
438
diff
changeset
|
1056 # . fixed the doc/index.html to include the quoting in the mail alias. |
|
208697858c8b
Message author's name appears in From: instead of roundup instance name
Richard Jones <richard@users.sourceforge.net>
parents:
438
diff
changeset
|
1057 # |
|
208697858c8b
Message author's name appears in From: instead of roundup instance name
Richard Jones <richard@users.sourceforge.net>
parents:
438
diff
changeset
|
1058 # Also: |
|
208697858c8b
Message author's name appears in From: instead of roundup instance name
Richard Jones <richard@users.sourceforge.net>
parents:
438
diff
changeset
|
1059 # . fixed roundup-admin so it works with transactions |
|
208697858c8b
Message author's name appears in From: instead of roundup instance name
Richard Jones <richard@users.sourceforge.net>
parents:
438
diff
changeset
|
1060 # . disabled the back_anydbm module if anydbm tries to use dumbdbm |
|
208697858c8b
Message author's name appears in From: instead of roundup instance name
Richard Jones <richard@users.sourceforge.net>
parents:
438
diff
changeset
|
1061 # |
|
438
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
1062 # Revision 1.50 2001/12/02 05:06:16 richard |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
1063 # . We now use weakrefs in the Classes to keep the database reference, so |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
1064 # the close() method on the database is no longer needed. |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
1065 # I bumped the minimum python requirement up to 2.1 accordingly. |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
1066 # . #487480 ] roundup-server |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
1067 # . #487476 ] INSTALL.txt |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
1068 # |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
1069 # I also cleaned up the change message / post-edit stuff in the cgi client. |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
1070 # There's now a clearly marked "TODO: append the change note" where I believe |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
1071 # the change note should be added there. The "changes" list will obviously |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
1072 # have to be modified to be a dict of the changes, or somesuch. |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
1073 # |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
1074 # More testing needed. |
|
9d97c1a4ddad
Notes from changes.
Richard Jones <richard@users.sourceforge.net>
parents:
431
diff
changeset
|
1075 # |
|
431
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
1076 # Revision 1.49 2001/12/01 07:17:50 richard |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
1077 # . We now have basic transaction support! Information is only written to |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
1078 # the database when the commit() method is called. Only the anydbm |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
1079 # backend is modified in this way - neither of the bsddb backends have been. |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
1080 # The mail, admin and cgi interfaces all use commit (except the admin tool |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
1081 # doesn't have a commit command, so interactive users can't commit...) |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
1082 # . Fixed login/registration forwarding the user to the right page (or not, |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
1083 # on a failure) |
|
a28a80b714f9
Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents:
430
diff
changeset
|
1084 # |
|
430
350685601f37
Database transactions.
Richard Jones <richard@users.sourceforge.net>
parents:
418
diff
changeset
|
1085 # Revision 1.48 2001/11/27 22:32:03 richard |
|
350685601f37
Database transactions.
Richard Jones <richard@users.sourceforge.net>
parents:
418
diff
changeset
|
1086 # typo |
|
350685601f37
Database transactions.
Richard Jones <richard@users.sourceforge.net>
parents:
418
diff
changeset
|
1087 # |
| 418 | 1088 # Revision 1.47 2001/11/26 22:55:56 richard |
| 1089 # Feature: | |
| 1090 # . Added INSTANCE_NAME to configuration - used in web and email to identify | |
| 1091 # the instance. | |
| 1092 # . Added EMAIL_SIGNATURE_POSITION to indicate where to place the roundup | |
| 1093 # signature info in e-mails. | |
| 1094 # . Some more flexibility in the mail gateway and more error handling. | |
| 1095 # . Login now takes you to the page you back to the were denied access to. | |
| 1096 # | |
| 1097 # Fixed: | |
| 1098 # . Lots of bugs, thanks Roché and others on the devel mailing list! | |
| 1099 # | |
|
411
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
397
diff
changeset
|
1100 # Revision 1.46 2001/11/21 03:40:54 richard |
|
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
397
diff
changeset
|
1101 # more new property handling |
|
a6088556e9ba
Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
397
diff
changeset
|
1102 # |
|
397
d47818b09265
more new property handling
Richard Jones <richard@users.sourceforge.net>
parents:
386
diff
changeset
|
1103 # Revision 1.45 2001/11/12 22:51:59 jhermann |
|
d47818b09265
more new property handling
Richard Jones <richard@users.sourceforge.net>
parents:
386
diff
changeset
|
1104 # Fixed option & associated error handling |
|
d47818b09265
more new property handling
Richard Jones <richard@users.sourceforge.net>
parents:
386
diff
changeset
|
1105 # |
|
386
59ed29a879f6
Fixed option & associated error handling
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
380
diff
changeset
|
1106 # Revision 1.44 2001/11/12 22:01:06 richard |
|
59ed29a879f6
Fixed option & associated error handling
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
380
diff
changeset
|
1107 # Fixed issues with nosy reaction and author copies. |
|
59ed29a879f6
Fixed option & associated error handling
Jürgen Hermann <jhermann@users.sourceforge.net>
parents:
380
diff
changeset
|
1108 # |
|
380
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
379
diff
changeset
|
1109 # Revision 1.43 2001/11/09 22:33:28 richard |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
379
diff
changeset
|
1110 # More error handling fixes. |
|
a1331423eb93
Fixed issues with nosy reaction and author copies.
Richard Jones <richard@users.sourceforge.net>
parents:
379
diff
changeset
|
1111 # |
|
379
c7b5b1aa6b4a
More error handling fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
377
diff
changeset
|
1112 # Revision 1.42 2001/11/09 10:11:08 richard |
|
c7b5b1aa6b4a
More error handling fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
377
diff
changeset
|
1113 # . roundup-admin now handles all hyperdb exceptions |
|
c7b5b1aa6b4a
More error handling fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
377
diff
changeset
|
1114 # |
|
377
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
1115 # Revision 1.41 2001/11/09 01:25:40 richard |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
1116 # Should parse with python 1.5.2 now. |
|
93dc08528ad9
roundup-admin now handles all hyperdb exceptions
Richard Jones <richard@users.sourceforge.net>
parents:
376
diff
changeset
|
1117 # |
|
376
c6d6ea15068b
Should parse with python 1.5.2 now.
Richard Jones <richard@users.sourceforge.net>
parents:
372
diff
changeset
|
1118 # Revision 1.40 2001/11/08 04:42:00 richard |
|
c6d6ea15068b
Should parse with python 1.5.2 now.
Richard Jones <richard@users.sourceforge.net>
parents:
372
diff
changeset
|
1119 # Expanded the already-abbreviated "initialise" and "specification" commands, |
|
c6d6ea15068b
Should parse with python 1.5.2 now.
Richard Jones <richard@users.sourceforge.net>
parents:
372
diff
changeset
|
1120 # and added a comment to the command help about the abbreviation. |
|
c6d6ea15068b
Should parse with python 1.5.2 now.
Richard Jones <richard@users.sourceforge.net>
parents:
372
diff
changeset
|
1121 # |
|
372
3b9410cb8b61
Expanded the already-abbreviated "initialise" and "specification" commands...
Richard Jones <richard@users.sourceforge.net>
parents:
371
diff
changeset
|
1122 # Revision 1.39 2001/11/08 04:29:59 richard |
|
3b9410cb8b61
Expanded the already-abbreviated "initialise" and "specification" commands...
Richard Jones <richard@users.sourceforge.net>
parents:
371
diff
changeset
|
1123 # roundup-admin now accepts abbreviated commands (eg. l = li = lis = list) |
|
3b9410cb8b61
Expanded the already-abbreviated "initialise" and "specification" commands...
Richard Jones <richard@users.sourceforge.net>
parents:
371
diff
changeset
|
1124 # [thanks Engelbert Gruber for the inspiration] |
|
3b9410cb8b61
Expanded the already-abbreviated "initialise" and "specification" commands...
Richard Jones <richard@users.sourceforge.net>
parents:
371
diff
changeset
|
1125 # |
|
371
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
1126 # Revision 1.38 2001/11/05 23:45:40 richard |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
1127 # Fixed newuser_action so it sets the cookie with the unencrypted password. |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
1128 # Also made it present nicer error messages (not tracebacks). |
|
f348aa576d51
roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
Richard Jones <richard@users.sourceforge.net>
parents:
354
diff
changeset
|
1129 # |
|
354
f90abe9e811d
Fixed newuser_action so it sets the cookie with the unencrypted password.
Richard Jones <richard@users.sourceforge.net>
parents:
318
diff
changeset
|
1130 # Revision 1.37 2001/10/23 01:00:18 richard |
|
f90abe9e811d
Fixed newuser_action so it sets the cookie with the unencrypted password.
Richard Jones <richard@users.sourceforge.net>
parents:
318
diff
changeset
|
1131 # Re-enabled login and registration access after lopping them off via |
|
f90abe9e811d
Fixed newuser_action so it sets the cookie with the unencrypted password.
Richard Jones <richard@users.sourceforge.net>
parents:
318
diff
changeset
|
1132 # disabling access for anonymous users. |
|
f90abe9e811d
Fixed newuser_action so it sets the cookie with the unencrypted password.
Richard Jones <richard@users.sourceforge.net>
parents:
318
diff
changeset
|
1133 # Major re-org of the htmltemplate code, cleaning it up significantly. Fixed |
|
f90abe9e811d
Fixed newuser_action so it sets the cookie with the unencrypted password.
Richard Jones <richard@users.sourceforge.net>
parents:
318
diff
changeset
|
1134 # a couple of bugs while I was there. Probably introduced a couple, but |
|
f90abe9e811d
Fixed newuser_action so it sets the cookie with the unencrypted password.
Richard Jones <richard@users.sourceforge.net>
parents:
318
diff
changeset
|
1135 # things seem to work OK at the moment. |
|
f90abe9e811d
Fixed newuser_action so it sets the cookie with the unencrypted password.
Richard Jones <richard@users.sourceforge.net>
parents:
318
diff
changeset
|
1136 # |
|
318
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
308
diff
changeset
|
1137 # Revision 1.36 2001/10/21 00:45:15 richard |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
308
diff
changeset
|
1138 # Added author identification to e-mail messages from roundup. |
|
e18dd7227780
Re-enabled login and registration access...
Richard Jones <richard@users.sourceforge.net>
parents:
308
diff
changeset
|
1139 # |
|
308
e32af1eff4ea
Added author identification to e-mail messages from roundup.
Richard Jones <richard@users.sourceforge.net>
parents:
302
diff
changeset
|
1140 # Revision 1.35 2001/10/20 11:58:48 richard |
|
e32af1eff4ea
Added author identification to e-mail messages from roundup.
Richard Jones <richard@users.sourceforge.net>
parents:
302
diff
changeset
|
1141 # Catch errors in login - no username or password supplied. |
|
e32af1eff4ea
Added author identification to e-mail messages from roundup.
Richard Jones <richard@users.sourceforge.net>
parents:
302
diff
changeset
|
1142 # Fixed editing of password (Password property type) thanks Roch'e Compaan. |
|
e32af1eff4ea
Added author identification to e-mail messages from roundup.
Richard Jones <richard@users.sourceforge.net>
parents:
302
diff
changeset
|
1143 # |
|
302
d1fb3fcdb11b
Catch errors in login - no username or password supplied.
Richard Jones <richard@users.sourceforge.net>
parents:
301
diff
changeset
|
1144 # Revision 1.34 2001/10/18 02:16:42 richard |
|
d1fb3fcdb11b
Catch errors in login - no username or password supplied.
Richard Jones <richard@users.sourceforge.net>
parents:
301
diff
changeset
|
1145 # Oops, committed the admin script with the wierd #! line. |
|
d1fb3fcdb11b
Catch errors in login - no username or password supplied.
Richard Jones <richard@users.sourceforge.net>
parents:
301
diff
changeset
|
1146 # Also, made the thing into a class to reduce parameter passing. |
|
d1fb3fcdb11b
Catch errors in login - no username or password supplied.
Richard Jones <richard@users.sourceforge.net>
parents:
301
diff
changeset
|
1147 # Nuked the leading whitespace from the help __doc__ displays too. |
|
d1fb3fcdb11b
Catch errors in login - no username or password supplied.
Richard Jones <richard@users.sourceforge.net>
parents:
301
diff
changeset
|
1148 # |
|
301
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
1149 # Revision 1.33 2001/10/17 23:13:19 richard |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
1150 # Did a fair bit of work on the admin tool. Now has an extra command "table" |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
1151 # which displays node information in a tabular format. Also fixed import and |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
1152 # export so they work. Removed freshen. |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
1153 # Fixed quopri usage in mailgw from bug reports. |
|
7901b58cfae8
Oops, committed the admin script with the wierd #! line.
Richard Jones <richard@users.sourceforge.net>
parents:
299
diff
changeset
|
1154 # |
|
299
fd9835c1e58d
Did a fair bit of work on the admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
298
diff
changeset
|
1155 # Revision 1.32 2001/10/17 06:57:29 richard |
|
fd9835c1e58d
Did a fair bit of work on the admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
298
diff
changeset
|
1156 # Interactive startup blurb - need to figure how to get the version in there. |
|
fd9835c1e58d
Did a fair bit of work on the admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
298
diff
changeset
|
1157 # |
|
298
07a64ec2a79d
Interactive startup blurb - need to figure how to get the version in there.
Richard Jones <richard@users.sourceforge.net>
parents:
297
diff
changeset
|
1158 # Revision 1.31 2001/10/17 06:17:26 richard |
|
07a64ec2a79d
Interactive startup blurb - need to figure how to get the version in there.
Richard Jones <richard@users.sourceforge.net>
parents:
297
diff
changeset
|
1159 # Now with readline support :) |
|
07a64ec2a79d
Interactive startup blurb - need to figure how to get the version in there.
Richard Jones <richard@users.sourceforge.net>
parents:
297
diff
changeset
|
1160 # |
|
297
1bbc16563d89
Now with readline support :)
Richard Jones <richard@users.sourceforge.net>
parents:
296
diff
changeset
|
1161 # Revision 1.30 2001/10/17 06:04:00 richard |
|
1bbc16563d89
Now with readline support :)
Richard Jones <richard@users.sourceforge.net>
parents:
296
diff
changeset
|
1162 # Beginnings of an interactive mode for roundup-admin |
|
1bbc16563d89
Now with readline support :)
Richard Jones <richard@users.sourceforge.net>
parents:
296
diff
changeset
|
1163 # |
|
296
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
1164 # Revision 1.29 2001/10/16 03:48:01 richard |
|
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
1165 # admin tool now complains if a "find" is attempted with a non-link property. |
|
e155eca83f40
Beginnings of an interactive mode for roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
294
diff
changeset
|
1166 # |
|
294
49be38bb6e9a
admin tool now complains if a "find" is attempted with a non-link property.
Richard Jones <richard@users.sourceforge.net>
parents:
291
diff
changeset
|
1167 # Revision 1.28 2001/10/13 00:07:39 richard |
|
49be38bb6e9a
admin tool now complains if a "find" is attempted with a non-link property.
Richard Jones <richard@users.sourceforge.net>
parents:
291
diff
changeset
|
1168 # More help in admin tool. |
|
49be38bb6e9a
admin tool now complains if a "find" is attempted with a non-link property.
Richard Jones <richard@users.sourceforge.net>
parents:
291
diff
changeset
|
1169 # |
|
291
ee7705d7bb06
More help in admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
287
diff
changeset
|
1170 # Revision 1.27 2001/10/11 23:43:04 richard |
|
ee7705d7bb06
More help in admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
287
diff
changeset
|
1171 # Implemented the comma-separated printing option in the admin tool. |
|
ee7705d7bb06
More help in admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
287
diff
changeset
|
1172 # Fixed a typo (more of a vim-o actually :) in mailgw. |
|
ee7705d7bb06
More help in admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
287
diff
changeset
|
1173 # |
|
287
ee2f4cb160bd
Implemented the comma-separated printing option in the admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
285
diff
changeset
|
1174 # Revision 1.26 2001/10/11 05:03:51 richard |
|
ee2f4cb160bd
Implemented the comma-separated printing option in the admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
285
diff
changeset
|
1175 # Marked the roundup-admin import/export as experimental since they're not fully |
|
ee2f4cb160bd
Implemented the comma-separated printing option in the admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
285
diff
changeset
|
1176 # operational. |
|
ee2f4cb160bd
Implemented the comma-separated printing option in the admin tool.
Richard Jones <richard@users.sourceforge.net>
parents:
285
diff
changeset
|
1177 # |
|
285
a6e3a9164814
Marked the roundup-admin import/export as experimental...
Richard Jones <richard@users.sourceforge.net>
parents:
280
diff
changeset
|
1178 # Revision 1.25 2001/10/10 04:12:32 richard |
|
a6e3a9164814
Marked the roundup-admin import/export as experimental...
Richard Jones <richard@users.sourceforge.net>
parents:
280
diff
changeset
|
1179 # The setup.cfg file is just causing pain. Away it goes. |
|
a6e3a9164814
Marked the roundup-admin import/export as experimental...
Richard Jones <richard@users.sourceforge.net>
parents:
280
diff
changeset
|
1180 # |
|
280
80ad2bf9cf7b
The setup.cfg file is just causing pain. Away it goes.
Richard Jones <richard@users.sourceforge.net>
parents:
278
diff
changeset
|
1181 # Revision 1.24 2001/10/10 03:54:57 richard |
|
80ad2bf9cf7b
The setup.cfg file is just causing pain. Away it goes.
Richard Jones <richard@users.sourceforge.net>
parents:
278
diff
changeset
|
1182 # Added database importing and exporting through CSV files. |
|
80ad2bf9cf7b
The setup.cfg file is just causing pain. Away it goes.
Richard Jones <richard@users.sourceforge.net>
parents:
278
diff
changeset
|
1183 # Uses the csv module from object-craft for exporting if it's available. |
|
80ad2bf9cf7b
The setup.cfg file is just causing pain. Away it goes.
Richard Jones <richard@users.sourceforge.net>
parents:
278
diff
changeset
|
1184 # Requires the csv module for importing. |
|
80ad2bf9cf7b
The setup.cfg file is just causing pain. Away it goes.
Richard Jones <richard@users.sourceforge.net>
parents:
278
diff
changeset
|
1185 # |
|
278
a5dabf2430c5
Added database importing and exporting through CSV files.
Richard Jones <richard@users.sourceforge.net>
parents:
274
diff
changeset
|
1186 # Revision 1.23 2001/10/09 23:36:25 richard |
|
a5dabf2430c5
Added database importing and exporting through CSV files.
Richard Jones <richard@users.sourceforge.net>
parents:
274
diff
changeset
|
1187 # Spit out command help if roundup-admin command doesn't get an argument. |
|
a5dabf2430c5
Added database importing and exporting through CSV files.
Richard Jones <richard@users.sourceforge.net>
parents:
274
diff
changeset
|
1188 # |
|
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
|
1189 # 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
|
1190 # 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
|
1191 # 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
|
1192 # |
|
270
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
1193 # 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
|
1194 # . 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
|
1195 # on the command-line. |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
1196 # . 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
|
1197 # properties. |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
1198 # . 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
|
1199 # 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
|
1200 # "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
|
1201 # 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
|
1202 # . 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
|
1203 # . 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
|
1204 # 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
|
1205 # 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
|
1206 # . 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
|
1207 # Ping - has been removed. |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
1208 # . 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
|
1209 # 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
|
1210 # . 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
|
1211 # an item now throws an exception. |
|
a4241ddd22d7
Added the Password property type.
Richard Jones <richard@users.sourceforge.net>
parents:
264
diff
changeset
|
1212 # |
|
264
a671e5917b33
Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
262
diff
changeset
|
1213 # 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
|
1214 # 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
|
1215 # 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
|
1216 # 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
|
1217 # 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
|
1218 # 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
|
1219 # properties (defaults to yes, which lists the immutables). |
|
a671e5917b33
Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents:
262
diff
changeset
|
1220 # |
|
262
ab921dc53ccd
Added nicer command-line item adding:
Richard Jones <richard@users.sourceforge.net>
parents:
261
diff
changeset
|
1221 # 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
|
1222 # 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
|
1223 # |
|
261
0ca5381a72b5
made do_get have the args in the correct order
Richard Jones <richard@users.sourceforge.net>
parents:
248
diff
changeset
|
1224 # 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
|
1225 # |
|
0ca5381a72b5
made do_get have the args in the correct order
Richard Jones <richard@users.sourceforge.net>
parents:
248
diff
changeset
|
1226 # 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
|
1227 # |
|
248
96cdd8ef0581
Added some more help to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
235
diff
changeset
|
1228 # 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
|
1229 # added missing 'import' statements. |
|
96cdd8ef0581
Added some more help to roundup-admin
Richard Jones <richard@users.sourceforge.net>
parents:
235
diff
changeset
|
1230 # |
|
235
d7d358408537
added missing 'import' statements.
Anthony Baxter <anthonybaxter@users.sourceforge.net>
parents:
224
diff
changeset
|
1231 # 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
|
1232 # using isinstance(blah, Foo) now instead of isFooType |
|
d7d358408537
added missing 'import' statements.
Anthony Baxter <anthonybaxter@users.sourceforge.net>
parents:
224
diff
changeset
|
1233 # |
|
224
ad2c98faec97
using isinstance(blah, Foo) now instead of isFooType
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
1234 # 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
|
1235 # stupid typo |
|
ad2c98faec97
using isinstance(blah, Foo) now instead of isFooType
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
1236 # |
| 214 | 1237 # Revision 1.14 2001/08/07 00:15:51 richard |
| 1238 # Added the copyright/license notice to (nearly) all files at request of | |
| 1239 # Bizar Software. | |
| 1240 # | |
|
213
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
204
diff
changeset
|
1241 # 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
|
1242 # 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
|
1243 # 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
|
1244 # |
|
204
c1461733cbf9
Instances are now opened by a special function...
Richard Jones <richard@users.sourceforge.net>
parents:
193
diff
changeset
|
1245 # 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
|
1246 # 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
|
1247 # |
|
193
241a0323aacb
Used the much nicer load_package, pointed out by Steve Majewski.
Richard Jones <richard@users.sourceforge.net>
parents:
190
diff
changeset
|
1248 # 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
|
1249 # 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
|
1250 # 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
|
1251 # names. |
|
241a0323aacb
Used the much nicer load_package, pointed out by Steve Majewski.
Richard Jones <richard@users.sourceforge.net>
parents:
190
diff
changeset
|
1252 # |
|
190
996eaf90c01e
Instance import now imports the instance using imp.load_module...
Richard Jones <richard@users.sourceforge.net>
parents:
167
diff
changeset
|
1253 # 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
|
1254 # 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
|
1255 # |
|
167
a49c8a2ddd26
Added time logging and file uploading to the templates.
Richard Jones <richard@users.sourceforge.net>
parents:
160
diff
changeset
|
1256 # 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
|
1257 # 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
|
1258 # |
|
160
002249ffa5d0
init help now lists templates and backends
Richard Jones <richard@users.sourceforge.net>
parents:
153
diff
changeset
|
1259 # 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
|
1260 # Freshen is really broken. Commented out. |
|
002249ffa5d0
init help now lists templates and backends
Richard Jones <richard@users.sourceforge.net>
parents:
153
diff
changeset
|
1261 # |
|
153
b07b9a5b6aa9
Freshen is really broken. Commented out.
Richard Jones <richard@users.sourceforge.net>
parents:
147
diff
changeset
|
1262 # 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
|
1263 # Bugfixes |
|
b07b9a5b6aa9
Freshen is really broken. Commented out.
Richard Jones <richard@users.sourceforge.net>
parents:
147
diff
changeset
|
1264 # |
| 147 | 1265 # Revision 1.6 2001/07/30 00:57:51 richard |
| 1266 # Now uses getopt, much improved command-line parsing. Much fuller help. Much | |
| 1267 # better internal structure. It's just BETTER. :) | |
| 1268 # | |
|
140
a4383d62a407
Now uses getopt, much improved command-line parsing.
Richard Jones <richard@users.sourceforge.net>
parents:
137
diff
changeset
|
1269 # 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
|
1270 # 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
|
1271 # |
|
137
4a87e0b0d3f7
Made the "init" prompting more friendly.
Richard Jones <richard@users.sourceforge.net>
parents:
127
diff
changeset
|
1272 # 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
|
1273 # 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
|
1274 # |
|
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
|
1275 # 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
|
1276 # 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
|
1277 # 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
|
1278 # _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
|
1279 # |
|
51
3a7e5515c1bd
ok, so now "./roundup-admin init" will ask questions...
Richard Jones <richard@users.sourceforge.net>
parents:
48
diff
changeset
|
1280 # 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
|
1281 # 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
|
1282 # 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
|
1283 # 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
|
1284 # |
|
48
671203878652
Moved over to using marshal in the bsddb and anydbm backends.
Richard Jones <richard@users.sourceforge.net>
parents:
27
diff
changeset
|
1285 # 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
|
1286 # 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
|
1287 # |
|
27
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1288 # 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
|
1289 # More Grande Splite stuff |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1290 # |
|
e5e9ea306a09
moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
1291 # |
|
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
|
1292 # vim: set filetype=python ts=4 sw=4 et si |
