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.
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
-import json
-import time
-from diaspy.models import Post, Aspect
-
"""Docstrings for this module are taken from:
https://gist.github.com/MrZYX/01c93096c30dc44caf71
"""
+import json
+import time
+from diaspy.models import Post, Aspect
+from diaspy import errors
+
+
class Generic():
"""Object representing generic stream.
"""
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):