Browse files

Fixes to doc generation.

  • Loading branch information...
1 parent 282ff5b commit c4337eabc02f823761fe3b77816f44e268c05218 @jacobian jacobian committed Dec 5, 2010
Showing with 14 additions and 7 deletions.
  1. +3 −2 django_website/docs/management/commands/update_docs.py
  2. +11 −5 fabfile.py
View
5 django_website/docs/management/commands/update_docs.py
@@ -5,6 +5,7 @@
from __future__ import absolute_import
import subprocess
+import sphinx.cmdline
from django.conf import settings
from django.core.management.base import NoArgsCommand
from unipath import FSPath as Path
@@ -28,8 +29,8 @@ def handle_noargs(self, **kwargs):
if not json_build_dir.exists():
json_build_dir.mkdir(parents=True)
- # Shell out to sphinx-build.
- subprocess.call(['sphinx-build',
+ # "Shell out" (not exactly, but basically) to sphinx-build.
+ sphinx.cmdline.main(['sphinx-build',
'-b', 'json', # Use the JSON builder
'-q', # Be vewy qwiet
destdir, # Source file directory
View
16 fabfile.py
@@ -68,8 +68,8 @@ def reset_community():
This is a temporary command that does some damage and it should be removed
once the new server's up.
"""
- _managepy('reset aggregator --noinput')
- _managepy('loaddata community_seed')
+ managepy('reset aggregator --noinput')
+ managepy('loaddata community_seed')
def reset_docs():
"""
@@ -78,16 +78,22 @@ def reset_docs():
This is a temporary command that does some damage and it should be removed
once the new server's up.
"""
- _managepy('reset docs --noinput')
- _managepy('loaddata doc_releases')
+ managepy('reset docs --noinput')
+ managepy('loaddata doc_releases')
+
+def update_docs():
+ """
+ Force an update of the docs on the server.
+ """
+ managepy('update_docs', site='docs')
def copy_db():
"""
Copy the production DB locally for testing.
"""
local('ssh %s pg_dump -U djangoproject -c djangoproject | psql djangoproject' % env.hosts[0])
-def _managepy(cmd, site='www'):
+def managepy(cmd, site='www'):
"""
Helper: run a management command remotely.
"""

0 comments on commit c4337ea

Please sign in to comment.