summary refs log tree commit diff stats
path: root/code/fm.py
diff options
context:
space:
mode:
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)
+