Skip to content

Commit 86f4338

Browse files
author
Richard Jones
committed
instructions and method for generating config.ini
1 parent 015dc0f commit 86f4338

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

doc/upgrading.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ Class.get() instead.
3535

3636
XXX describe any mandatory changes to tracker layout
3737

38-
The ``config.py`` file has been replaced by ``config.ini``. You may copy
39-
the example config.ini from the classic tracker template::
38+
The ``config.py`` file has been replaced by ``config.ini``. You may use the
39+
roundup-admin command "genconfig" to generate a new config file::
4040

41-
templates/classic/config.ini
41+
roundup-admin genconfig <tracker home>/config.ini
4242

4343
and modify the values therein based on the contents of your old config.py.
4444
In most cases, the names of the config variables are the same.

roundup/admin.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1717
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1818
#
19-
# $Id: admin.py,v 1.84 2004-11-03 01:34:21 richard Exp $
19+
# $Id: admin.py,v 1.85 2004-11-09 23:12:11 richard Exp $
2020

2121
'''Administration commands for maintaining Roundup trackers.
2222
'''
@@ -368,8 +368,7 @@ def do_install(self, tracker_home, args):
368368
config_ini_file = os.path.join(tracker_home, CoreConfig.INI_FILE)
369369
# check for both old- and new-style configs
370370
if filter(os.path.exists, [config_ini_file,
371-
os.path.join(tracker_home, 'config.py'),
372-
]):
371+
os.path.join(tracker_home, 'config.py')]):
373372
ok = raw_input(_(
374373
"""WARNING: There appears to be a tracker in "%(tracker_home)s"!
375374
If you re-install it, you will lose all the data!
@@ -433,6 +432,15 @@ def do_install(self, tracker_home, args):
433432
}
434433
return 0
435434

435+
def do_genconfig(self, args):
436+
""'''Usage: genconfig <filename>
437+
Generate a new tracker config file (ini style) with default values
438+
in <filename>.
439+
'''
440+
if len(args) < 1:
441+
raise UsageError, _('Not enough arguments supplied')
442+
config = CoreConfig()
443+
config.save(args[0])
436444

437445
def do_initialise(self, tracker_home, args):
438446
""'''Usage: initialise [adminpw]
@@ -1250,6 +1258,9 @@ def run_command(self, args):
12501258
self.help_commands()
12511259
self.help_all()
12521260
return 0
1261+
if command == 'config':
1262+
self.do_config(args[1:])
1263+
return 0
12531264

12541265
# figure what the command is
12551266
try:

roundup/init.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: init.py,v 1.33 2004-11-03 09:44:16 a1s Exp $
18+
# $Id: init.py,v 1.34 2004-11-09 23:12:12 richard Exp $
1919

2020
"""Init (create) a roundup instance.
2121
"""
@@ -99,8 +99,7 @@ def install(instance_home, template):
9999
# installed from the template, write default config text
100100
config_ini_file = os.path.join(instance_home, CoreConfig.INI_FILE)
101101
if not (os.path.isfile(config_ini_file)
102-
or os.path.isfile(os.path.join(instance_home, 'config.py'))
103-
):
102+
or os.path.isfile(os.path.join(instance_home, 'config.py'))):
104103
config = CoreConfig()
105104
config.save(config_ini_file)
106105

0 commit comments

Comments
 (0)