Modify

Opened 16 years ago

Closed 16 years ago

#3481 closed defect (fixed)

Some cleaning and fixing

Reported by: Álvaro Iradier Owned by: Diorgenes Felipe Grzesiuk
Priority: normal Component: TracWikiToPdfPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

Hi,

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 Álvaro Iradier 16 years ago.
wikitopdf_2.1.zip (601.7 KB) - added by Álvaro Iradier 16 years ago.
Full code with patch applied
wikitopdf_2.1.1_to_2.1.2.patch (11.7 KB) - added by Nickolas Grigoriadis 16 years ago.
Port the patch to apply to version 2.1.1

Download all attachments as: .zip

Change History (6)

Changed 16 years ago by Álvaro Iradier

Changed 16 years ago by Álvaro Iradier

Attachment: wikitopdf_2.1.zip added

Full code with patch applied

comment:1 Changed 16 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/formatter.py", 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/formatter.py", line 179, in process

text = self.processor(text)

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

text)

File "/usr/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/wiki/macros.py", 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/perm.py", 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/perm.py", 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/perm.py", line 432, in check_permission

(username, action, resource))

File "/usr/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/resource.py", 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 16 years ago by Nickolas Grigoriadis

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 16 years ago by Nickolas Grigoriadis

Port the patch to apply to version 2.1.1

comment:3 Changed 16 years ago by Diorgenes Felipe Grzesiuk

Resolution: fixed
Status: newclosed

Hi Friends

Thanks you for correction!

I applied patchs in version 2.2

Regards

Diorgenes F. Grzesiuk

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Diorgenes Felipe Grzesiuk.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.