diff options
| author | Georg Brandl <georg@python.org> | 2009-07-13 20:53:11 +0200 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2009-07-13 20:53:11 +0200 |
| commit | 59b0aa1d06ea697fcd8765b681ca82144f0bc6aa (patch) | |
| tree | 346f8d95771522c69a096b43219cf94f5ec1ac37 /sphinx/application.py | |
| parent | 42cc5958c4509a806a88e34af2dd91be654fdd4b (diff) | |
| download | sphinx-59b0aa1d06ea697fcd8765b681ca82144f0bc6aa.tar.gz | |
First step of domain handling in environment.
Diffstat (limited to 'sphinx/application.py')
| -rw-r--r-- | sphinx/application.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sphinx/application.py b/sphinx/application.py index e26d619e..3566bc50 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -107,11 +107,6 @@ class Sphinx(object): # now that we know all config values, collect them from conf.py self.config.init_values() - # intialize domains - self.domains = {} - for domain in all_domains.keys(): - self.domains[domain] = all_domains[domain]() - # set up translation infrastructure self._init_i18n() # set up the build environment @@ -144,20 +139,25 @@ class Sphinx(object): self.env = BuildEnvironment(self.srcdir, self.doctreedir, self.config) self.env.find_files(self.config) + for domain in all_domains.keys(): + self.env.domains[domain] = all_domains[domain](self.env) else: try: self.info(bold('loading pickled environment... '), nonl=True) self.env = BuildEnvironment.frompickle(self.config, path.join(self.doctreedir, ENV_PICKLE_FILENAME)) + self.env.domains = {} + for domain in all_domains.keys(): + # this can raise if the data version doesn't fit + self.env.domains[domain] = all_domains[domain](self.env) self.info('done') except Exception, err: if type(err) is IOError and err.errno == 2: self.info('not yet created') else: self.info('failed: %s' % err) - self.env = BuildEnvironment(self.srcdir, self.doctreedir, - self.config) - self.env.find_files(self.config) + return self._init_env(freshenv=True) + self.env.set_warnfunc(self.warn) def _init_builder(self, buildername): |
