summary refs log tree commit diff stats
diff options
context:
space:
mode:
-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')
ter Kartik K. Agaram <vc@akkartik.com> 2015-06-21 23:27:54 -0700 1616 - merging keyboard and events into 'console'' href='/akkartik/mu/commit/075scenario_console.cc?h=hlt&id=45c08fea47de1a23ce98f4fc7a1c5c3bed92b5fb'>45c08fea ^
a5840f21 ^


5f05e954 ^

bc98ddb2 ^
dd0846dc ^

bc98ddb2 ^
a5840f21 ^
45c08fea ^
a5840f21 ^
a5840f21 ^
45c08fea ^
a5840f21 ^
795f5244 ^
166e3c0d ^



a5840f21 ^
45c08fea ^
a5840f21 ^

70f70118 ^

d1b8d5ee ^
fb5470bc ^
f40137f1 ^
e33b0815 ^
263e6b2a ^
e33b0815 ^

b24eb476 ^
1ca9f326 ^

263e6b2a ^
e33b0815 ^




a5840f21 ^
1ca9f326 ^
e33b0815 ^
1ca9f326 ^
665fb11e ^
e33b0815 ^
f3760b0f ^
e33b0815 ^
665fb11e ^
9dcbec39 ^
e33b0815 ^
665fb11e ^
e33b0815 ^
665fb11e ^

e33b0815 ^
665fb11e ^
e33b0815 ^
45c08fea ^
a5840f21 ^


1ca9f326 ^
e33b0815 ^
1ca9f326 ^
a5840f21 ^
b24eb476 ^


e33b0815 ^

a5840f21 ^


e33b0815 ^

a5840f21 ^
e33b0815 ^
a5840f21 ^


e33b0815 ^
c6034af3 ^
e33b0815 ^



263e6b2a ^
d8f2d0b1 ^

56c0e796 ^

a5840f21 ^


665fb11e ^
b24eb476 ^
665fb11e ^





































bd345189 ^
665fb11e ^


















45c08fea ^


2dab0edb ^
45c08fea ^
665fb11e ^
45c08fea ^
2dab0edb ^

45c08fea ^
760f683f ^


45c08fea ^
760f683f ^
45c08fea ^
760f683f ^
45c08fea ^
760f683f ^
45c08fea ^

















8f060500 ^
665fb11e ^
45c08fea ^






2dab0edb ^

4938a720 ^
fedebaf5 ^




795f5244 ^
166e3c0d ^



fedebaf5 ^


795f5244 ^
1b76245c ^
35064671 ^

b24eb476 ^

2efceef6 ^

795f5244 ^

b24eb476 ^
795f5244 ^
fedebaf5 ^



4938a720 ^
b24eb476 ^


4938a720 ^
4938a720 ^


7fd01071 ^
4938a720 ^



b24eb476 ^
4938a720 ^
b24eb476 ^
4938a720 ^
32597844 ^
4938a720 ^
c6034af3 ^
4938a720 ^


b24eb476 ^
4938a720 ^
b24eb476 ^
4938a720 ^
795f5244 ^
32597844 ^
263e6b2a ^
c6034af3 ^
4938a720 ^

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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300