summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-04-18 12:27:36 +0200
committerhut <hut@lavabit.com>2010-04-18 12:27:36 +0200
commitf36fa322acdd417590fda8c9acdf3aa836cd017a (patch)
treea6331eb0427e0fea632e6e5839294d1f26b0d3ca
parent8dc6194ecc0bd0876b4421c4be450b94c385e818 (diff)
downloadranger-f36fa322acdd417590fda8c9acdf3aa836cd017a.tar.gz
fsobject: in infostring, use "->" as suffix, not replacement
-rw-r--r--ranger/fsobject/fsobject.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/ranger/fsobject/fsobject.py b/ranger/fsobject/fsobject.py
index b954d87f..f3d40614 100644
--- a/ranger/fsobject/fsobject.py
+++ b/ranger/fsobject/fsobject.py
@@ -167,17 +167,21 @@ class FileSystemObject(MimeTypeAware, FileManagerAware):
 		elif self.is_directory:
 			try:
 				self.size = len(os.listdir(self.path))
-				self.infostring = " %d" % self.size
-				self.accessible = True
-				self.runnable = True
 			except OSError:
 				self.infostring = BAD_INFO
 				self.accessible = False
+			else:
+				self.infostring = " %d" % self.size
+				self.accessible = True
+				self.runnable = True
 		elif self.is_file:
-			self.size = self.stat.st_size
-			self.infostring = ' ' + human_readable(self.size)
+			try:
+				self.size = self.stat.st_size
+				self.infostring = ' ' + human_readable(self.size)
+			except:
+				pass
 		if self.is_link:
-			self.infostring = '->'
+			self.infostring = '->' + self.infostring
 
 	def load(self):
 		"""