Opened 8 years ago

Closed 8 years ago

#3481 closed defect (fixed)

Some cleaning and fixing

Reported by: airadier Owned by: diorgenes
Priority: normal Component: TracWikiToPdfPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11



after having some problems with the plugin, I decided to do some cleanup and fixing.

  • Avoid using a title file when titlefile option is missing. It caused some trouble.
  • Changed VERSAO and DATA in title template page to VERSION and DATE, and update example template.
  • Fix identation.
  • Remove duplicated code to convert from wiki->html and from html->pdf (execute htmldoc).
  • Some minor cleanups.
  • Updated version to 2.1

Next step is migrating to Genshi :)

I'm attaching the .diff file, and also the full source in .zip, so anyone can download and try.

Attachments (3)

wiki_to_pdf_clean_and_fix.patch (15.7 KB) - added by airadier 8 years ago. (601.7 KB) - added by airadier 8 years ago.
Full code with patch applied
wikitopdf_2.1.1_to_2.1.2.patch (11.7 KB) - added by grigi 8 years ago.
Port the patch to apply to version 2.1.1

Download all attachments as: .zip

Change History (6)

Changed 8 years ago by airadier

Changed 8 years ago by airadier

Full code with patch applied

comment:1 Changed 8 years ago by asperon

I still get this error when using this updated version: 2008-08-12 13:44:54,843 Trac[formatter] ERROR: Macro Image(visma2.jpg, 200px) failed Traceback (most recent call last):

File "/usr/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/wiki/", line 468, in _macro_formatter

return macro.process(args, in_paragraph=True)

File "/usr/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/wiki/", line 179, in process

text = self.processor(text)

File "/usr/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/wiki/", line 166, in _macro_processor


File "/usr/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/wiki/", line 425, in expand_macro

if attachment and 'ATTACHMENT_VIEW' in formatter.perm(attachment):

File "/usr/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/", line 523, in has_permission

return self._has_permission(action, resource)

File "/usr/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/", line 537, in _has_permission

check_permission(action, perm.username, resource, perm)

File "/usr/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/", line 432, in check_permission

(username, action, resource))

File "/usr/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/", line 111, in repr

return '<Resource %r>' % (', '.join(reversed(path)))

TypeError: sequence item 0: expected string, NoneType found

This means that all images in the generated pdf shows up as a error message instead of the attached file.

comment:2 Changed 8 years ago by grigi

Updated the patch to apply cleanly to version 4160.

Changes version 2.1.1 to 2.1.2

Fixed a bug with exporting a "book" from the Admin interface, where the 'pathtocover' variable was not configured correctly.

Ported over the changes introduced in version 2.1.1

Changed 8 years ago by grigi

Port the patch to apply to version 2.1.1

comment:3 Changed 8 years ago by diorgenes

  • Resolution set to fixed
  • Status changed from new to closed

Hi Friends

Thanks you for correction!

I applied patchs in version 2.2


Diorgenes F. Grzesiuk

Add Comment

Modify Ticket

as closed The owner will remain diorgenes.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.