projects
/
osm
/
N2VC.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add Juju Public Key
[osm/N2VC.git]
/
modules
/
libjuju
/
juju
/
client
/
gocookies.py
diff --git
a/modules/libjuju/juju/client/gocookies.py
b/modules/libjuju/juju/client/gocookies.py
index
a8a0df8
..
3e48b8d
100644
(file)
--- a/
modules/libjuju/juju/client/gocookies.py
+++ b/
modules/libjuju/juju/client/gocookies.py
@@
-15,7
+15,7
@@
class GoCookieJar(cookiejar.FileCookieJar):
to implement the actual cookie loading'''
data = json.load(f) or []
now = time.time()
to implement the actual cookie loading'''
data = json.load(f) or []
now = time.time()
- for cookie in map(
_new
_py_cookie, data):
+ for cookie in map(
go_to
_py_cookie, data):
if not ignore_expires and cookie.is_expired(now):
continue
self.set_cookie(cookie)
if not ignore_expires and cookie.is_expired(now):
continue
self.set_cookie(cookie)
@@
-37,12
+37,12
@@
class GoCookieJar(cookiejar.FileCookieJar):
continue
if not ignore_expires and cookie.is_expired(now):
continue
continue
if not ignore_expires and cookie.is_expired(now):
continue
- go_cookies.append(
_new
_go_cookie(cookie))
+ go_cookies.append(
py_to
_go_cookie(cookie))
with open(filename, "w") as f:
f.write(json.dumps(go_cookies))
with open(filename, "w") as f:
f.write(json.dumps(go_cookies))
-def
_new
_py_cookie(go_cookie):
+def
go_to
_py_cookie(go_cookie):
'''Convert a Go-style JSON-unmarshaled cookie into a Python cookie'''
expires = None
if go_cookie.get('Expires') is not None:
'''Convert a Go-style JSON-unmarshaled cookie into a Python cookie'''
expires = None
if go_cookie.get('Expires') is not None:
@@
-75,7
+75,7
@@
def _new_py_cookie(go_cookie):
)
)
-def
_new
_go_cookie(py_cookie):
+def
py_to
_go_cookie(py_cookie):
'''Convert a python cookie to the JSON-marshalable Go-style cookie form.'''
# TODO (perhaps):
# HttpOnly
'''Convert a python cookie to the JSON-marshalable Go-style cookie form.'''
# TODO (perhaps):
# HttpOnly