`Client()` is now ruling-em-all with one post method
authorMarek Marecki <triviuss@gmail.com>
Tue, 7 May 2013 22:07:35 +0000 (00:07 +0200)
committerMarek Marecki <triviuss@gmail.com>
Tue, 7 May 2013 22:07:35 +0000 (00:07 +0200)
diaspy/client.py

index 1db18f98fadc98bafcf5db8ef0b06215f21703b8..08745502f9e717f6e9b0ff2d055e4d865a949259 100644 (file)
@@ -28,27 +28,21 @@ class Client:
             self.connection.login()
         self.stream = diaspy.streams.Stream(self.connection, 'stream.json')
 
-    def post(self, text, aspect_ids='public', photos=None):
+    def post(self, text, aspect_ids='public', photos=None, photo=''):
         """This function sends a post to an aspect
 
-        :param text: Text to post.
+        :param text: text to post
         :type text: str
         :param aspect_ids: Aspect ids to send post to.
         :type aspect_ids: str
-
+        :param photo: path to picture file
+        :type photo: str
         :returns: diaspy.models.Post -- the Post which has been created
         """
-        post = self.stream.post(text, aspect_ids, photos)
+        post = self.stream.post(text, aspect_ids, photos, photo)
         return post
 
-    def post_picture(self, filename):
-        """This method posts a picture to D*.
-
-        :param filename: Path to picture file.
-        :type filename: str
-        """
-        return self.stream.post_picture(filename)
-
     def get_activity(self):
         """This function returns activity stream.