summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorGermainZ <germanosz@gmail.com>2018-10-15 01:58:43 +0200
committerGermainZ <germanosz@gmail.com>2018-10-15 02:00:07 +0200
commit65832d74998e772230fcdbfe64c5f2ffb671102a (patch)
treeb4648baed7dc14fab71f9e4f6f47668c212c4f59 /ranger
parent16949531f739ccf0cbf8ae543e7282de4291e165 (diff)
downloadranger-65832d74998e772230fcdbfe64c5f2ffb671102a.tar.gz
Do not include "ask" in open_with options (fixes #1047)
Diffstat (limited to 'ranger')
-rw-r--r--ranger/core/actions.py3
-rwxr-xr-xranger/ext/rifle.py4
2 files changed, 5 insertions, 2 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 4e76df65..c7523bfb 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -931,7 +931,8 @@ class Actions(  # pylint: disable=too-many-instance-attributes,too-many-public-m
         except IndexError:
             self.ui.browser.draw_info = []
             return
-        programs = [program for program in self.rifle.list_commands([target.path], None)]
+        programs = [program for program in self.rifle.list_commands([target.path], None,
+                                                                    skip_ask=True)]
         if programs:
             num_digits = max((len(str(program[0])) for program in programs))
             program_info = ['%s | %s' % (str(program[0]).rjust(num_digits), program[1])
diff --git a/ranger/ext/rifle.py b/ranger/ext/rifle.py
index ee156d9a..d0d5408d 100755
--- a/ranger/ext/rifle.py
+++ b/ranger/ext/rifle.py
@@ -279,7 +279,7 @@ class Rifle(object):  # pylint: disable=too-many-instance-attributes
         filenames = "' '".join(f.replace("'", "'\\\''") for f in files if "\x00" not in f)
         return "set -- '%s'; %s" % (filenames, action)
 
-    def list_commands(self, files, mimetype=None):
+    def list_commands(self, files, mimetype=None, skip_ask=False):
         """List all commands that are applicable for the given files
 
         Returns one 4-tuple for all currently applicable commands
@@ -294,6 +294,8 @@ class Rifle(object):  # pylint: disable=too-many-instance-attributes
             self._skip = None
             self._app_flags = ''
             self._app_label = None
+            if skip_ask and cmd == ASK_COMMAND:
+                continue
             for test in tests:
                 if not self._eval_condition(test, files, None):
                     break
> 28 29 30 31 32 33 34 35 36 37 38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
             


                  


















                                                                          














                                                   
                                            
 
           


                      
                                                                                                             







                                              
            
                   


                                                                                                     
NAME = ranger
PYTHON = python
DOCDIR = doc/pydoc
CWD = $(shell pwd)
EDITOR = vim

.PHONY: all clean doc cleandoc edit push test commit install info snapshot

info:
	@echo 'This makefile provides shortcuts for common tasks.'
	@echo 'make clean: Remove all unnecessary files (.pyc, .pyo)'
	@echo 'make cleandoc: Remove the pydoc documentation'
	@echo 'make doc: Create the pydoc documentation'
	@echo 'make install: Install ranger'
	@echo 'make snapshot: Create a tar.gz of the current git revision'
	@echo
	@echo 'For developers:'
	@echo 'make commit: Test and commit the changes'
	@echo 'make test: Run all unittests.'
	@echo 'make push: push the changes via git'
	@echo 'make edit: open all relevant files in your editor'

all: test

doc: cleandoc
	mkdir -p $(DOCDIR)
	cd $(DOCDIR); \
		$(PYTHON) -c 'import pydoc, sys; \
		sys.path[0] = "$(CWD)"; \
		pydoc.writedocs("$(CWD)")'

install:
	@less -XF INSTALL

cleandoc:
	test -d $(DOCDIR) && rm -f $(DOCDIR)/*.html

clean:
	find . -regex .\*.py[co]$ | xargs rm

test: clean
	./all_tests.py

edit:
	@$(EDITOR) ranger.py Makefile README COPYING HACKING INSTALL $(shell find ranger test -regex .\*py$ )

push:
	@for repo in $(shell git remote); do \
		echo "Pushing to $$repo..."; \
		git push $$repo master; \
		git push $$repo -f hut; \
	done

commit: test
	@git citool

snapshot:
	git archive HEAD | gzip > $(NAME)-$(shell git rev-list HEAD | head -n 1 | cut -b 1-16).tar.gz