-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #8: Incremental building not working #14
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -265,13 +265,15 @@ def download_images(app, env): | |||||||||
.format(src, dst)) | ||||||||||
|
||||||||||
|
||||||||||
def configure_backend(app): | ||||||||||
def configure_backend(app, main_config): | ||||||||||
global DEFAULT_CONFIG | ||||||||||
|
||||||||||
config = copy.deepcopy(DEFAULT_CONFIG) | ||||||||||
config.update(app.config.images_config) | ||||||||||
app.config.images_config = config | ||||||||||
|
||||||||||
def builder_init(app): | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is still configuring the backend and probably shouldn't be renamed
Suggested change
|
||||||||||
config = app.config.images_config | ||||||||||
ensuredir(os.path.join(app.env.srcdir, config['cache_path'])) | ||||||||||
|
||||||||||
# html builder | ||||||||||
|
@@ -346,7 +348,8 @@ def setup(app): | |||||||||
global DEFAULT_CONFIG | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This global declaration isn't needed, and it might be good to remove it while you're editing this file |
||||||||||
app.require_sphinx('1.0') | ||||||||||
app.add_config_value('images_config', DEFAULT_CONFIG, 'env') | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this isn't actually needed because the configuration will be merged anyways, it might make sense to just pass a dict which also wouldn't break when copying it.
Suggested change
|
||||||||||
app.connect('builder-inited', configure_backend) | ||||||||||
app.connect('config-inited', configure_backend) | ||||||||||
app.connect('builder-inited', builder_init) | ||||||||||
Comment on lines
+351
to
+352
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based on the suggestions above:
Suggested change
|
||||||||||
app.connect('env-updated', download_images) | ||||||||||
app.connect('env-updated', install_backend_static_files) | ||||||||||
|
||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would probably use the
main_config
directly since it's provided, but I'm not sure if there is a good reason why the hook has both app and the config though.