Zim

Error while exporting only a single page through command line

Asked by Shivam Sharma

While exporting a single page using command-line, it throws up error. The error appears only when using templates which also print the index. Surprisingly, the export of a single using the GUI is done without any errors.

Here is the error:

ERROR: Exception in main()
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/zim/main.py", line 446, in main
    obj.run()
  File "/usr/lib/pymodules/python2.7/zim/main.py", line 378, in run
    exporter.export(selection)
  File "/usr/lib/pymodules/python2.7/zim/export/exporters/__init__.py", line 24, in export
    for p in self.export_iter(pages):
  File "/usr/lib/pymodules/python2.7/zim/export/exporters/files.py", line 83, in export_iter
    self.export_page(pages.notebook, page, pages, prevpage=prev, nextpage=next)
  File "/usr/lib/pymodules/python2.7/zim/export/exporters/files.py", line 129, in export_page
    self.template.process(lines, context)
  File "/usr/lib/pymodules/python2.7/zim/templates/__init__.py", line 174, in process
    self.emit('process', output, context)
  File "/usr/lib/pymodules/python2.7/zim/signals.py", line 376, in emit
    return call_default(self, signal, args)
  File "/usr/lib/pymodules/python2.7/zim/signals.py", line 224, in call_default
    return method(*args)
  File "/usr/lib/pymodules/python2.7/zim/templates/__init__.py", line 178, in do_process
    processor.process(output, context)
  File "/usr/lib/pymodules/python2.7/zim/templates/processor.py", line 81, in process
    self.__call__(output, self.main, context)
  File "/usr/lib/pymodules/python2.7/zim/templates/processor.py", line 111, in __call__
    value = expr(context)
  File "/usr/lib/pymodules/python2.7/zim/templates/expression.py", line 288, in __call__
    return function(*args)
  File "/usr/lib/pymodules/python2.7/zim/templates/expression.py", line 349, in __call__
    return self._func(self._obj, *a)
  File "/usr/lib/pymodules/python2.7/zim/export/template.py", line 283, in index_function
    elif ignore_empty and not (path.hascontent or path.haschildren):
AttributeError: 'Path' object has no attribute 'hascontent'

Question information

Language:
English Edit question
Status:
Answered
For:
Zim Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jaap Karssenberg (jaap.karssenberg) said :
#1

This is a bug, not a question, please report as a bug.

Regards,

Jaap

Can you help with this problem?

Provide an answer of your own, or ask Shivam Sharma for more information if necessary.

To post a message you must log in.