Small changes in `client.py` related to use of `Connection()`
authorMarek Marecki <triviuss@gmail.com>
Sat, 13 Apr 2013 23:18:23 +0000 (01:18 +0200)
committerMarek Marecki <triviuss@gmail.com>
Sat, 13 Apr 2013 23:18:23 +0000 (01:18 +0200)
TODO.mdown [deleted file]
diaspy/client.py

diff --git a/TODO.mdown b/TODO.mdown
deleted file mode 100644 (file)
index 9bc2cc1..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-0.  write `connection.py` module and port diaspy to use it,
-  * `_sessionpost()` -> `Connection.post()` etc.,
-  * `login()` for logging in,
-  * `_setlogin()` for setting login data,
-  * (?) `_setpod()` for setting pod,
-  * (?) `_setusername()` for setting username,
-  * (?) `_setpassword()`for setting password,
-  * `_switchpod()` for switching pods on the fly (killer feature)
-    unsuccessful switch will result in disconnecting from current pod (?) or 
-    will keep the connection but raise an exception/warning,
-1.  refactor all code to use naming convention: `camelCase()` for methods and 
-    `underscored_names` for variables; preceding underscore accepted for private stuff,
-2.  add more killer-features,
index 8a1a7ad41e736fb8bd21d629164fa24ad8eb871f..9adf538b098b4906a90bbae3ddd1c6c3e3d5502e 100644 (file)
@@ -49,7 +49,7 @@ class Client:
             raise Exception('{0}: Post could not be posted.'.format(
                             r.status_code))
 
-        return diaspy.models.Post(str(r.json()['id']), self)
+        return diaspy.models.Post(str(r.json()['id']), self.connection)
 
     def post(self, text, aspect_ids='public', photos=None):
         """This function sends a post to an aspect
@@ -246,7 +246,7 @@ class Client:
                 'conversation[subject]': subject,
                 'conversation[text]': text,
                 'utf8': '&#x2713;',
-                'authenticity_token': self.get_token()}
+                'authenticity_token': self.connection.getToken()}
 
         r = self.connection.post('conversations/',
                                  data=data,