Modify ↓
Opened 20 years ago
Last modified 10 years ago
#756 new enhancement
trac-admin initenv might prompt for a wiki-default path
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | next-major-releases |
Component: | admin/console | Version: | devel |
Severity: | normal | Keywords: | newhelp |
Cc: | Thijs Triemstra | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
Trac-admin prompts for default template path, but not for default wiki page path.
The following patch supports wiki-default path on command line and prompts for such a path when initenv
command is invoked.
Proposed patch
-
scripts/trac-admin
1 #!/usr/bin/ envpython1 #!/usr/bin/python 2 2 # -*- coding: iso8859-1 -*- 3 3 __author__ = 'Daniel Lundin <daniel@edgewall.com>, Jonas Borgström <jonas@edgewall.com>' 4 4 __copyright__ = 'Copyright (c) 2004 Edgewall Software' … … 427 427 428 428 ## Initenv 429 429 _help_initenv = [('initenv', 'Create and initialize a new environment interactively'), 430 ('initenv <projectname> <repospath> <templatepath> ',430 ('initenv <projectname> <repospath> <templatepath> <wikipath>', 431 431 'Create and initialize a new environment from arguments')] 432 432 433 433 def do_initdb(self, line): … … 460 460 dt = trac.siteconfig.__default_templates_dir__ 461 461 prompt = 'Templates directory [%s]> ' % dt 462 462 returnvals.append(raw_input(prompt) or dt) 463 print 464 print ' Please enter location of Trac initial wiki pages.' 465 print ' Default is the location of the site-wide wiki pages installed with Trac.' 466 print 467 dw = trac.siteconfig.__default_wiki_dir__ 468 prompt = 'Wiki pages directory [%s]> ' % dw 469 returnvals.append(raw_input(prompt) or dw) 463 470 return returnvals 464 471 465 472 def do_initenv(self, line): … … 470 477 project_name = None 471 478 repository_dir = None 472 479 templates_dir = None 480 wiki_dir = None 473 481 if len(arg) == 1: 474 482 returnvals = self.get_initenv_args() 475 483 project_name = returnvals[0] 476 484 repository_dir = returnvals[1] 477 485 templates_dir = returnvals[2] 478 elif len(arg)!= 3: 486 wiki_dir = returnvals[3] 487 elif len(arg)!= 4: 479 488 print 'Wrong number of arguments to initenv %d' % len(arg) 480 489 return 481 490 else: 482 491 project_name = arg[0] 483 492 repository_dir = arg[1] 484 493 templates_dir = arg[2] 494 wiki_dir = arg[3] 485 495 from svn import util, repos, core 486 496 core.apr_initialize() 487 497 pool = core.svn_pool_create(None) … … 498 508 or not os.access(os.path.join(templates_dir, 'ticket.cs'), os.F_OK): 499 509 print templates_dir, "doesn't look like a Trac templates directory" 500 510 return 511 if not os.access(os.path.join(wiki_dir, 'WikiStart'), os.F_OK): 512 print wiki_dir, "doesn't seem to contain initial Wiki pages" 513 return 501 514 try: 502 515 print 'Creating and Initializing Project' 503 516 self.env_create() … … 516 529 # Add a few default wiki pages 517 530 print ' Installing wiki pages' 518 531 cursor = cnx.cursor() 519 self._do_wiki_load( trac.siteconfig.__default_wiki_dir__,cursor)532 self._do_wiki_load(wiki_dir,cursor) 520 533 521 534 print ' Indexing repository' 522 535 sync.sync(cnx, rep, fs_ptr, pool)
Attachments (0)
Change History (10)
comment:1 by , 20 years ago
Severity: | minor → enhancement |
---|
comment:2 by , 19 years ago
Milestone: | → 0.9 |
---|---|
Priority: | low → normal |
comment:3 by , 19 years ago
Component: | general → trac-admin |
---|---|
Owner: | changed from | to
comment:4 by , 19 years ago
Milestone: | 0.9 → 0.9.1 |
---|
See also #156. We need to adopt getopt
or optparse
for trac-admin initenv
to address this stuff, I think.
comment:5 by , 19 years ago
Milestone: | 0.9.1 → 0.9.2 |
---|
comment:6 by , 19 years ago
Milestone: | 0.9.3 → 1.0 |
---|
We should be switching to using optparse
for initenv
, where we could
provide an option for overriding the wiki default pages directory.
comment:7 by , 16 years ago
Keywords: | newhelp added |
---|
comment:9 by , 14 years ago
Cc: | added |
---|---|
Description: | modified (diff) |
Milestone: | unscheduled → next-major-0.1X |
comment:10 by , 10 years ago
Owner: | removed |
---|
Note:
See TracTickets
for help on using tickets.
I would love to see this in 0.9 — any chance of that happening?