From e9b880e2ef4da102846d9f75a65f7503500d73da Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 2 Oct 2011 18:02:02 +0200 Subject: 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. --- ranger/defaults/keys.py | 14 +++++--------- 1 file 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' % n[0], fm.hint(octal_help)) - map('=%d%d' % (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' % who, fm.hint(symbolic_help % ('forbid', name))) - map('+%s' % who, fm.hint(symbolic_help % ('allow', name))) + map('-%s' % who, fm.hint(template % ('forbid', name))) + map('+%s' % who, fm.hint(template % ('allow', name))) + map('=%s' % who, fm.hint(template % ('allow', name))) map('-', '+', '=', fm.hint('change permission for *u*ser, ' '*g*roup, *o*thers, *a*ll')) -map('=', fm.hint(octal_help)) # ---------------------------------------------------- run programs map('S', fm.execute_command(os.environ['SHELL'])) -- cgit 1.4.1-2-gfad0