getnikola / plugins

Extra plugins for Nikola
https://plugins.getnikola.com/
MIT License
59 stars 95 forks source link

[ical] TypeError: render_calendar() got an unexpected keyword argument 'post' #210

Closed sebelk closed 7 years ago

sebelk commented 7 years ago

Hi, I've tried to use plugin ical with no success:

My version of nikola is: 7.8.3

And I have icalendar module:

pip show  icalendar
Name: icalendar
Version: 3.11.2
Summary: iCalendar parser/generator
Home-page: https://github.com/collective/icalendar
Author: Plone Foundation
Author-email: plone-developers@lists.sourceforge.net
License: BSD
Location: /home/sergio/Documentos/Arts/sebelk/nikola/lib/python3.5/site-packages
Requires: python-dateutil, setuptools, pytz

When I build, it outputs as follows:

Scanning posts............done!
.  render_posts:cache/posts/icalendar-test.html
########################################
TaskError - taskid:render_posts:cache/posts/icalendar-test.html
PythonAction Error
Traceback (most recent call last):
  File "/home/sergio/Documentos/Arts/sebelk/nikola/lib/python3.5/site-packages/doit/action.py", line 403, in execute
    returned_value = self.py_callable(*self.args, **kwargs)
  File "/home/sergio/Documentos/Arts/sebelk/nikola/lib/python3.5/site-packages/nikola/post.py", line 540, in compile
    lang)
  File "/home/sergio/Documentos/Arts/sebelk/nikola/lib/python3.5/site-packages/nikola/plugins/compile/markdown/__init__.py", line 85, in compile
    output, shortcode_deps = self.compile_string(data, source, is_two_file, post)
  File "/home/sergio/Documentos/Arts/sebelk/nikola/lib/python3.5/site-packages/nikola/plugins/compile/markdown/__init__.py", line 74, in compile_string
    output, shortcode_deps = self.site.apply_shortcodes(output, filename=source_path, with_dependencies=True, extra_context={'post': post})
  File "/home/sergio/Documentos/Arts/sebelk/nikola/lib/python3.5/site-packages/nikola/nikola.py", line 1634, in apply_shortcodes
    return shortcodes.apply_shortcodes(data, self.shortcode_registry, self, filename, lang=lang, with_dependencies=with_dependencies, extra_context=extra_context)
  File "/home/sergio/Documentos/Arts/sebelk/nikola/lib/python3.5/site-packages/nikola/shortcodes.py", line 320, in apply_shortcodes
    res = f(*args, **kw)
TypeError: render_calendar() got an unexpected keyword argument 'post'

Post file has:

<!-- 
.. title: icalendar test
.. slug: icalendar-test
.. date: 2017-01-21 17:57:30 UTC-03:00
.. tags: 
.. category: 
.. link: 
.. description: 
.. type: text
-->

Escriba su publicación aquí.
{{% calendar %}}
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
BEGIN:VEVENT
UID:uid1@example.com
DTSTAMP:19970714T170000Z
ORGANIZER;CN=John Doe:MAILTO:john.doe@example.com
DTSTART:19970714T170000Z
DTEND:19970715T035959Z
SUMMARY:Bastille Day Party
END:VEVENT
END:VCALENDAR
{{% /calendar %}}

Any ideas?

Thanks in advance!

Kwpolska commented 7 years ago

Fixed (with one more bug), please run nikola plugin -i ical to re-install.