summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2011-01-04 01:41:08 +0100
committerhut <hut@lavabit.com>2011-01-04 01:41:08 +0100
commit36e12da26d23e8a3bd0fdd00f3ed81fa1d6aae3c (patch)
tree3bfca6792cb1c57794953e0e2a72cadee33953b2
parent6e152710e5d71eba9722ce0f8cd19229a985f293 (diff)
parente70f8c831ec35f2cdd476e84a7e402293788a6b0 (diff)
downloadranger-36e12da26d23e8a3bd0fdd00f3ed81fa1d6aae3c.tar.gz
Merge branch 'stable'
-rw-r--r--ranger/defaults/apps.py14
-rw-r--r--ranger/gui/widgets/pager.py7
2 files changed, 14 insertions, 7 deletions
diff --git a/ranger/defaults/apps.py b/ranger/defaults/apps.py
index 85abb2dc..e93ca1b2 100644
--- a/ranger/defaults/apps.py
+++ b/ranger/defaults/apps.py
@@ -64,13 +64,17 @@ class CustomApplications(Applications):
 			if f.extension in ('xml', ):
 				return self.either(c, 'editor')
 			if f.extension in ('html', 'htm', 'xhtml'):
-				return self.either(c, 'firefox', 'opera', 'elinks')
-			if f.extension in ('swf', ):
-				return self.either(c, 'firefox', 'opera')
+				return self.either(c, 'firefox', 'opera', 'jumanji',
+						'luakit', 'elinks', 'lynx')
+			if f.extension == 'swf':
+				return self.either(c, 'firefox', 'opera', 'jumanji', 'luakit')
 			if f.extension == 'nes':
 				return self.either(c, 'fceux')
 			if f.extension in ('swc', 'smc'):
 				return self.either(c, 'zsnes')
+			if f.extension in ('odt', 'ods', 'odp', 'odf', 'odg',
+					'doc', 'xls'):
+				return self.either(c, 'libreoffice', 'soffice', 'ooffice')
 
 		if f.mimetype is not None:
 			if INTERPRETED_LANGUAGES.match(f.mimetype):
@@ -82,7 +86,7 @@ class CustomApplications(Applications):
 		if f.video or f.audio:
 			if f.video:
 				c.flags += 'd'
-			return self.either(c, 'mplayer', 'totem')
+			return self.either(c, 'mplayer', 'smplayer', 'vlc', 'totem')
 
 		if f.image:
 			return self.either(c, 'feh', 'eog', 'mirage')
@@ -96,7 +100,7 @@ class CustomApplications(Applications):
 
 
 	# ----------------------------------------- application definitions
-	# Note: Trivial applications are defined at the bottom
+	# Note: Trivial application definitions are at the bottom
 	def app_pager(self, c):
 		return tup('less', '-R', *c)
 
diff --git a/ranger/gui/widgets/pager.py b/ranger/gui/widgets/pager.py
index 64444064..d851de3f 100644
--- a/ranger/gui/widgets/pager.py
+++ b/ranger/gui/widgets/pager.py
@@ -167,14 +167,17 @@ class Pager(Widget):
 		if self.source and self.source_is_stream:
 			self.source.close()
 
+		self.max_width = 0
 		if isinstance(source, str):
 			self.source_is_stream = False
 			self.lines = source.splitlines()
-			self.max_width = max(len(line) for line in self.lines)
+			if self.lines:
+				self.max_width = max(len(line) for line in self.lines)
 		elif hasattr(source, '__getitem__'):
 			self.source_is_stream = False
 			self.lines = source
-			self.max_width = max(len(line) for line in source)
+			if self.lines:
+				self.max_width = max(len(line) for line in source)
 		elif hasattr(source, 'readline'):
 			self.source_is_stream = True
 			self.lines = []