Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Some fixes to the JSON builder for Sphinx 1.0 / me being an idiot.

  • Loading branch information...
commit 282ff5b7016df6f854d184426ff6f9b74dd1ade4 1 parent 78198d5
Jacob Kaplan-Moss jacobian authored
Showing with 12 additions and 6 deletions.
  1. +12 −6 django_website/docs/management/commands/update_docs.py
18 django_website/docs/management/commands/update_docs.py
View
@@ -21,13 +21,19 @@ def handle_noargs(self, **kwargs):
# Make an SCM checkout/update into the destination directory.
# Do this dynamically in case we add other SCM later.
getattr(self, 'update_%s' % release.scm)(release.scm_url, destdir)
-
- # Run Sphinx by faking a commandline. Better than shelling out, I s'pose.
+
+ # Make the directory for the JSON files - sphinx-build doesn't
+ # do it for us, apparently.
+ json_build_dir = destdir.child('_build', 'json')
+ if not json_build_dir.exists():
+ json_build_dir.mkdir(parents=True)
+
+ # Shell out to sphinx-build.
subprocess.call(['sphinx-build',
- '-b', 'json', # Use the JSON builder
- '-q', # Be vewy qwiet
- destdir, # Source file directory
- destdir.child('_build', 'json'), # Destination directory
+ '-b', 'json', # Use the JSON builder
+ '-q', # Be vewy qwiet
+ destdir, # Source file directory
+ json_build_dir, # Destination directory
])
def update_svn(self, url, destdir):
Please sign in to comment.
Something went wrong with that request. Please try again.