Update of /cvsroot/btplusplus/BT++/src
In directory sc8-pr-cvs1:/tmp/cvs-serv26539/src
Modified Files:
WT++.py
Log Message:
You can now enter 'exit' or 'quit' on the commandline of WT++ to stop the server.
Index: WT++.py
===================================================================
RCS file: /cvsroot/btplusplus/BT++/src/WT++.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** WT++.py 25 Feb 2003 23:43:16 -0000 1.1
--- WT++.py 28 Feb 2003 21:28:33 -0000 1.2
***************
*** 10,13 ****
--- 10,20 ----
assert version >= '2', "Install Python 2.0 or greater"
+ def evalinput():
+ while 1:
+ x = raw_input()
+ if x == "exit" or x == "quit":
+ # Is this save??
+ BTWait.set()
+
if __name__ == '__main__':
# Change to the directory of BT++
***************
*** 26,33 ****
print ("Started")
! httpd = BTWebServer()
httpdth = Thread(target = httpd.server)
httpdth.setDaemon(1)
httpdth.start()
BTWait.wait()
-
\ No newline at end of file
--- 33,44 ----
print ("Started")
! httpd = BTWebServer()
httpdth = Thread(target = httpd.server)
httpdth.setDaemon(1)
httpdth.start()
+
+ inthr = Thread(target = evalinput)
+ inthr.setDaemon(1)
+ inthr.start()
+
BTWait.wait()
|