Some bug fixes and small changes
authorMarek Marecki <marekjm@taistelu.com>
Fri, 12 Jul 2013 11:31:36 +0000 (13:31 +0200)
committerMarek Marecki <marekjm@taistelu.com>
Fri, 12 Jul 2013 11:31:36 +0000 (13:31 +0200)
Makefile
diaspy/connection.py
diaspy/models.py

index d2d66b2fc148b3b0bc6b9c108a9ccfb0b2a36b29..40cdd456f10a025d04110c77e5ac2e139427280a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -14,3 +14,8 @@ clean:
        rm -rv diaspy/*.pyc
        rm -rv ./__pycache__/
        rm -rv *.pyc
+
+install:
+       python setup.py install
+       rm -rvf dist/
+       rm -rvf diaspy.egg-info
index 28b5f8dec79264844938684cd05f5446dac26005..3c1a0be1a489cc603c366c86f8f0e0e78f568ecd 100644 (file)
@@ -39,9 +39,11 @@ class Connection():
         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):
index 3cbe814a958a16301908cd0ab9f56b09bd96835c..9e87f651a3f9d6cf993c4d93f4fd1b809f54d65f 100644 (file)
@@ -220,13 +220,12 @@ class Post():
     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.