|
@@ -47,14 +47,7 @@ class MMGenTerm(object):
|
|
|
|
|
|
@classmethod
|
|
|
def register_cleanup(cls):
|
|
|
- if gc.platform == 'linux' and not hasattr(cls,'cleanup_registered'):
|
|
|
- import atexit
|
|
|
- atexit.register(
|
|
|
- lambda: termios.tcsetattr(
|
|
|
- cls.stdin_fd,
|
|
|
- termios.TCSADRAIN,
|
|
|
- cls.orig_term) )
|
|
|
- cls.cleanup_registered = True
|
|
|
+ pass
|
|
|
|
|
|
@classmethod
|
|
|
def init(cls,noecho=False):
|
|
@@ -74,6 +67,17 @@ class MMGenTerm(object):
|
|
|
|
|
|
class MMGenTermLinux(MMGenTerm):
|
|
|
|
|
|
+ @classmethod
|
|
|
+ def register_cleanup(cls):
|
|
|
+ if not hasattr(cls,'cleanup_registered'):
|
|
|
+ import atexit
|
|
|
+ atexit.register(
|
|
|
+ lambda: termios.tcsetattr(
|
|
|
+ cls.stdin_fd,
|
|
|
+ termios.TCSADRAIN,
|
|
|
+ cls.orig_term) )
|
|
|
+ cls.cleanup_registered = True
|
|
|
+
|
|
|
@classmethod
|
|
|
def reset(cls):
|
|
|
termios.tcsetattr( cls.stdin_fd, termios.TCSANOW, cls.orig_term )
|
|
@@ -159,6 +163,10 @@ class MMGenTermLinux(MMGenTerm):
|
|
|
|
|
|
class MMGenTermLinuxStub(MMGenTermLinux):
|
|
|
|
|
|
+ @classmethod
|
|
|
+ def register_cleanup(cls):
|
|
|
+ pass
|
|
|
+
|
|
|
@classmethod
|
|
|
def init(cls,noecho=False):
|
|
|
cls.stdin_fd = sys.stdin.fileno()
|