summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2011-10-09 05:22:30 +0200
committerhut <hut@lavabit.com>2011-10-09 05:59:17 +0200
commitd288ec979e7e5e6949066e72cbbbcd6e6509065a (patch)
treeff74f3af974325b20ad2ac7285f1b4a86f71c1c5
parent710b0bb77fef315bb023a32e244e0da663cfb532 (diff)
downloadranger-d288ec979e7e5e6949066e72cbbbcd6e6509065a.tar.gz
data/apps.py: updated
-rw-r--r--ranger/data/apps.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/ranger/data/apps.py b/ranger/data/apps.py
index c9958e1e..8a50604d 100644
--- a/ranger/data/apps.py
+++ b/ranger/data/apps.py
@@ -54,6 +54,15 @@
 # 4. "None" to indicate that no action was found.
 #     return None
 # ===================================================================
+# When using the "either" method, ranger determines which program to
+# pick by looking at its dependencies.  You can set dependencies by
+# adding the decorator "depends_on":
+#     @depends_on("vim")
+#     def app_vim(self, context):
+#         ....
+# There is a special keyword which you can use as a dependence: "X"
+# This ensures that the program will only run when X is running.
+# ===================================================================
 
 # Import the basics
 from ranger.defaults.apps import CustomApplications as DefaultApps
@@ -93,13 +102,16 @@ class CustomApplications(DefaultApps):
 
 ## Often a programs invocation is trivial.  For example:
 ##    vim test.py readme.txt [...]
+##
 ## This could be implemented like:
 ##    @depends_on("vim")
 ##    def app_vim(self, context):
 ##        return "vim", context
-## Instead of creating such a generic function for each program, just add
-## its name here and it will be automatically done for you.
-#CustomApplications.generic('zsnes', 'javac')
+##
+## But this is redundant and ranger does this automatically.  However, sometimes
+## you want to change some properties like flags or dependencies.  This can be
+## done with the generic() classmethod.
+#CustomApplications.generic('zsnes', 'wine', deps=['X'])
 
 ## By setting flags='d', this programs will not block ranger's terminal:
-#CustomApplications.generic('gimp', 'evince', flags='d')
+#CustomApplications.generic('gimp', 'evince', deps=['X'], flags='d')
nti/profani-tty/blame/src/plugins/python_plugins.h?id=2f432a942d3c72f5fb3f25775b8ea52cd92b612d'>^
0fc0b3ee ^
759d9ccb ^







0fc0b3ee ^
d0397f3d ^
8933d59b ^
d0397f3d ^
8933d59b ^
d0397f3d ^
8933d59b ^
0fc0b3ee ^
759d9ccb ^




271278dd ^
7ca60846 ^
271278dd ^
0fc0b3ee ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91