Refactored; Initialize imagedir at init() method

This commit is contained in:
tk0miya 2014-09-29 00:17:24 +09:00
parent 0853176305
commit 8c38327f0e
2 changed files with 7 additions and 5 deletions

View File

@ -44,10 +44,6 @@ class Builder(object):
versioning_method = 'none'
# allow parallel write_doc() calls
allow_parallel = False
# basename of images directory
imagedir = ""
# relative path to image directory from current docname (used at writing docs)
imgpath = ""
def __init__(self, app):
self.env = app.env
@ -74,6 +70,10 @@ class Builder(object):
# images that need to be copied over (source -> dest)
self.images = {}
# basename of images directory
imagedir = ""
# relative path to image directory from current docname (used at writing docs)
imgpath = ""
# these get set later
self.parallel_ok = False

View File

@ -73,7 +73,6 @@ class StandaloneHTMLBuilder(Builder):
link_suffix = '.html' # defaults to matching out_suffix
indexer_format = js_index
indexer_dumps_unicode = True
imagedir = '_images'
supported_image_types = ['image/svg+xml', 'image/png',
'image/gif', 'image/jpeg']
searchindex_filename = 'searchindex.js'
@ -96,6 +95,8 @@ class StandaloneHTMLBuilder(Builder):
# a hash of all config values that, if changed, cause a full rebuild
self.config_hash = ''
self.tags_hash = ''
# basename of images directory
self.imagedir = '_images'
# section numbers for headings in the currently visited document
self.secnumbers = {}
# currently written docname
@ -1030,6 +1031,7 @@ class SerializingHTMLBuilder(StandaloneHTMLBuilder):
def init(self):
self.config_hash = ''
self.tags_hash = ''
self.imagedir = '_images'
self.theme = None # no theme necessary
self.templates = None # no template bridge necessary
self.init_translator_class()