aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2011-09-23 20:58:14 +0200
committerhut <hut@lavabit.com>2011-09-23 20:58:14 +0200
commit01f0ff6016f71dade2ad8a538060e66c5ef7ae12 (patch)
treef8f6f93c13d17e2ef6245442fd3c608f9c463db3
parenta141cc469fef3ed23044b232be4bcd9417db6a69 (diff)
parent5f5ddb15c5c9b6232fde15871a9fccbd30010c81 (diff)
downloadranger-01f0ff6016f71dade2ad8a538060e66c5ef7ae12.tar.gz
Merge branch 'master' of ssh://repo.or.cz/srv/git/ranger
-rw-r--r--ranger/core/helper.py3
-rw-r--r--ranger/gui/widgets/pager.py16
-rw-r--r--ranger/help/console.py6
3 files changed, 15 insertions, 10 deletions
diff --git a/ranger/core/helper.py b/ranger/core/helper.py
index cb0afefe..ad5541f5 100644
--- a/ranger/core/helper.py
+++ b/ranger/core/helper.py
@@ -15,6 +15,7 @@
"""Helper functions"""
+from errno import EEXIST
import os.path
import sys
from ranger import *
@@ -150,7 +151,7 @@ def allow_access_to_confdir(confdir, allow):
try:
os.makedirs(confdir)
except OSError as err:
- if err.errno != 17: # 17 means it already exists
+ if err.errno != EEXIST: # EEXIST means it already exists
print("This configuration directory could not be created:")
print(confdir)
print("To run ranger without the need for configuration")
diff --git a/ranger/gui/widgets/pager.py b/ranger/gui/widgets/pager.py
index 05485189..d1bf5918 100644
--- a/ranger/gui/widgets/pager.py
+++ b/ranger/gui/widgets/pager.py
@@ -111,12 +111,16 @@ class Pager(Widget):
if TITLE_REGEXP.match(line):
self.color_at(i, 0, -1, 'title', *baseclr)
elif self.markup == 'ansi':
- self.win.move(i, 0)
- for chunk in ansi.text_with_fg_bg_attr(line):
- if isinstance(chunk, tuple):
- self.set_fg_bg_attr(*chunk)
- else:
- self.addstr(chunk)
+ try:
+ self.win.move(i, 0)
+ except:
+ pass
+ else:
+ for chunk in ansi.text_with_fg_bg_attr(line):
+ if isinstance(chunk, tuple):
+ self.set_fg_bg_attr(*chunk)
+ else:
+ self.addstr(chunk)
def move(self, narg=None, **kw):
direction = Direction(kw)
diff --git a/ranger/help/console.py b/ranger/help/console.py
index 716740b9..2f3a75c8 100644
--- a/ranger/help/console.py
+++ b/ranger/help/console.py
@@ -133,13 +133,13 @@ are in different directories:
==============================================================================
3.4. The more complicated Commands in Detail
-3.3.1. "find"
+3.4.1. "find"
The find command is different than others: it doesn't require you to
press <RETURN>. To speed things up, it tries to guess when you're
done typing and executes the command right away.
The key "f" opens the console with ":find "
-3.3.2. "shell"
+3.4.2. "shell"
The shell command accepts flags |25?| as the first argument. This example
will use the "p"-flag, which pipes the output to the pager:
:shell -p cat somefile.txt
@@ -149,7 +149,7 @@ There are some shortcuts which open the console with the shell command:
"@" opens ":shell %s"
"#" opens ":shell -p "
-3.3.3. "open_with"
+3.4.3. "open_with"
The open_with command is explained in detail in chapter 2.2. |22?|
==============================================================================