Merge lp:~jamalta/gwibber/397297 into lp:gwibber/1.2

Proposed by Jamal Fanaian
Status: Rejected
Rejected by: Ken VanDine
Proposed branch: lp:~jamalta/gwibber/397297
Merge into: lp:gwibber/1.2
Diff against target: None lines
To merge this branch: bzr merge lp:~jamalta/gwibber/397297
Reviewer Review Type Date Requested Status
Alexander Sack (community) Needs Resubmitting
Review via email: mp+8544@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alexander Sack (asac) wrote :

please remove the commented code, e.g.:
  #def get_auth(self):
  ...

review: Needs Resubmitting
lp:~jamalta/gwibber/397297 updated
349. By Jamal Fanaian

Removed commented get_auth blocks

Revision history for this message
Jamal Fanaian (jamalta) wrote :

Sorry about that, I must have forgotten to push the changes when you asked
last week. I have pushed the changes now and they appear to be there. Do I
need to resubmit my merge proposal?

Jamal Fanaian
407.479.7533
http://jamalfanaian.com

On Sun, Jul 12, 2009 at 5:27 PM, Alexander Sack <email address hidden> wrote:

> Review: Resubmit
> please remove the commented code, e.g.:
> #def get_auth(self):
> ...
>
> --
> https://code.edge.launchpad.net/~jamalfanaian/gwibber/397297/+merge/8544<https://code.edge.launchpad.net/%7Ejamalfanaian/gwibber/397297/+merge/8544>
> You are the owner of lp:~jamalfanaian/gwibber/397297.
>

Unmerged revisions

349. By Jamal Fanaian

Removed commented get_auth blocks

348. By Jamal Fanaian

Provided the fix with using HTTPBasicAuth object to the laconica client

347. By Jamal Fanaian

The issue was resolved by using an urllib2.HTTPBasicAuthHandler to do authentication instead of passing the authentication header to urllib2.Request. Fixed the issue for twitter and identica.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'gwibber/microblog/identica.py'
--- gwibber/microblog/identica.py 2009-06-21 01:17:53 +0000
+++ gwibber/microblog/identica.py 2009-07-09 19:19:50 +0000
@@ -122,16 +122,23 @@
122 def __init__(self, acct):122 def __init__(self, acct):
123 self.account = acct123 self.account = acct
124124
125 def get_auth(self):125 #def get_auth(self):
126 return "Basic %s" % base64.encodestring(126 #return "Basic %s" % base64.encodestring(
127 ("%s:%s" % (self.account["username"], self.account["private:password"]))).strip()127 #("%s:%s" % (self.account["username"], self.account["private:password"]))).strip()
128128
129 def public_enabled(self):129 def public_enabled(self):
130 return self.account["public_enabled"]130 return self.account["public_enabled"]
131131
132 def connect(self, url, data = None):132 def connect(self, url, data = None):
133 # Set up urllib2 authentication
134 password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm()
135 password_mgr.add_password(None, url,
136 self.account["username"], self.account["private:password"])
137 urllib2.install_opener(urllib2.build_opener(
138 urllib2.HTTPBasicAuthHandler(password_mgr)))
139
133 return urllib2.urlopen(urllib2.Request(140 return urllib2.urlopen(urllib2.Request(
134 url, data, {"Authorization": self.get_auth()})).read()141 url, data)).read()
135142
136 def get_messages(self):143 def get_messages(self):
137 return simplejson.loads(self.connect(144 return simplejson.loads(self.connect(
138145
=== modified file 'gwibber/microblog/laconica.py'
--- gwibber/microblog/laconica.py 2009-06-21 00:04:28 +0000
+++ gwibber/microblog/laconica.py 2009-07-09 19:19:50 +0000
@@ -127,13 +127,21 @@
127 if self.account["allow_insecure"]: return "http://" + d + path127 if self.account["allow_insecure"]: return "http://" + d + path
128 return "https://" + d + path128 return "https://" + d + path
129129
130 def get_auth(self):130 #def get_auth(self):
131 return "Basic %s" % base64.encodestring(131 #return "Basic %s" % base64.encodestring(
132 ("%s:%s" % (self.account["username"], self.account["private:password"]))).strip()132 #("%s:%s" % (self.account["username"], self.account["private:password"]))).strip()
133133
134 def connect(self, url, data = None):134 def connect(self, url, data = None):
135 return urllib2.urlopen(urllib2.Request(135 url = self.url(url)
136 self.url(url), data, {"Authorization": self.get_auth()}))136
137 # Set up urllib2 authentication
138 password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm()
139 password_mgr.add_password(None, url,
140 self.account["username"], self.account["private:password"])
141 urllib2.install_opener(urllib2.build_opener(
142 urllib2.HTTPBasicAuthHandler(password_mgr)))
143
144 return urllib2.urlopen(urllib2.Request(url, data))
137145
138 def get_messages(self):146 def get_messages(self):
139 return simplejson.load(self.connect("/api/statuses/friends_timeline.json"))147 return simplejson.load(self.connect("/api/statuses/friends_timeline.json"))
140148
=== modified file 'gwibber/microblog/twitter.py'
--- gwibber/microblog/twitter.py 2009-06-21 01:17:53 +0000
+++ gwibber/microblog/twitter.py 2009-07-09 19:19:50 +0000
@@ -159,13 +159,20 @@
159 self.account["username"] != None and \159 self.account["username"] != None and \
160 self.account["private:password"] != None160 self.account["private:password"] != None
161161
162 def get_auth(self):162 #def get_auth(self):
163 return "Basic %s" % base64.encodestring(163 #return "Basic %s" % base64.encodestring(
164 ("%s:%s" % (self.account["username"], self.account["private:password"]))).strip()164 #("%s:%s" % (self.account["username"], self.account["private:password"]))).strip()
165165
166 def connect(self, url, data = None):166 def connect(self, url, data = None):
167 # Set up urllib2 authentication
168 password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm()
169 password_mgr.add_password(None, url,
170 self.account["username"], self.account["private:password"])
171 urllib2.install_opener(urllib2.build_opener(
172 urllib2.HTTPBasicAuthHandler(password_mgr)))
173
167 return urllib2.urlopen(urllib2.Request(174 return urllib2.urlopen(urllib2.Request(
168 url, data, headers = {"Authorization": self.get_auth()})).read()175 url, data)).read()
169176
170 def get_messages(self):177 def get_messages(self):
171 return simplejson.loads(self.connect(178 return simplejson.loads(self.connect(

Subscribers

People subscribed via source and target branches