[Tn5250py-commits] tn5250py/src/lib5250py SessionManager.py,1.1.1.1,1.2 Sessions.py,1.1.1.1,1.2
Status: Inactive
Brought to you by:
pbielen
|
From: <gen...@us...> - 2002-07-19 16:30:39
|
Update of /cvsroot/tn5250py/tn5250py/src/lib5250py
In directory usw-pr-cvs1:/tmp/cvs-serv21742/src/lib5250py
Modified Files:
SessionManager.py Sessions.py
Log Message:
This is the some testing code for the session manager. It should prove that the session manager works.
Index: SessionManager.py
===================================================================
RCS file: /cvsroot/tn5250py/tn5250py/src/lib5250py/SessionManager.py,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** SessionManager.py 6 Jul 2002 11:13:00 -0000 1.1.1.1
--- SessionManager.py 19 Jul 2002 16:30:35 -0000 1.2
***************
*** 1,30 ****
! """
! SessionManager and Sessions objects
! Created by Nathanael Custer 2002-07-01
! """
!
! from Sessions import Sessions
!
! __all__ = ["SessionManager"]
!
! # Tunable parameters
! DEBUGLEVEL = 0
!
# Telnet Port
! TELNET_PORT = 23
!
! class SessionManager:
! def __init__(self):
! self.MasterSessionList = Sessions()
! def getSessions(self):
! return self.MasterSessionList
! def openSession(self, name=''):
! self.MasterSessionList._addSession(name)
! return self.MasterSessionList.item(name)
! def closeSession(self, name=''):
! session = self.MasterSessionList.item(name)
! if session.isConected():
! session.disconect()
! self.MasterSessionList._delSession(name)
! def refresh(self):
! return self.MasterSessionList
--- 1,44 ----
! """
! SessionManager and Sessions objects
! Created by Nathanael Custer 2002-07-01
! """
!
! from Sessions import Sessions
!
! __all__ = ["SessionManager"]
!
! # Tunable parameters
! DEBUGLEVEL = 0
!
# Telnet Port
! TELNET_PORT = 23
!
! class SessionManager:
! def __init__(self):
! self.MasterSessionList = Sessions()
! def getSessions(self):
! return self.MasterSessionList
! def openSession(self, name=''):
! self.MasterSessionList._addSession(name)
! return self.MasterSessionList.item(name)
! def closeSession(self, name=''):
! session = self.MasterSessionList.item(name)
! self.MasterSessionList._delSession(name)
! def refresh(self):
! return self.MasterSessionList
!
! if __name__ == '__main__':
! test = SessionManager()
! print "Generating 10 test sessions."
! for x in range(10):
! test.openSession('test' + str(x))
! print "Here is the list of the sessions:"
! a = test.getSessions()
! print a.list
! print "Now removing the sessions one at a time"
! for x in range(10):
! test.closeSession('test' + str(x))
! a = test.refresh()
! print "One less"
! print a.list
!
Index: Sessions.py
===================================================================
RCS file: /cvsroot/tn5250py/tn5250py/src/lib5250py/Sessions.py,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** Sessions.py 6 Jul 2002 11:13:00 -0000 1.1.1.1
--- Sessions.py 19 Jul 2002 16:30:35 -0000 1.2
***************
*** 23,27 ****
for x in self.list:
if name == x[0]:
! self.list.remove(name)
# else:
# raise error here
--- 23,27 ----
for x in self.list:
if name == x[0]:
! self.list.remove(x)
# else:
# raise error here
|