[Python-checkins] r66592 - in doctools/trunk: CHANGES sphinx/quickstart.py

georg.brandl python-checkins at python.org
Wed Sep 24 17:46:54 CEST 2008


Author: georg.brandl
Date: Wed Sep 24 17:46:54 2008
New Revision: 66592

Log:
Don't overwrite existing sphinx projects from quickstart.


Modified:
   doctools/trunk/CHANGES
   doctools/trunk/sphinx/quickstart.py

Modified: doctools/trunk/CHANGES
==============================================================================
--- doctools/trunk/CHANGES	(original)
+++ doctools/trunk/CHANGES	Wed Sep 24 17:46:54 2008
@@ -100,6 +100,9 @@
   - Figures with captions can now be referred to like section titles,
     using the ``:ref:`` role without an explicit link text.
 
+  - In quickstart, if the selected root path already contains a Sphinx
+    project, complain and abort.
+
 
 Release 0.4.2 (Jul 29, 2008)
 ============================

Modified: doctools/trunk/sphinx/quickstart.py
==============================================================================
--- doctools/trunk/sphinx/quickstart.py	(original)
+++ doctools/trunk/sphinx/quickstart.py	Wed Sep 24 17:46:54 2008
@@ -387,6 +387,19 @@
     print '''
 Enter the root path for documentation.'''
     do_prompt(d, 'path', 'Root path for the documentation', '.', is_path)
+
+    while path.isfile(path.join(d['path'], 'conf.py')) or \
+          path.isfile(path.join(d['path'], 'source', 'conf.py')):
+        print
+        print bold('Error: an existing conf.py has been found in the '
+                   'selected root path.')
+        print 'sphinx-quickstart will not overwrite existing Sphinx projects.'
+        print
+        do_prompt(d, 'path', 'Please enter a new root path (or just Enter to exit)',
+                  '', is_path)
+        if not d['path']:
+            sys.exit(1)
+
     print '''
 You have two options for placing the build directory for Sphinx output.
 Either, you use a directory ".build" within the root path, or you separate


More information about the Python-checkins mailing list