Anonymous avatar Anonymous committed 11a9a25 Draft

trac: add an option to avoid creating the initial wiki pages - #85

Comments (0)

Files changed (1)

trac/admin/console.py

 
         arg = self.arg_tokenize(line)
         inherit_paths = []
+        add_wiki = True
         i = 0
         while i < len(arg):
             item = arg[i]
             if item.startswith('--inherit='):
                 inherit_paths.append(arg.pop(i)[10:])
+            elif item.startswith('--nowiki'):
+                add_wiki = False
+                arg.pop(i)
             else:
                 i += 1
         arg = arg or [''] # Reset to usual empty in case we popped the only one
                 traceback.print_exc()
                 sys.exit(1)
 
-            # Add a few default wiki pages
-            printout(_(" Installing default wiki pages"))
-            pages_dir = pkg_resources.resource_filename('trac.wiki', 
-                                                        'default-pages') 
-            WikiAdmin(self.__env).load_pages(pages_dir)
+            if add_wiki:
+                # Add a few default wiki pages
+                printout(_(" Installing default wiki pages"))
+                pages_dir = pkg_resources.resource_filename('trac.wiki',
+                                                            'default-pages')
+                WikiAdmin(self.__env).load_pages(pages_dir)
 
             if repository_dir:
                 try:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.