summary refs log tree commit diff stats
path: root/code/fm.py
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-11-27 10:49:48 +0100
committerhut <hut@lavabit.com>2009-11-27 10:49:48 +0100
commit9506fb8e79f2d04a1ab78039bacdbee7b22109b5 (patch)
tree3d5c682e9c5032a1c23be6a98c9d3d6e7c8224b5 /code/fm.py
parent5822dff7d91472bf2fc337c68f144e0ce1de09ae (diff)
downloadranger-9506fb8e79f2d04a1ab78039bacdbee7b22109b5.tar.gz
more VROOM
Diffstat (limited to 'code/fm.py')
-rw-r--r--code/fm.py65
1 files changed, 0 insertions, 65 deletions
diff --git a/code/fm.py b/code/fm.py
deleted file mode 100644
index 924f6efc..00000000
--- a/code/fm.py
+++ /dev/null
@@ -1,65 +0,0 @@
-import sys, os
-import ui, debug, file, directory, fstype
-
-class FM():
-	def __init__(self, environment):
-		self.env = environment
-
-	def feed(self, path, ui):
-		self.ui = ui
-		self.env.path = path
-		self.enter_dir(path)
-
-	def enter_dir(self, path):
-		# get the absolute path
-		path = os.path.normpath(os.path.join(self.env.path, path))
-
-		self.env.path = path
-		self.env.pwd = self.env.get_directory(path)
-
-		self.env.pwd.load_content()
-
-		# build the pathway, a tuple of directory objects which lie
-		# on the path to the current directory.
-		pathway = []
-		currentpath = '/'
-		for dir in path.split('/'):
-			currentpath = os.path.join(currentpath, dir)
-			debug.log(currentpath)
-			pathway.append(self.env.get_directory(currentpath))
-		self.env.pathway = tuple(pathway)
-
-		# set the current file.
-		if len(self.env.pwd) > 0:
-			self.env.cf = self.env.pwd[0]
-		else:
-			self.env.cf = None
-
-	def run(self):
-		while 1:
-			try:
-				self.ui.draw()
-			except KeyboardInterrupt:
-				self.interrupt()
-			except:
-				raise
-
-			try:
-				key = self.ui.get_next_key()
-				self.press(key)
-			except KeyboardInterrupt:
-				self.interrupt()
-
-	def press(self, key):
-		if (key == ord('q')):
-			raise SystemExit()
-		elif (key == ord('h')):
-			self.enter_dir('..')
-		elif (key == ord('l')):
-			self.enter_dir(self.env.cf.path)
-
-	def interrupt(self):
-		import time
-		self.buffer = ""
-		time.sleep(0.2)
-