pydoc will now correctly read doctsing for diaspy/streams.py,
authorMarek Marecki <marekjm@taistelu.com>
Thu, 8 Aug 2013 16:20:16 +0000 (18:20 +0200)
committerMarek Marecki <marekjm@taistelu.com>
Thu, 8 Aug 2013 16:20:16 +0000 (18:20 +0200)
Post().delete_like() now returns error code on success

diaspy/models.py
diaspy/streams.py

index ea881999a34ad8473d6b8295d07af2511c21f2cf..0c5f4f2c236f6c8c6f32a57516eb3e9e61c617fe 100644 (file)
@@ -27,7 +27,7 @@ class Aspect():
         elif name and not id:
             self.id = self._findid()
         elif not id and not name:
-            raise Exception("Aspect must be initialized with either an id or name")
+            raise Exception('Aspect must be initialized with either an id or name')
 
     def _findname(self):
         """Finds name for aspect.
@@ -376,6 +376,7 @@ class Post():
         if request.status_code != 204:
             raise errors.PostError('{0}: Comment could not be deleted'
                             .format(request.status_code))
+        return request.status_code
 
     def delete(self):
         """ This function deletes this post
index d1834b95605c2ffb1a04ef44f775cd5bada1e8fb..461fb03c8aedc12300a7bef0b5cfb2b7db85d5ee 100644 (file)
@@ -1,7 +1,3 @@
-import json
-import time
-from diaspy.models import Post, Aspect
-
 """Docstrings for this module are taken from:
 https://gist.github.com/MrZYX/01c93096c30dc44caf71
 
@@ -10,6 +6,12 @@ http://pad.spored.de/ro/r.qWmvhSZg7rk4OQam
 """
 
 
+import json
+import time
+from diaspy.models import Post, Aspect
+from diaspy import errors
+
+
 class Generic():
     """Object representing generic stream.
     """
@@ -56,7 +58,7 @@ class Generic():
         if max_time: params['max_time'] = max_time
         request = self._connection.get(self._location, params=params)
         if request.status_code != 200:
-            raise error.StreamError('wrong status code: {0}'.format(request.status_code))
+            raise errors.StreamError('wrong status code: {0}'.format(request.status_code))
         return [Post(self._connection, post['id']) for post in request.json()]
 
     def _expand(self, new_stream):