mw-render not picking up customconfig.py

132 views
Skip to first unread message

Swaroop

unread,
Sep 30, 2008, 4:40:51 PM9/30/08
to mwlib
Hi,

After Volker's quick reply to my previous question on specifying PDF
size ( http://groups.google.com/group/mwlib/t/b5d8e22147c61d61 ), I
set up mwlib on my own server and it installed smoothly, thanks to
`easy_install`.

I was able to switch $wgCollectionMWServeURL to the new server and
confirmed that it is talking to the new server via the log generated
by mw-serve (specified by `-l` option, I think).

I added a `customconfig.py` file to /usr/lib/python2.5/site-packages/
mwlib.rl-0.8.2-py2.5.egg/mwlib/rl/ directory with the following
content:

#! /usr/bin/env python
#! -*- coding:utf-8 -*-

from reportlab.lib.units import cm, inch
new_size = (8*inch, 10*inch)

######### PAGE CONFIGURATION
pageMarginHor = 2 * cm
pageMarginVert= 2 * cm
pageWidth, pageHeight = new_size
printWidth = pageWidth - 2*pageMarginHor
printHeight = pageHeight - 2*pageMarginVert

However, the new PDFs being generated are still the same old size. I
even tried hacking `pdfstyles.py` itself but still observed no change.

I'm baffled because it appears to be talking to the right server but
changes are not being reflected.

Is editing the files within an egg the problem?

Would greatly appreciate any help.

Regards,
Swaroop

Swaroop

unread,
Oct 1, 2008, 3:41:13 AM10/1/08
to mwlib

I am able to confirm that the changes are being picked up:

pdfstyles.py : 2008-10-01 03:35:26.208707 ; pageWidth = 576.0
customconfig.py : 2008-10-01 03:35:26.209123

But *still*, the resulting PDF size is 8.27 x 11.69 inches.

Has anybody tried this successfully?

Regards,
Swaroop

Volker Haas

unread,
Oct 1, 2008, 9:46:11 AM10/1/08
to mw...@googlegroups.com
Hi Swaroop,

actually you are right. Currently there is a bug preventing proper page size customization.
I opened a ticket for that http://code.pediapress.com/wiki/ticket/310
I'll fix this soon.

Best,
Volker
-- 
volker haas                 brainbot technologies ag
fon +49 6131 2116394        boppstraße 64
fax +49 6131 2116392        55118 mainz
volke...@brainbot.com    http://www.brainbot.com/

Swaroop

unread,
Oct 1, 2008, 10:06:19 AM10/1/08
to mwlib
Hi Volker,

Thanks for confirming it's a bug!

On a different note, just wanted to thank you guys for the awesome
functionality that you are providing. I'm now finally able to sell
printed copies of my Creative Commons-licensed book [1], which many
readers had requested [2]. Everyday, someone discovers mwlib and is
very happy like this person Dan [3]:

"That, sir, is a truly awesome piece of software, and written in
Python too. Thanks for making me aware of it. A big +1."

[1] http://www.swaroopch.com/notes/Python
[2] http://www.swaroopch.com/buybook
[3] http://stackoverflow.com/questions/154592/python-module-for-wiki-markup#154790

Regards,
Swaroop

On Oct 1, 6:46 pm, Volker Haas wrote:
> actually you are right. Currently there is a bug preventing proper page size customization.
> I opened a ticket for thathttp://code.pediapress.com/wiki/ticket/310

Volker Haas

unread,
Oct 14, 2008, 9:08:01 AM10/14/08
to mw...@googlegroups.com
Hi Swaroop

Swaroop wrote:
> Hi Volker,
>
> Thanks for confirming it's a bug!
>
>

Sorry the fix took so long, I thought that I did not have to time to fix
the issue since other stuff was more important. But actually the fix was
so laughably easy, and the bug so stupid... I wish that I had just fixed
the bug and not even opened a ticket for that ;)

> On a different note, just wanted to thank you guys for the awesome
> functionality that you are providing.

That's always nice to hear ;)

Regards,
Volker

Reply all
Reply to author
Forward
0 new messages