| Reply | « Previous Thread | Next Thread » |
|
I'd like to announce the release of waplib module 0.0.3, a tiny module to extend API of urllib module. It overrides urllib module to
Code:
import socket
import urllib
# Proxy Address (USER edits this line)
PROXY = {'http': 'http://proxy.address.com:8080'}
# Access Point Setting
apid = socket.select_access_point()
ap = socket.access_point(apid)
socket.set_default_access_point(ap)
class ExtURLopener(urllib.FancyURLopener):
def __init__(self, proxy, headers):
urllib.FancyURLopener.__init__(self, proxy)
self.addheaders = []
for k, v in headers.iteritems():
self.addheaders.append((k, v))
urllib._urlopener = ExtURLopener(PROXY, {'User-Agent': 'Nokia N73'})
# Access
f = urllib.urlopen('http://www.python.org/')
f.read()
f.close()
ap.stop()
Code:
import socket
import urllib
import waplib
# Network Setting
wap = socket.access_point(waplib.APID_WAP)
socket.set_default_access_point(wap)
waplib.wap_connection({'User-Agent': 'Nokia N73'})
# Access
f = urllib.urlopen('http://www.python.org/')
f.read()
f.close()
wap.stop()
As a demonstration, I've developed PyTwitterS60, the simplest Twitter client on PyS60. Twitter API needs basic authentication, so you have to add 'Authorization' to HTTP header with waplib module. On PyTwitterS60, you can only tweet, but a number of required clicks are only two, so I suppose it's convenient for just tweeting continually. waplib module and PyTwitterS60 are both licensed under GNU GPL. And user accepts them AS-IS, WITH ALL FAULTS. You can download them from my PyS60 page here. I'll welcome any comments from you ![]() |
|
Hello Hiisi ,
Great addition to PyS60 ![]() What a first great announce ![]() BR Cyke64 pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 ! pys60 extension modules on http://cyke64.googlepages.com/ |
|
Hi Hiisi,
Indeed its a great addition. Quote:
![]() Best Regards, Croozeus |
|
Great work done.
Twitter is saving loads of my effort, a further enhancement from your side will make my job pretty easy. IDEAS is all they need but still they think only Genius can give them that. |
| shubhendra |
| View Public Profile |
| Find all posts by shubhendra |
|
So, forgive for not having tried the module yet
, but what is waplib approach to avoid asking user for the proxy settings?thanks |
|
Quote:
As you know, it's impossible to get proxy settings by PyS60. You need to fill proxy settings in waplib module by yourself. waplib module is a very simple module, so probably you can understand what I mean by reading my code ![]() |
|
And, I've written a practical guide: "How to display text query on standby screen".
EDIT: I use this method in PyTwitterS60.
Last edited by Hiisi : 2008-08-29 at 17:43.
|
|
Join Date: Feb 2008
Posts: 2,544
Location: Bhavnagar, Gujarat, India
gaba88
Online
Forum Nokia Champion
|
|
|
Quote:
really nice work. i have a small advice why dont you contribute at the wiki too. Hope you take the advice seriously enjoy pythoning gaba88 Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60 |
|
Quote:
[OFFTOPIC] My handle is "Hiisi", not "Hissi" Hiisi are a kind of tutelary spirits in Finland - Hiisi on Wikipedia (Suomi)[/OFFTOPIC] |
|
Join Date: Feb 2008
Posts: 2,544
Location: Bhavnagar, Gujarat, India
gaba88
Online
Forum Nokia Champion
|
||
|
Quote:
Quote:
![]() hope you will not mind it. ![]() Enjoy Pythoning Gaba88 Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60 |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Carbide.j 1.5 and Netbeans 5.5 beta 2 | ovjo12 | Mobile Java Tools & SDKs | 5 | 2007-06-11 06:43 |