summary refs log tree commit diff stats
path: root/code/fm.py
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-11-22 23:56:47 +0100
committerhut <hut@lavabit.com>2009-11-22 23:56:47 +0100
commit2b3db775535290cbbaae570dc79ed3438afe4795 (patch)
treea385d5c5a5491c4a19b77c945030ea141926de76 /code/fm.py
parentec338c02cf3b31d2ed1438752c338bd6123f3044 (diff)
downloadranger-2b3db775535290cbbaae570dc79ed3438afe4795.tar.gz
the basic loop
Diffstat (limited to 'code/fm.py')
-rw-r--r--code/fm.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/code/fm.py b/code/fm.py
new file mode 100644
index 00000000..76316a9d
--- /dev/null
+++ b/code/fm.py
@@ -0,0 +1,38 @@
+import time
+import sys
+from code import ui, debug
+
+class FM():
+	def __init__(self, options):
+		self.singleton = None
+		self.options = options
+		self.ui = ui.UI()
+
+	def run(self):
+		try:
+			while 1:
+				try:
+					self.ui.draw()
+				except KeyboardInterrupt:
+					self.interrupt()
+				except:
+					debug.log(sys.exc_info()[1])
+
+				try:
+					key = None
+#					key = curses.getch()
+#					curses.flushinp()
+					self.press(key)
+				except KeyboardInterrupt:
+					self.interrupt()
+		except:
+			raise
+			pass
+
+	def press(self, key):
+		pass
+
+	def interrupt(self):
+		self.buffer = ""
+		time.sleep(0.2)
+
b1f7cf9'>672e3e50 ^
65361948 ^


672e3e50 ^
65361948 ^

672e3e50 ^

















65361948 ^
672e3e50 ^




90560d71 ^
65361948 ^
672e3e50 ^







65361948 ^






90560d71 ^
672e3e50 ^


90560d71 ^
672e3e50 ^

672e3e50 ^



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161