1 #! /usr/bin/env python
2 #
3 # Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/)
4 # This module is free software, and you may redistribute it and/or modify
5 # under the same terms as Python, so long as this copyright message and
6 # disclaimer are retained in their original form.
7 #
8 # IN NO EVENT SHALL BIZAR SOFTWARE PTY LTD BE LIABLE TO ANY PARTY FOR
9 # DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
10 # OUT OF THE USE OF THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE
11 # POSSIBILITY OF SUCH DAMAGE.
12 #
13 # BIZAR SOFTWARE PTY LTD SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
18 #
19 # $Id: roundup-admin,v 1.61 2002-01-05 02:21:21 richard Exp $
21 # python version check
22 from roundup import version_check
24 # import the admin tool guts and make it go
25 from roundup.admin import AdminTool
26 from roundup.i18n import _
28 import sys
29 tool = AdminTool()
30 sys.exit(tool.main())
32 #
33 # $Log: not supported by cvs2svn $
34 # Revision 1.60 2002/01/05 02:11:22 richard
35 # I18N'ed roundup admin - and split the code off into a module so it can be used
36 # elsewhere.
37 # Big issue with this is the doc strings - that's the help. We're probably going to
38 # have to switch to not use docstrings, which will suck a little :(
39 #
40 # Revision 1.59 2001/12/31 05:20:34 richard
41 # . #496360 ] table width does not work
42 #
43 # Revision 1.58 2001/12/31 05:12:52 richard
44 # actually handle the advertised <cr> response to "commit y/N?"
45 #
46 # Revision 1.57 2001/12/31 05:12:01 richard
47 # added some quoting instructions to roundup-admin
48 #
49 # Revision 1.56 2001/12/31 05:09:20 richard
50 # Added better tokenising to roundup-admin - handles spaces and stuff. Can
51 # use quoting or backslashes. See the roundup.token pydoc.
52 #
53 # Revision 1.55 2001/12/17 03:52:47 richard
54 # Implemented file store rollback. As a bonus, the hyperdb is now capable of
55 # storing more than one file per node - if a property name is supplied,
56 # the file is called designator.property.
57 # I decided not to migrate the existing files stored over to the new naming
58 # scheme - the FileClass just doesn't specify the property name.
59 #
60 # Revision 1.54 2001/12/15 23:09:23 richard
61 # Some cleanups in roundup-admin, also made it work again...
62 #
63 # Revision 1.53 2001/12/13 00:20:00 richard
64 # . Centralised the python version check code, bumped version to 2.1.1 (really
65 # needs to be 2.1.2, but that isn't released yet :)
66 #
67 # Revision 1.52 2001/12/12 21:47:45 richard
68 # . Message author's name appears in From: instead of roundup instance name
69 # (which still appears in the Reply-To:)
70 # . envelope-from is now set to the roundup-admin and not roundup itself so
71 # delivery reports aren't sent to roundup (thanks Patrick Ohly)
72 #
73 # Revision 1.51 2001/12/10 00:57:38 richard
74 # From CHANGES:
75 # . Added the "display" command to the admin tool - displays a node's values
76 # . #489760 ] [issue] only subject
77 # . fixed the doc/index.html to include the quoting in the mail alias.
78 #
79 # Also:
80 # . fixed roundup-admin so it works with transactions
81 # . disabled the back_anydbm module if anydbm tries to use dumbdbm
82 #
83 # Revision 1.50 2001/12/02 05:06:16 richard
84 # . We now use weakrefs in the Classes to keep the database reference, so
85 # the close() method on the database is no longer needed.
86 # I bumped the minimum python requirement up to 2.1 accordingly.
87 # . #487480 ] roundup-server
88 # . #487476 ] INSTALL.txt
89 #
90 # I also cleaned up the change message / post-edit stuff in the cgi client.
91 # There's now a clearly marked "TODO: append the change note" where I believe
92 # the change note should be added there. The "changes" list will obviously
93 # have to be modified to be a dict of the changes, or somesuch.
94 #
95 # More testing needed.
96 #
97 # Revision 1.49 2001/12/01 07:17:50 richard
98 # . We now have basic transaction support! Information is only written to
99 # the database when the commit() method is called. Only the anydbm
100 # backend is modified in this way - neither of the bsddb backends have been.
101 # The mail, admin and cgi interfaces all use commit (except the admin tool
102 # doesn't have a commit command, so interactive users can't commit...)
103 # . Fixed login/registration forwarding the user to the right page (or not,
104 # on a failure)
105 #
106 # Revision 1.48 2001/11/27 22:32:03 richard
107 # typo
108 #
109 # Revision 1.47 2001/11/26 22:55:56 richard
110 # Feature:
111 # . Added INSTANCE_NAME to configuration - used in web and email to identify
112 # the instance.
113 # . Added EMAIL_SIGNATURE_POSITION to indicate where to place the roundup
114 # signature info in e-mails.
115 # . Some more flexibility in the mail gateway and more error handling.
116 # . Login now takes you to the page you back to the were denied access to.
117 #
118 # Fixed:
119 # . Lots of bugs, thanks Roché and others on the devel mailing list!
120 #
121 # Revision 1.46 2001/11/21 03:40:54 richard
122 # more new property handling
123 #
124 # Revision 1.45 2001/11/12 22:51:59 jhermann
125 # Fixed option & associated error handling
126 #
127 # Revision 1.44 2001/11/12 22:01:06 richard
128 # Fixed issues with nosy reaction and author copies.
129 #
130 # Revision 1.43 2001/11/09 22:33:28 richard
131 # More error handling fixes.
132 #
133 # Revision 1.42 2001/11/09 10:11:08 richard
134 # . roundup-admin now handles all hyperdb exceptions
135 #
136 # Revision 1.41 2001/11/09 01:25:40 richard
137 # Should parse with python 1.5.2 now.
138 #
139 # Revision 1.40 2001/11/08 04:42:00 richard
140 # Expanded the already-abbreviated "initialise" and "specification" commands,
141 # and added a comment to the command help about the abbreviation.
142 #
143 # Revision 1.39 2001/11/08 04:29:59 richard
144 # roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
145 # [thanks Engelbert Gruber for the inspiration]
146 #
147 # Revision 1.38 2001/11/05 23:45:40 richard
148 # Fixed newuser_action so it sets the cookie with the unencrypted password.
149 # Also made it present nicer error messages (not tracebacks).
150 #
151 # Revision 1.37 2001/10/23 01:00:18 richard
152 # Re-enabled login and registration access after lopping them off via
153 # disabling access for anonymous users.
154 # Major re-org of the htmltemplate code, cleaning it up significantly. Fixed
155 # a couple of bugs while I was there. Probably introduced a couple, but
156 # things seem to work OK at the moment.
157 #
158 # Revision 1.36 2001/10/21 00:45:15 richard
159 # Added author identification to e-mail messages from roundup.
160 #
161 # Revision 1.35 2001/10/20 11:58:48 richard
162 # Catch errors in login - no username or password supplied.
163 # Fixed editing of password (Password property type) thanks Roch'e Compaan.
164 #
165 # Revision 1.34 2001/10/18 02:16:42 richard
166 # Oops, committed the admin script with the wierd #! line.
167 # Also, made the thing into a class to reduce parameter passing.
168 # Nuked the leading whitespace from the help __doc__ displays too.
169 #
170 # Revision 1.33 2001/10/17 23:13:19 richard
171 # Did a fair bit of work on the admin tool. Now has an extra command "table"
172 # which displays node information in a tabular format. Also fixed import and
173 # export so they work. Removed freshen.
174 # Fixed quopri usage in mailgw from bug reports.
175 #
176 # Revision 1.32 2001/10/17 06:57:29 richard
177 # Interactive startup blurb - need to figure how to get the version in there.
178 #
179 # Revision 1.31 2001/10/17 06:17:26 richard
180 # Now with readline support :)
181 #
182 # Revision 1.30 2001/10/17 06:04:00 richard
183 # Beginnings of an interactive mode for roundup-admin
184 #
185 # Revision 1.29 2001/10/16 03:48:01 richard
186 # admin tool now complains if a "find" is attempted with a non-link property.
187 #
188 # Revision 1.28 2001/10/13 00:07:39 richard
189 # More help in admin tool.
190 #
191 # Revision 1.27 2001/10/11 23:43:04 richard
192 # Implemented the comma-separated printing option in the admin tool.
193 # Fixed a typo (more of a vim-o actually :) in mailgw.
194 #
195 # Revision 1.26 2001/10/11 05:03:51 richard
196 # Marked the roundup-admin import/export as experimental since they're not fully
197 # operational.
198 #
199 # Revision 1.25 2001/10/10 04:12:32 richard
200 # The setup.cfg file is just causing pain. Away it goes.
201 #
202 # Revision 1.24 2001/10/10 03:54:57 richard
203 # Added database importing and exporting through CSV files.
204 # Uses the csv module from object-craft for exporting if it's available.
205 # Requires the csv module for importing.
206 #
207 # Revision 1.23 2001/10/09 23:36:25 richard
208 # Spit out command help if roundup-admin command doesn't get an argument.
209 #
210 # Revision 1.22 2001/10/09 07:25:59 richard
211 # Added the Password property type. See "pydoc roundup.password" for
212 # implementation details. Have updated some of the documentation too.
213 #
214 # Revision 1.21 2001/10/05 02:23:24 richard
215 # . roundup-admin create now prompts for property info if none is supplied
216 # on the command-line.
217 # . hyperdb Class getprops() method may now return only the mutable
218 # properties.
219 # . Login now uses cookies, which makes it a whole lot more flexible. We can
220 # now support anonymous user access (read-only, unless there's an
221 # "anonymous" user, in which case write access is permitted). Login
222 # handling has been moved into cgi_client.Client.main()
223 # . The "extended" schema is now the default in roundup init.
224 # . The schemas have had their page headings modified to cope with the new
225 # login handling. Existing installations should copy the interfaces.py
226 # file from the roundup lib directory to their instance home.
227 # . Incorrectly had a Bizar Software copyright on the cgitb.py module from
228 # Ping - has been removed.
229 # . Fixed a whole bunch of places in the CGI interface where we should have
230 # been returning Not Found instead of throwing an exception.
231 # . Fixed a deviation from the spec: trying to modify the 'id' property of
232 # an item now throws an exception.
233 #
234 # Revision 1.20 2001/10/04 02:12:42 richard
235 # Added nicer command-line item adding: passing no arguments will enter an
236 # interactive more which asks for each property in turn. While I was at it, I
237 # fixed an implementation problem WRT the spec - I wasn't raising a
238 # ValueError if the key property was missing from a create(). Also added a
239 # protected=boolean argument to getprops() so we can list only the mutable
240 # properties (defaults to yes, which lists the immutables).
241 #
242 # Revision 1.19 2001/10/01 06:40:43 richard
243 # made do_get have the args in the correct order
244 #
245 # Revision 1.18 2001/09/18 22:58:37 richard
246 #
247 # Added some more help to roundu-admin
248 #
249 # Revision 1.17 2001/08/28 05:58:33 anthonybaxter
250 # added missing 'import' statements.
251 #
252 # Revision 1.16 2001/08/12 06:32:36 richard
253 # using isinstance(blah, Foo) now instead of isFooType
254 #
255 # Revision 1.15 2001/08/07 00:24:42 richard
256 # stupid typo
257 #
258 # Revision 1.14 2001/08/07 00:15:51 richard
259 # Added the copyright/license notice to (nearly) all files at request of
260 # Bizar Software.
261 #
262 # Revision 1.13 2001/08/05 07:44:13 richard
263 # Instances are now opened by a special function that generates a unique
264 # module name for the instances on import time.
265 #
266 # Revision 1.12 2001/08/03 01:28:33 richard
267 # Used the much nicer load_package, pointed out by Steve Majewski.
268 #
269 # Revision 1.11 2001/08/03 00:59:34 richard
270 # Instance import now imports the instance using imp.load_module so that
271 # we can have instance homes of "roundup" or other existing python package
272 # names.
273 #
274 # Revision 1.10 2001/07/30 08:12:17 richard
275 # Added time logging and file uploading to the templates.
276 #
277 # Revision 1.9 2001/07/30 03:52:55 richard
278 # init help now lists templates and backends
279 #
280 # Revision 1.8 2001/07/30 02:37:07 richard
281 # Freshen is really broken. Commented out.
282 #
283 # Revision 1.7 2001/07/30 01:28:46 richard
284 # Bugfixes
285 #
286 # Revision 1.6 2001/07/30 00:57:51 richard
287 # Now uses getopt, much improved command-line parsing. Much fuller help. Much
288 # better internal structure. It's just BETTER. :)
289 #
290 # Revision 1.5 2001/07/30 00:04:48 richard
291 # Made the "init" prompting more friendly.
292 #
293 # Revision 1.4 2001/07/29 07:01:39 richard
294 # Added vim command to all source so that we don't get no steenkin' tabs :)
295 #
296 # Revision 1.3 2001/07/23 08:45:28 richard
297 # ok, so now "./roundup-admin init" will ask questions in an attempt to get a
298 # workable instance_home set up :)
299 # _and_ anydbm has had its first test :)
300 #
301 # Revision 1.2 2001/07/23 08:20:44 richard
302 # Moved over to using marshal in the bsddb and anydbm backends.
303 # roundup-admin now has a "freshen" command that'll load/save all nodes (not
304 # retired - mod hyperdb.Class.list() so it lists retired nodes)
305 #
306 # Revision 1.1 2001/07/23 03:46:48 richard
307 # moving the bin files to facilitate out-of-the-boxness
308 #
309 # Revision 1.1 2001/07/22 11:15:45 richard
310 # More Grande Splite stuff
311 #
312 #
313 # vim: set filetype=python ts=4 sw=4 et si