|
28 | 28 | from roundup import date, hyperdb, roundupdb, init, password, token |
29 | 29 | from roundup import __version__ as roundup_version |
30 | 30 | import roundup.instance |
31 | | -from roundup.configuration import CoreConfig, NoConfigError |
| 31 | +from roundup.configuration import CoreConfig, NoConfigError, UserConfig |
32 | 32 | from roundup.i18n import _ |
33 | 33 | from roundup.exceptions import UsageError |
34 | 34 | from roundup.anypy.my_input import my_input |
@@ -430,9 +430,31 @@ def do_install(self, tracker_home, args): |
430 | 430 | defns = {} |
431 | 431 |
|
432 | 432 | defns['rdbms_backend'] = backend |
| 433 | + |
| 434 | + # load config_ini.ini from template if it exists. |
| 435 | + # it sets parameters like template_engine that are |
| 436 | + # template specific. |
| 437 | + template_config=UserConfig(templates[template]['path'] + |
| 438 | + "/config_ini.ini") |
| 439 | + for k in template_config.keys(): |
| 440 | + if k == 'HOME': # ignore home. It is a default param. |
| 441 | + continue |
| 442 | + defns[k] = template_config[k] |
| 443 | + |
433 | 444 | # install! |
434 | 445 | init.install(tracker_home, templates[template]['path'], settings=defns) |
435 | 446 |
|
| 447 | + # Remove config_ini.ini file from tracker_home (not template dir). |
| 448 | + # Ignore file not found - not all templates have |
| 449 | + # config_ini.ini files. |
| 450 | + try: |
| 451 | + os.remove(tracker_home + "/config_ini.ini") |
| 452 | + except OSError as e: # FileNotFound exception under py3 |
| 453 | + if e.errno == 2: |
| 454 | + pass |
| 455 | + else: |
| 456 | + raise |
| 457 | + |
436 | 458 | print(_(""" |
437 | 459 | --------------------------------------------------------------------------- |
438 | 460 | You should now edit the tracker configuration file: |
|
0 commit comments