summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2011-10-02 18:02:02 +0200
committerhut <hut@lavabit.com>2011-10-02 18:02:11 +0200
commite9b880e2ef4da102846d9f75a65f7503500d73da (patch)
tree6acdb2ff406fc2e4057db16bf392dd94c514c741 /ranger
parent8f1a9a3a026aefc5092f1facebcb1a4f4de06bed (diff)
downloadranger-e9b880e2ef4da102846d9f75a65f7503500d73da.tar.gz
Revert "defaults/keys: use = key for octal chmodding"
This generates 512 keybindings which make ranger start almost
twice as long.  Just use the :chmod command instead.

This reverts commit b441d4b3147c9399d7452074297c2a10d7f899ba.
Diffstat (limited to 'ranger')
-rw-r--r--ranger/defaults/keys.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/ranger/defaults/keys.py b/ranger/defaults/keys.py
index 14ecef54..07591691 100644
--- a/ranger/defaults/keys.py
+++ b/ranger/defaults/keys.py
@@ -196,23 +196,19 @@ map('ud', 'uy', fm.uncut())
 # ------------------------------------ changing of file permissions
 # type "+ow" for "chmod o+w %s" and so on
 from itertools import product
-octal_help    = 'Enter the octal mode number for chmod'
-symbolic_help = '%s %s to *r*ead, *w*rite, e*x*ecute'
 for mode in product('ugoa', 'rwxXst'):
 	map('-%s%s' % mode, fm.execute_console('shell chmod %s-%s %%s' % mode))
 	map('+%s%s' % mode, fm.execute_console('shell chmod %s+%s %%s' % mode))
-for n in product(range(8), range(8), range(8)):
-	map('=%d%d%d' % n, fm.execute_console('shell chmod %d%d%d %%s' % n))
-	map('=%d<bg>'   %  n[0],        fm.hint(octal_help))
-	map('=%d%d<bg>' % (n[0], n[1]), fm.hint(octal_help))
+	map('=%s%s' % mode, fm.execute_console('shell chmod %s+%s %%s' % mode))
 
 # hints:
+template = '%s %s to *r*ead, *w*rite, e*x*ecute'
 for who, name in zip('ugoa', ('user', 'group', 'others', 'all')):
-	map('-%s<bg>' % who, fm.hint(symbolic_help % ('forbid', name)))
-	map('+%s<bg>' % who, fm.hint(symbolic_help % ('allow', name)))
+	map('-%s<bg>' % who, fm.hint(template % ('forbid', name)))
+	map('+%s<bg>' % who, fm.hint(template % ('allow', name)))
+	map('=%s<bg>' % who, fm.hint(template % ('allow', name)))
 map('-<bg>', '+<bg>', '=<bg>', fm.hint('change permission for *u*ser, '
 	'*g*roup, *o*thers, *a*ll'))
-map('=<bg>', fm.hint(octal_help))
 
 # ---------------------------------------------------- run programs
 map('S', fm.execute_command(os.environ['SHELL']))
/ranger/commit/CHANGELOG?h=v1.5.4&id=81f5ac9e8b9dbcbccbd01ad8f046ccf26fb53430'>81f5ac9e ^
cbcd3325 ^
90018274 ^




cbcd3325 ^
95e021ae ^

c928a9eb ^
95e021ae ^
cbcd3325 ^
95e021ae ^















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