Description:
Fix issue #6 (401 from upload.py in rietveld when using 'localhost')
Please review this at http://codereview.appspot.com/5684055/
Affected files:
M examples/rietveld/patches/upload.diff
Index: examples/rietveld/patches/upload.diff
===================================================================
--- a/examples/rietveld/patches/upload.diff
+++ b/examples/rietveld/patches/upload.diff
@@ -1,5 +1,5 @@
---- upload.py 2011-11-23 08:22:31.946714363 +0100
-+++ ../upload.py 2011-11-23 08:23:26.410984436 +0100
+--- rietveld.hg/upload.py Tue Nov 22 14:12:02 2011 -0500
++++ ../upload.py Tue Feb 21 16:02:54 2012 -0500
@@ -289,7 +289,7 @@
response.headers, response.fp)
self.authenticated = True
@@ -67,3 +67,25 @@
if self.save_cookies:
StatusUpdate("Saving authentication cookies to %s" %
self.cookie_file)
self.cookie_jar.save()
+@@ -620,21 +655,6 @@
+
+ # If this is the dev_appserver, use fake authentication.
+ host = (host_override or server).lower()
+- if re.match(r'(http://)?localhost([:/]|$)', host):
+- if email is None:
+- email = "te...@example.com"
+- logging.info("Using debug user %s. Override with --email" % email)
+- server = rpc_server_class(
+- server,
+- lambda: (email, "password"),
+- host_override=host_override,
+- extra_headers={"Cookie":
+- 'dev_appserver_login="%s:False"' % email},
+- save_cookies=save_cookies,
+- account_type=account_type)
+- # Don't try to talk to ClientLogin.
+- server.authenticated = True
+- return server
+
+ def GetUserCredentials():
+ """Prompts the user for a username and password."""