The Following User Says Thank You to pipeline For This Useful Post: | ||
|
2009-04-17
, 11:22
|
|
Posts: 693 |
Thanked: 502 times |
Joined on Jul 2007
|
#4
|
The Following User Says Thank You to pipeline For This Useful Post: | ||
|
2009-04-17
, 19:53
|
|
Posts: 2,853 |
Thanked: 968 times |
Joined on Nov 2005
|
#5
|
So it turns out setting up a python webserver is really easy.
This opens possibility for all types of simple browser-based applications running in tear or microb, since the python program can have as much permissions as needed.
The webserver needs root permission to bind sockets but this can be permitted for your app via sudoers entry in deb postinstall.
I have found samples for setting up a web server in python. I also found samples for checking pop email in python.
So i figured i'd try to write an app that combined the two and wrote a python program which :
- Hosts a webserver
- Handles simple requests for email summaries
- Handles simple requests for email message retrieval (raw text)
And it works and is very fast but it doesnt strip images from any html encoded messages (SO DONT READ SPAM or ADS which might track image retrieval). And my sample hardcodes username, password, and popserver... but this could be saved in config file just like any other app.
I'm not sure i'll have time to develop this enough to accomodate all users, so i'll just point users to my python samples directory here :
http://wardenclyffetower.com/MaemoFiles/python/
My samples dont indicate this but for most apps your program launch script could :
- start python webserver, launching in background (append '&')
- launch browser, pointing to your web app
- then run simple python script to request a url such as 'http://localhost/quit.htm'
- and have your webserver use that as signal to quit
That would make your web app start and stop like any other app (or you could just let it keep running)
Still this is a viable development platform for persons who might want to use python power with familiar html user interface.
Last edited by pipeline; 2009-04-17 at 01:30.