root / trunk / swipe / card.py @ 139
History | View | Annotate | Download (1012 Bytes)
1 |
"""
|
---|---|
2 |
This file is part of Tooltron.
|
3 |
|
4 |
Tooltron is free software: you can redistribute it and/or modify
|
5 |
it under the terms of the Lesser GNU General Public License as published by
|
6 |
the Free Software Foundation, either version 3 of the License, or
|
7 |
(at your option) any later version.
|
8 |
|
9 |
Tooltron is distributed in the hope that it will be useful,
|
10 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
Lesser GNU General Public License for more details.
|
13 |
You should have received a copy of the Lesser GNU General Public License
|
14 |
along with Tooltron. If not, see <http://www.gnu.org/licenses/>.
|
15 |
|
16 |
Copyright 2009 Bradford Neuman <bneuman@andrew.cmu.edu>
|
17 |
|
18 |
"""
|
19 |
|
20 |
|
21 |
lineThread().start() |
22 |
|
23 |
|
24 |
while True: |
25 |
|
26 |
cv.acquire() |
27 |
while not lineready: |
28 |
cv.wait() |
29 |
|
30 |
got = lastline |
31 |
lineready = 0
|
32 |
cv.release() |
33 |
|
34 |
if got=="exit": |
35 |
print "exiting..." |
36 |
break
|
37 |
|
38 |
print "main thread got: ",got |
39 |
|
40 |
time.sleep(5)
|