summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-01-13 20:57:54 +0100
committerhut <hut@lavabit.com>2010-01-13 20:57:54 +0100
commit63502bea559898d5e79738659424fe3875f913ad (patch)
tree611ca776659ba157733a9ac608c0207a2f680285
parentf70ee6b2209af6785cf9a030b1a8893f09a770ac (diff)
downloadranger-63502bea559898d5e79738659424fe3875f913ad.tar.gz
fsobject.directory: removed __getitem__ (too ambiguous)
-rw-r--r--ranger/fsobject/directory.py5
-rw-r--r--ranger/gui/widgets/browsercolumn.py4
-rw-r--r--test/tc_directory.py2
3 files changed, 2 insertions, 9 deletions
diff --git a/ranger/fsobject/directory.py b/ranger/fsobject/directory.py
index 2941edc8..5f038ca2 100644
--- a/ranger/fsobject/directory.py
+++ b/ranger/fsobject/directory.py
@@ -375,11 +375,6 @@ class Directory(FileSystemObject, Accumulator, SettingsAware):
 		if not self.accessible: raise ranger.fsobject.NotLoadedYet()
 		return len(self.files)
 	
-	def __getitem__(self, key):
-		"""Get the file by its index"""
-		if not self.accessible: raise ranger.fsobject.NotLoadedYet()
-		return self.files[key]
-
 	def __eq__(self, other):
 		"""Check for equality of the directories paths"""
 		return isinstance(other, Directory) and self.path == other.path
diff --git a/ranger/gui/widgets/browsercolumn.py b/ranger/gui/widgets/browsercolumn.py
index abda649d..2eb44112 100644
--- a/ranger/gui/widgets/browsercolumn.py
+++ b/ranger/gui/widgets/browsercolumn.py
@@ -59,7 +59,7 @@ class BrowserColumn(Pager, Widget):
 					self.fm.move_pointer(absolute = index)
 			elif event.pressed(3):
 				try:
-					clicked_file = self.target[index]
+					clicked_file = self.target.files[index]
 					self.fm.enter_dir(clicked_file.path)
 				except:
 					pass
@@ -201,7 +201,7 @@ class BrowserColumn(Pager, Widget):
 			i = line + self.scroll_begin
 
 			try:
-				drawed = self.target[i]
+				drawed = self.target.files[i]
 			except IndexError:
 				break
 
diff --git a/test/tc_directory.py b/test/tc_directory.py
index 45b58cf5..7634de0e 100644
--- a/test/tc_directory.py
+++ b/test/tc_directory.py
@@ -24,7 +24,6 @@ class Test1(unittest.TestCase):
 		self.assertEqual(dir.filenames, None)
 		self.assertEqual(dir.files, None)
 		self.assertRaises(fsobject.NotLoadedYet, len, dir)
-		self.assertRaises(fsobject.NotLoadedYet, dir.__getitem__, 0)
 
 	def test_after_content_loaded(self):
 		import os
@@ -66,7 +65,6 @@ class Test1(unittest.TestCase):
 		self.assertFalse(dir.accessible)
 		self.assertEqual(dir.filenames, None)
 		self.assertRaises(fsobject.NotLoadedYet, len, dir)
-		self.assertRaises(fsobject.NotLoadedYet, dir.__getitem__, 0)
 
 	def test_load_if_outdated(self):
 		import os