about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-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