[ecspy] r116 committed - didn't work on darwin/osx before... does now...

0 views
Skip to first unread message

ec...@googlecode.com

unread,
Jun 7, 2011, 2:51:50 PM6/7/11
to ec...@googlegroups.com
Revision: 116
Author: jellef...@gmail.com
Date: Tue Jun 7 11:29:18 2011
Log: didn't work on darwin/osx before... does now...
http://code.google.com/p/ecspy/source/detail?r=116

Modified:
/trunk/ecspy/terminators.py

=======================================
--- /trunk/ecspy/terminators.py Thu Aug 19 22:26:17 2010
+++ /trunk/ecspy/terminators.py Tue Jun 7 11:29:18 2011
@@ -223,14 +223,19 @@

"""
def getch():
- bims = sys.builtin_module_names
- if 'msvcrt' in bims:
- import msvcrt
+ unix = ('darwin', 'linux2')
+ if sys.platform not in unix:
+ try:
+ import msvcrt
+ except ImportError:
+ print 'user_termination cannot import required module...\n
are you running DOS or something?'
+ return -1
if msvcrt.kbhit():
return msvcrt.getch()
else:
return -1
- elif 'curses' in bims:
+
+ elif sys.platform in unix:
def _getch(stdscr):
stdscr.nodelay(1)
ch = stdscr.getch()
@@ -238,9 +243,7 @@
return ch
import curses
return curses.wrapper(_getch)
- else:
- raise NotImplementedError
-
+
num_secs = args.get('termination_response_timeout', 5)
clear_buffer = args.get('clear_termination_buffer', True)
if clear_buffer:

Reply all
Reply to author
Forward
0 new messages