Code

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