[Tn5250py-commits] tn5250py/src/lib5250py Session.py,1.1.1.1,1.2
Status: Inactive
Brought to you by:
pbielen
|
From: <pb...@us...> - 2003-03-06 12:01:59
|
Update of /cvsroot/tn5250py/tn5250py/src/lib5250py
In directory sc8-pr-cvs1:/tmp/cvs-serv12853/src/lib5250py
Modified Files:
Session.py
Log Message:
Code cleanup
Index: Session.py
===================================================================
RCS file: /cvsroot/tn5250py/tn5250py/src/lib5250py/Session.py,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** Session.py 6 Jul 2002 11:13:00 -0000 1.1.1.1
--- Session.py 6 Mar 2003 12:01:56 -0000 1.2
***************
*** 1,73 ****
! """
! Session object
! Created by Kenneth J. Pouncey 2002-05-19
! """
!
! from vt5250 import vt5250
! from Screen5250 import Screen5250
!
__all__ = ["Session"]
!
! # Tunable parameters
! DEBUGLEVEL = 0
!
! # Telnet Port
! TELNET_PORT = 23
!
! class Session:
!
! """Session interface class."""
!
! def __init__(self,host=None,port=0):
!
! """Constructor."""
!
! self.debuglevel = DEBUGLEVEL
! self.vt = vt5250()
! self.vt.set_debuglevel(self.debuglevel)
! self.screen = Screen5250()
! self.screen.set_debuglevel(self.debuglevel)
! self.vt.setScreen(self.screen)
! self.screen.setVT(self.vt)
!
! if host:
! self.host = host
! else:
! self.host = 'localhost'
!
! if port:
! self.setPort(port)
! else:
! self.port = TELNET_PORT
!
! def set_debuglevel(self, debuglevel):
! """
! Set the debug level.
! The higher it is, the more debug output you get (on sys.stdout).
! """
! self.debuglevel = debuglevel
! self.vt.set_debuglevel(self.debuglevel)
! self.screen.set_debuglevel(self.debuglevel)
!
! def connect(self):
! self.vt.open(self.host,self.port)
!
! def disconnect(self):
! self.vt.close()
!
! def setHost(self,host):
! self.host = host
!
! def setPort(self,port):
! try:
! self.port = int(port)
! except ValueError:
! self.port = TELNET_PORT
!
! def getScreen(self):
! return self.screen
!
!
!
!
!
--- 1,10 ----
! """
Session object
Created by Kenneth J. Pouncey 2002-05-19
"""
from vt5250 import vt5250
from Screen5250 import Screen5250
__all__ = ["Session"]
! # Tunable parameters
DEBUGLEVEL = 0
# Telnet Port
TELNET_PORT = 23
! class Session:
"""Session interface class."""
def __init__(self,host=None,port=0):
"""Constructor."""
self.debuglevel = DEBUGLEVEL
self.vt = vt5250()
self.vt.set_debuglevel(self.debuglevel)
self.screen = Screen5250()
self.screen.set_debuglevel(self.debuglevel)
self.vt.setScreen(self.screen)
self.screen.setVT(self.vt)
if host:
self.host = host
else:
self.host = 'localhost'
if port:
self.setPort(port)
else:
self.port = TELNET_PORT
! def set_debuglevel(self, debuglevel):
"""
Set the debug level.
The higher it is, the more debug output you get (on sys.stdout).
"""
self.debuglevel = debuglevel
self.vt.set_debuglevel(self.debuglevel)
self.screen.set_debuglevel(self.debuglevel)
! def connect(self):
self.vt.open(self.host,self.port)
! def disconnect(self):
self.vt.close()
! def setHost(self,host):
self.host = host
! def setPort(self,port):
try:
self.port = int(port)
except ValueError:
self.port = TELNET_PORT
! def getScreen(self):
return self.screen
\ No newline at end of file
|