diff gpp/gcalendar/oauth.py @ 458:9a4bffdf37c3

Finishing up #220. Updated to GData v2.0 and using the new OAuth access token.
author Brian Neal <bgneal@gmail.com>
date Sat, 02 Jul 2011 03:52:43 +0000
parents e44dd53885dc
children
line wrap: on
line diff
--- a/gpp/gcalendar/oauth.py	Fri Jul 01 00:49:11 2011 +0000
+++ b/gpp/gcalendar/oauth.py	Sat Jul 02 03:52:43 2011 +0000
@@ -80,3 +80,20 @@
 
     logger.info("upgraded to access token...")
     return access_token
+
+
+def serialize_token(token):
+    """
+    This function turns a token into a string and returns it.
+
+    """
+    return gdata.gauth.TokenToBlob(token)
+
+
+def deserialize_token(s):
+    """
+    This function turns a string into a token returns it. The string must have
+    previously been created with serialize_token().
+
+    """
+    return gdata.gauth.TokenFromBlob(s)