Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gnome proxy con turpial #18

Closed
aalih opened this issue Aug 3, 2010 · 1 comment
Closed

Gnome proxy con turpial #18

aalih opened this issue Aug 3, 2010 · 1 comment

Comments

@aalih
Copy link
Contributor

aalih commented Aug 3, 2010

Turpial usa el proxy definido en gnome solo si se inicia desde la consola, aqui va un patch que le da solucion (probado en debian-sid con python 2.5.5-6 y 2.6.5+20100730-1):

--- oauth_client.py.orig 2010-08-03 14:44:51.000000000 -0400
+++ oauth_client.py 2010-08-03 16:18:41.000000000 -0400
@@ -1,6 +1,7 @@
import httplib
import urllib2
import oauth as oauth
+import gconf

SERVER = 'twitter.com'
PORT = 80
@@ -9,6 +10,20 @@
ACCESS_TOKEN_URL = '%s/oauth/access_token'
AUTHORIZATION_URL = '%s/oauth/authorize'

+gclient = gconf.client_get_default()
+proxies = {}
+if gclient.get_bool('/system/http_proxy/use_http_proxy'):

  • proxies['http'] = "http://%s:%d" % (gclient.get_string('/system/http_proxy/host'), gclient.get_int('/system/http_proxy/port'))
  • if gclient.get_bool('/system/http_proxy/use_same_proxy'):
  •    proxies['https'] = proxies['http'].replace('http:', 'https:')
    
  • elif gclient.get_string('/system/proxy/secure_host'):
  •    proxies['https'] = "https://%s:%d" % (gclient.get_string('/system/http/secure_host'), gclient.get_int('/system/proxy/secure_port'))
    
    +if proxies:
  • proxy_handler = urllib2.ProxyHandler(proxies)
  • opener = urllib2.build_opener(proxy_handler, urllib2.HTTPHandler)
  • urllib2.install_opener(opener)

class TurpialAuthClient(oauth.OAuthClient):

 def **init**(self, server=SERVER, port=httplib.HTTP_PORT, 
@aalih
Copy link
Contributor Author

aalih commented Aug 3, 2010

veo que el codigo se "desorganizo" un poco, pueden descargar el patch de aqui: http://muskrat.latertulia.org/~ali/turpial_gnome_proxy.patch

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant