maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Python Rendering HTML (https://talk.maemo.org/showthread.php?t=12201)

ezuall 2007-11-24 11:40

Python Rendering HTML
 
All,

I've started work on uGly Mail. It's basically a very simple thumb-friendly frontend for GMail. I'm using PyGTK and libgmail at present, but I need some way of Rendering HTML emails.

Do you have any suggestions and would GtkHTML be an option here?

I've had a quick search through the forum for a an answer, but if I missed it just point me at the correct thread.

Regards
ezuall

Bernard 2007-11-24 12:00

Re: Python Rendering HTML
 
I don't have any experience in implementing anything like this, but as far as I know there aren't any pure python HTML rendering libraries.

On a normal linux Gnome installation you can use PyGtkMoz bindings to render HTML
http://patrick.wagstrom.net/tutorial...kmozembed.html

This probably won't work out of the box on Maemo, but since the new webbrowser is Mozilla based, you may be able to get it working (please post your findings, I would very much like to know)

There was a pure python webbrowser made a few years ago: Grail
Sadly it isn't maintained anymore, and it only supported HTML 3.2 without javascript. It doesn't function correctly on newer python releases (it was made using python 1.5 if I'm not mistaken).
So using that code as a html renderer will probably need a lot of work. http://grail.sourceforge.net/

ezuall 2007-11-24 12:19

Re: Python Rendering HTML
 
Thank you, I'll look into these.

tomas.rollo 2007-11-24 12:59

Re: Python Rendering HTML
 
Or, since gtkhtml is included in maemo SDK, you could maybe try to compile and use the python gtkhtml bindings from gnome-python-extras (http://svn.gnome.org/viewvc/gnome-py...nk/gtkhtml2/)?

yerga 2007-12-03 22:25

Re: Python Rendering HTML
 
2 Attachment(s)
I compiled in chinook python-gtkhtml2 from gnome-python-extras (and btw libgtkhtml2 and libgail).

It works well in OS2008. Not tested in other versions.
If tomorrow I have time I will do a package for it.

The gtkhtml example looks so in gnome.org:

Khertan 2007-12-04 08:18

Re: Python Rendering HTML
 
As i am an python developer i say thanks for the compilation of "python-gtkhtml2" !

yerga 2007-12-05 19:19

Re: Python Rendering HTML
 
I uploaded the armel deb compiled packages to maemo garage: http://garage.maemo.org/projects/python-gtkhtml2/
It needs first libgail, libgail-common and libgtkhtml2. These packages can't be installed with Aplication Manager.

Soon I will upload all packages to extras-devel repository.
And source code for gnome-python-extras (renamed to python-gtkhtml2). I only modified the debian directory for compile only the gtkhtml2 module. A bit rude but it worked.

Bernard 2007-12-05 19:34

Re: Python Rendering HTML
 
very very cool

yerga 2007-12-05 19:57

Re: Python Rendering HTML
 
One more thing, I think that it only works in OS2008/Chinook.
Libgtkhtml2 needs Cairo support for compile and it is only avalaible for Chinook.


All times are GMT. The time now is 23:02.

vBulletin® Version 3.8.8