rm -rv diaspy/*.pyc
rm -rv ./__pycache__/
rm -rv *.pyc
+
+install:
+ python setup.py install
+ rm -rvf dist/
+ rm -rvf diaspy.egg-info
self.login_data = {}
self.token = ''
try: self._setlogin(username, password)
- except request.exceptions.MissingSchema: self.pod = '{0}://{1}'.format(schema, self.pod)
+ except requests.exceptions.MissingSchema:
+ self.pod = '{0}://{1}'.format(schema, self.pod)
+ warnings.warn('schema was missing')
finally: pass
- try: self._setlogin()
+ try: self._setlogin(username, password)
except Exception as e: raise LoginError('cannot create login data (caused by: {0})'.format(e))
def __repr__(self):
def __repr__(self):
"""Returns string containing more information then str().
"""
- data = self.get_data()
- return '{0} ({1}): {2}'.format(data['author']['name'], data['author']['diaspora_id'], data['text'])
+ return '{0} ({1}): {2}'.format(self.data['author']['name'], self.data['author']['guid'], self.data['text'])
def __str__(self):
"""Returns text of a post.
"""
- return self.get_data()['text']
+ return self.data['text']
def _fetch(self):
"""This function retrieves data of the post.