|
16 | 16 | # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
17 | 17 | # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
18 | 18 | # |
19 | | -# $Id: admin.py,v 1.79 2004-10-08 05:37:44 richard Exp $ |
| 19 | +# $Id: admin.py,v 1.80 2004-10-16 14:51:08 a1s Exp $ |
20 | 20 |
|
21 | 21 | '''Administration commands for maintaining Roundup trackers. |
22 | 22 | ''' |
|
26 | 26 | from roundup import date, hyperdb, roundupdb, init, password, token, rcsv |
27 | 27 | from roundup import __version__ as roundup_version |
28 | 28 | import roundup.instance |
| 29 | +from roundup.configuration import CoreConfig |
29 | 30 | from roundup.i18n import _ |
30 | 31 |
|
31 | 32 | class CommandDict(UserDict.UserDict): |
@@ -364,7 +365,11 @@ def do_install(self, tracker_home, args): |
364 | 365 | raise UsageError, _('Instance home parent directory "%(parent)s"' |
365 | 366 | ' does not exist')%locals() |
366 | 367 |
|
367 | | - if os.path.exists(os.path.join(tracker_home, 'config.py')): |
| 368 | + config_ini_file = os.path.join(tracker_home, CoreConfig.INI_FILE) |
| 369 | + # check for both old- and new-style configs |
| 370 | + if filter(os.path.exists, [config_ini_file, |
| 371 | + os.path.join(tracker_home, 'config.py'), |
| 372 | + ]): |
368 | 373 | ok = raw_input(_( |
369 | 374 | """WARNING: There appears to be a tracker in "%(tracker_home)s"! |
370 | 375 | If you re-install it, you will lose all the data! |
@@ -401,19 +406,30 @@ def do_install(self, tracker_home, args): |
401 | 406 | init.install(tracker_home, templates[template]['path']) |
402 | 407 | init.write_select_db(tracker_home, backend) |
403 | 408 |
|
404 | | - print _(''' |
| 409 | + print _(""" |
405 | 410 | You should now edit the tracker configuration file: |
406 | | - %(config_file)s |
407 | | - ... at a minimum, you must set MAILHOST, TRACKER_WEB, MAIL_DOMAIN and |
408 | | - ADMIN_EMAIL. |
409 | | -
|
410 | | - If you wish to modify the default schema, you should also edit |
411 | | - the database initialisation file: |
| 411 | + %(config_file)s""") % {"config_file": config_ini_file} |
| 412 | + |
| 413 | + # find list of options that need manual adjustments |
| 414 | + # XXX config._get_unset_options() is marked as private |
| 415 | + # (leading underscore). make it public or don't care? |
| 416 | + need_set = CoreConfig(tracker_home)._get_unset_options() |
| 417 | + if need_set: |
| 418 | + print _(" ... at a minimum, you must set following options:") |
| 419 | + for section, options in need_set.items(): |
| 420 | + print " [%s]: %s" % (section, ", ".join(options)) |
| 421 | + |
| 422 | + # note about schema modifications |
| 423 | + print _(""" |
| 424 | + If you wish to modify the database schema, |
| 425 | + you should also edit the schema file: |
412 | 426 | %(database_config_file)s |
| 427 | + You may also change the database initialisation file: |
| 428 | + %(database_init_file)s |
413 | 429 | ... see the documentation on customizing for more information. |
414 | | -''')%{ |
415 | | - 'config_file': os.path.join(tracker_home, 'config.py'), |
416 | | - 'database_config_file': os.path.join(tracker_home, 'dbinit.py') |
| 430 | +""") % { |
| 431 | + 'database_config_file': os.path.join(tracker_home, 'schema.py'), |
| 432 | + 'database_init_file': os.path.join(tracker_home, 'initial_data.py'), |
417 | 433 | } |
418 | 434 | return 0 |
419 | 435 |
|
@@ -1388,4 +1404,4 @@ def main(self): |
1388 | 1404 | tool = AdminTool() |
1389 | 1405 | sys.exit(tool.main()) |
1390 | 1406 |
|
1391 | | -# vim: set filetype=python ts=4 sw=4 et si |
| 1407 | +# vim: set filetype=python sts=4 sw=4 et si : |
0 commit comments