Skip to content
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

gallery_directive plugin: KeyError: 'GALLERY_PATH' #1612

Closed
devurandom opened this issue Feb 6, 2015 · 4 comments
Closed

gallery_directive plugin: KeyError: 'GALLERY_PATH' #1612

devurandom opened this issue Feb 6, 2015 · 4 comments

Comments

@devurandom
Copy link

The gallery_directive plugin at version getnikola/plugins@f33e8c6 together with Nikola 7.3.0 shows the following problem:

Scanning posts....done!
.  render_posts:cache/posts/…
########################################
TaskError - taskid:render_posts:cache/posts/…
PythonAction Error
Traceback (most recent call last):
  File "…/.local/lib/python3.4/site-packages/doit/action.py", line 372, in execute
    returned_value = self.py_callable(*self.args, **kwargs)
  File "…/.local/lib/python3.4/site-packages/nikola/post.py", line 431, in compile
    self.is_two_file),
  File "…/.local/lib/python3.4/site-packages/nikola/plugins/compile/rest/__init__.py", line 99, in compile_html
    }, logger=self.logger, source_path=source, l_add_ln=add_ln)
  File "…/.local/lib/python3.4/site-packages/nikola/plugins/compile/rest/__init__.py", line 266, in rst2html
    pub.publish(enable_exit_status=enable_exit_status)
  File "…/.local/lib/python3.4/site-packages/docutils/core.py", line 217, in publish
    self.settings)
  File "…/.local/lib/python3.4/site-packages/docutils/readers/__init__.py", line 72, in read
    self.parse()
  File "…/.local/lib/python3.4/site-packages/docutils/readers/__init__.py", line 78, in parse
    self.parser.parse(self.input, document)
  File "…/.local/lib/python3.4/site-packages/docutils/parsers/rst/__init__.py", line 172, in parse
    self.statemachine.run(inputlines, document, inliner=self.inliner)
  File "…/.local/lib/python3.4/site-packages/docutils/parsers/rst/states.py", line 170, in run
    input_source=document['source'])
  File "…/.local/lib/python3.4/site-packages/docutils/statemachine.py", line 239, in run
    context, state, transitions)
  File "…/.local/lib/python3.4/site-packages/docutils/statemachine.py", line 460, in check_line
    return method(match, context, next_state)
  File "…/.local/lib/python3.4/site-packages/docutils/parsers/rst/states.py", line 2301, in explicit_markup
    self.explicit_list(blank_finish)
  File "…/.local/lib/python3.4/site-packages/docutils/parsers/rst/states.py", line 2331, in explicit_list
    match_titles=self.state_machine.match_titles)
  File "…/.local/lib/python3.4/site-packages/docutils/parsers/rst/states.py", line 319, in nested_list_parse
    node=node, match_titles=match_titles)
  File "…/.local/lib/python3.4/site-packages/docutils/parsers/rst/states.py", line 195, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "…/.local/lib/python3.4/site-packages/docutils/statemachine.py", line 239, in run
    context, state, transitions)
  File "…/.local/lib/python3.4/site-packages/docutils/statemachine.py", line 460, in check_line
    return method(match, context, next_state)
  File "…/.local/lib/python3.4/site-packages/docutils/parsers/rst/states.py", line 2604, in explicit_markup
    nodelist, blank_finish = self.explicit_construct(match)
  File "…/.local/lib/python3.4/site-packages/docutils/parsers/rst/states.py", line 2311, in explicit_construct
    return method(self, expmatch)
  File "…/.local/lib/python3.4/site-packages/docutils/parsers/rst/states.py", line 2054, in directive
    directive_class, match, type_name, option_presets)
  File "…/.local/lib/python3.4/site-packages/docutils/parsers/rst/states.py", line 2103, in run_directive
    result = directive_instance.run()
  File "…/om/plugins/gallery_directive/gallery_directive.py", line 66, in run
    'gallery_path': self.site.config['GALLERY_PATH'],
KeyError: 'GALLERY_PATH'

Quick hack:

diff -r 4ea44637a3da plugins/gallery_directive/gallery_directive.py
--- a/plugins/gallery_directive/gallery_directive.py    Fri Feb 06 11:20:59 2015 +0100
+++ b/plugins/gallery_directive/gallery_directive.py    Fri Feb 06 11:45:46 2015 +0100
@@ -63,7 +63,7 @@
         gallery_name = self.arguments[0]
         kw = {
             'output_folder': self.site.config['OUTPUT_FOLDER'],
-            'gallery_path': self.site.config['GALLERY_PATH'],
+            'gallery_path': self.site.config['GALLERY_FOLDERS']['galleries'],
             'thumbnail_size': self.site.config['THUMBNAIL_SIZE'],
         }
         gallery_folder = os.path.join(kw['output_folder'], kw['gallery_path'], gallery_name)
@Kwpolska
Copy link
Member

Kwpolska commented Feb 6, 2015

The plugin needs a rewrite for compatibility with gallery_folders. We can just use the path architecture for that. I’ll look into it later.

@Kwpolska
Copy link
Member

Kwpolska commented Feb 6, 2015

PS. next time, please report the issue against the getnikola/plugins repo instead.

Kwpolska added a commit to getnikola/plugins that referenced this issue Feb 8, 2015
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
@Kwpolska
Copy link
Member

Kwpolska commented Feb 8, 2015

Should be fixed — please test getnikola/plugins@c8f0cb5 (warning, I force-pushed along the way!) and report failures, if any.

@devurandom
Copy link
Author

Works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants