Initiaial code in `diaspy/connection.py` TODO list
authorMarek Marecki <triviuss@gmail.com>
Fri, 12 Apr 2013 21:25:45 +0000 (23:25 +0200)
committerMarek Marecki <triviuss@gmail.com>
Fri, 12 Apr 2013 21:25:45 +0000 (23:25 +0200)
TODO.mdown [new file with mode: 0644]
diaspy/connection.py [new file with mode: 0644]

diff --git a/TODO.mdown b/TODO.mdown
new file mode 100644 (file)
index 0000000..9bc2cc1
--- /dev/null
@@ -0,0 +1,13 @@
+0.  write `connection.py` module and port diaspy to use it,
+  * `_sessionpost()` -> `Connection.post()` etc.,
+  * `login()` for logging in,
+  * `_setlogin()` for setting login data,
+  * (?) `_setpod()` for setting pod,
+  * (?) `_setusername()` for setting username,
+  * (?) `_setpassword()`for setting password,
+  * `_switchpod()` for switching pods on the fly (killer feature)
+    unsuccessful switch will result in disconnecting from current pod (?) or 
+    will keep the connection but raise an exception/warning,
+1.  refactor all code to use naming convention: `camelCase()` for methods and 
+    `underscored_names` for variables; preceding underscore accepted for private stuff,
+2.  add more killer-features,
diff --git a/diaspy/connection.py b/diaspy/connection.py
new file mode 100644 (file)
index 0000000..0455574
--- /dev/null
@@ -0,0 +1,11 @@
+#!/usr/bin/env python
+
+
+class Connection():
+    """Object representing connection with the server.
+    It is pushed around internally and is considered private.
+    """
+    def __init__(self, pod, username='', password=''):
+        self.pod = pod
+        self.username, self.password = username, password
+