[connection] invert __init__ parameter
Takes session first. At some point, the connection_id will become optional for Connection
created explicitly.
--- a/server/session.py Wed Jun 26 13:43:22 2013 +0200
+++ b/server/session.py Tue Jun 25 18:15:45 2013 +0200
@@ -419,7 +419,7 @@
is_request = False
- def __init__(self, cnxid, session):
+ def __init__(self, session, cnxid):
# using super(Connection, self) confuse some test hack
RequestSessionBase.__init__(self, session.vreg)
#: connection unique id
@@ -1259,7 +1259,7 @@
raise SessionClosedError('try to access connections set on a closed session %s' % self.id)
cnx = self._cnxs[cnxid]
except KeyError:
- cnx = Connection(cnxid, self)
+ cnx = Connection(self, cnxid=cnxid)
self._cnxs[cnxid] = cnx
return cnx