summaryrefslogtreecommitdiff
path: root/sandbox/py-rest-doc/sphinx/builder.py
diff options
context:
space:
mode:
authorgbrandl <gbrandl@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2007-05-27 11:44:45 +0000
committergbrandl <gbrandl@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2007-05-27 11:44:45 +0000
commit7c86f6623279052ea372ff758c5fff2ebb8aac62 (patch)
tree01871aae25d240843acf41e2828f28bc31587563 /sandbox/py-rest-doc/sphinx/builder.py
parentddb5bf64d4ba43c296b1cd41cad2f2d4b50cf0d0 (diff)
downloaddocutils-7c86f6623279052ea372ff758c5fff2ebb8aac62.tar.gz
Fixes...
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@5165 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'sandbox/py-rest-doc/sphinx/builder.py')
-rw-r--r--sandbox/py-rest-doc/sphinx/builder.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/sandbox/py-rest-doc/sphinx/builder.py b/sandbox/py-rest-doc/sphinx/builder.py
index 5f5552083..b09f0f266 100644
--- a/sandbox/py-rest-doc/sphinx/builder.py
+++ b/sandbox/py-rest-doc/sphinx/builder.py
@@ -11,7 +11,6 @@
from __future__ import with_statement
import os
-import re
import sys
import time
import types
@@ -20,11 +19,10 @@ import shutil
import cPickle as pickle
import cStringIO as StringIO
from os import path
-from functools import partial
from docutils.io import StringOutput, DocTreeInput
from docutils.core import publish_parts
-from docutils.utils import Reporter, new_document
+from docutils.utils import new_document
from docutils.readers import doctree
from docutils.frontend import OptionParser
@@ -164,7 +162,7 @@ class Builder(object):
to_write = [path.abspath(filename)[dirlen:] for filename in source_filenames]
self.load_env()
self.build(to_write,
- summary='%d source files given on command line' % len(to_read))
+ summary='%d source files given on command line' % len(to_write))
def build_update(self):
"""Only rebuild files changed or added since last build."""
@@ -337,7 +335,7 @@ class StandaloneHTMLBuilder(Builder):
builder = self.name,
)
- self.handle_file(filename, context)
+ self.handle_file(filename, doctree, context)
def finish(self):
# calculate some things used in the templates
@@ -400,14 +398,14 @@ class StandaloneHTMLBuilder(Builder):
if path.getmtime(path.join(self.srcdir, filename)) > targetmtime:
yield filename
- def handle_file(self, filename, context):
+ def handle_file(self, filename, doctree, context):
# only index pages with title
title = context['title']
if self.indexer is not None and title:
category = get_category(filename)
if category is not None:
self.indexer.feed(self.get_target_uri(filename)[:-5], # strip '.html'
- category, title, self.doctrees[filename])
+ category, title, doctree)
output = self.page_template.render(context)
outfilename = path.join(self.outdir, filename[:-4] + '.html')
@@ -490,14 +488,13 @@ class WebHTMLBuilder(StandaloneHTMLBuilder):
return source_filename[:-9] # up to /
return source_filename[:-4] + '/'
- def handle_file(self, filename, context):
+ def handle_file(self, filename, doctree, context):
# only index pages with title and category
title = context['title']
if self.indexer is not None and title:
category = get_category(filename)
if category is not None:
- self.indexer.feed(filename, category, title,
- self.doctrees[filename])
+ self.indexer.feed(filename, category, title, doctree)
outfilename = path.join(self.outdir, filename[:-4] + '.fpickle')
ensuredir(path.dirname(outfilename))