|
Last change
on this file since 76 was 52, checked in by rissim, 17 years ago |
|
trigger software (VME) v1
|
-
Property svn:executable
set to
*
|
|
File size:
1.2 KB
|
| Line | |
|---|
| 1 | #!/usr/bin/python
|
|---|
| 2 | import readline
|
|---|
| 3 | import threading
|
|---|
| 4 | import time
|
|---|
| 5 | import GlobalVariables
|
|---|
| 6 |
|
|---|
| 7 | class InputShell(threading.Thread):
|
|---|
| 8 |
|
|---|
| 9 | def __init__(self):
|
|---|
| 10 | threading.Thread.__init__(self)
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 | def run (self):
|
|---|
| 14 | #outputShell= OutputShell()
|
|---|
| 15 | #OutputShell.start(outputShell)
|
|---|
| 16 |
|
|---|
| 17 | while(GlobalVariables.UserInput!="exit" and GlobalVariables.UserInput != "EXIT"):
|
|---|
| 18 | dummy=raw_input("SHELL>>> ")
|
|---|
| 19 | if(GlobalVariables.UserInput!="exit" and GlobalVariables.UserInput != "EXIT"):
|
|---|
| 20 | GlobalVariables.UserInput = dummy
|
|---|
| 21 | else:
|
|---|
| 22 | break
|
|---|
| 23 | time.sleep(0.7)
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 | print "EXITING INPUTSHELL... press <enter> to exit"
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 | class OutputShell(threading.Thread):
|
|---|
| 30 | lastvar=''
|
|---|
| 31 | def run (self):
|
|---|
| 32 | while(GlobalVariables.UserInput!="exit" and GlobalVariables.UserInput != "EXIT"):
|
|---|
| 33 | if(GlobalVariables.UserInput!=self.lastvar):
|
|---|
| 34 | print "\n(SHELL) You entered:",GlobalVariables.UserInput
|
|---|
| 35 | #sys.stdout.write( "SHELL2 >>>")
|
|---|
| 36 | self.lastvar=GlobalVariables.UserInput
|
|---|
| 37 | print "EXITING OUTPUTSHELL...press <enter> to exit "
|
|---|
| 38 | #sys.exit(0)
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.