mirror of
https://github.com/rzzzwilson/pymlac.git
synced 2025-06-10 09:32:41 +00:00
Better logging for TtyIn device
This commit is contained in:
@@ -34,6 +34,8 @@ class TtyIn(object):
|
||||
def mount(self, fname):
|
||||
"""Mount a file on the TTYIN device."""
|
||||
|
||||
log("Mounting '%s' on TTYIN" % fname)
|
||||
|
||||
self.filename = fname
|
||||
self.open_file = open(fname, 'r')
|
||||
self.value = self.open_file.read(1)
|
||||
@@ -51,6 +53,8 @@ class TtyIn(object):
|
||||
def dismount(self):
|
||||
"""Dismount the file on the TTYIN device."""
|
||||
|
||||
log("Dismounting '%s' on TTYIN" % self.filename)
|
||||
|
||||
if self.open_file:
|
||||
self.open_file.close()
|
||||
self.filename = None
|
||||
@@ -63,6 +67,8 @@ class TtyIn(object):
|
||||
def read(self):
|
||||
"""Return the current device value."""
|
||||
|
||||
log("Reading TTYIN: returning %03o" % self.value)
|
||||
|
||||
return self.value
|
||||
|
||||
def ready(self):
|
||||
@@ -73,6 +79,8 @@ class TtyIn(object):
|
||||
def clear(self):
|
||||
"""Clear the device 'ready' status."""
|
||||
|
||||
log("TTYIN: clearing flag")
|
||||
|
||||
self.status = self.DEVICE_NOT_READY
|
||||
|
||||
def tick(self, cycles):
|
||||
|
||||
Reference in New Issue
Block a user