c{0: 0 (((1 string-address)) <- ((new)) _, hello!) -- nil c{0: 1 (((2 string-address)) <- ((new)) abc) -- nil c{0: 2 (((3 string-address)) <- ((interpolate)) ((1 string-address)) ((2 string-address))) -- nil c{1: 0 ✓ (((1 string-address)) <- ((new)) _, hello!) c{1: 1 ✓ (((2 string-address)) <- ((new)) abc) c{1: 2 ✓ (((3 string-address)) <- ((interpolate)) ((1 string-address)) ((2 string-address))) cn0: convert-names in main cn0: (((1 string-address)) <- ((new)) _, hello!) nil nil cn0: checking arg _, hello! cn0: checking oarg ((1 string-address)) maybe-add: ((1 string-address)) cn0: (((2 string-address)) <- ((new)) abc) nil nil cn0: checking arg abc cn0: checking oarg ((2 string-address)) maybe-add: ((2 string-address)) cn0: (((3 string-address)) <- ((interpolate)) ((1 string-address)) ((2 string-address))) nil nil cn0: checking arg ((1 string-address)) maybe-add: ((1 string-address)) cn0: checking arg ((2 string-address)) maybe-add: ((2 string-address)) cn0: checking oarg ((3 string-address)) maybe-add: ((3 string-address)) cn1: (((1 string-address)) <- ((new)) _, hello!) cn1: (((2 string-address)) <- ((new)) abc) cn1: (((3 string-address)) <- ((interpolate)) ((1 string-address)) ((2 string-address))) schedule: main run: main 0: (((1 string-address)) <- ((new)) _, hello!) run: main 0: 1000 => ((1 string-address)) mem: ((1 string-address)): 1 <= 1000 run: main 1: (((2 string-address)) <- ((new)) abc) run: main 1: 1010 => ((2 string-address)) mem: ((2 string-address)): 2 <= 1010 run: main 2: (((3 string-address)) <- ((interpolate)) ((1 string-address)) ((2 string-address))) mem: ((1 string-address)) => 1000 mem: ((2 string-address)) => 1010 run: interpolate/main 0: (((default-space space-address)) <- ((new)) ((space literal)) ((60 literal))) run: interpolate/main 0: 1014 => ((default-space space-address)) run: interpolate/main 1: (((1 string-address)) <- ((next-input))) arg: nil 0 (1000 1010) run: interpolate/main 1: 1000 => ((1 string-address)) mem: ((1 string-address)): 1016 <= 1000 run: interpolate/main 2: (((2 integer)) <- ((length)) ((1 string-address) (deref))) array-len: ((1 string-address) (deref)) mem: ((1000 integer) (raw)) => 9 run: interpolate/main 2: 9 => ((2 integer)) mem: ((2 integer)): 1017 <= 9 run: interpolate/main 3: (((3 integer)) <- ((copy)) ((2 integer))) mem: ((2 integer)) => 9 run: interpolate/main 3: 9 => ((3 integer)) mem: ((3 integer)): 1018 <= 9 run: interpolate/main 4: (((4 string-address)) ((5 boolean)) <- ((next-input))) arg: nil 1 (1000 1010) run: interpolate/main 4: 1010 => ((4 string-address)) mem: ((4 string-address)): 1019 <= 1010 run: interpolate/main 4: t => ((5 boolean)) mem: ((5 boolean)): 1020 <= t run: interpolate/main 5: (((jump-unless)) ((5 boolean)) ((4 offset))) mem: ((5 boolean)) => t run: interpolate/main 6: (((6 integer)) <- ((length)) ((4 string-address) (deref))) array-len: ((4 string-address) (deref)) mem: ((1010 integer) (raw)) => 3 run: interpolate/main 6: 3 => ((6 integer)) mem: ((6 integer)): 1021 <= 3 run: interpolate/main 7: (((3 integer)) <- ((add)) ((3 integer)) ((6 integer))) mem: ((3 integer)) => 9 mem: ((6 integer)) => 3 run: interpolate/main 7: 12 => ((3 integer)) mem: ((3 integer)): 1018 <= 12 run: interpolate/main 8: (((3 integer)) <- ((subtract)) ((3 integer)) ((1 literal))) mem: ((3 integer)) => 12 run: interpolate/main 8: 11 => ((3 integer)) mem: ((3 integer)): 1018 <= 11 run: interpolate/main 9: (((jump)) ((-6 offset))) run: interpolate/main 4: (((4 string-address)) ((5 boolean)) <- ((next-input))) arg: nil 2 (1000 1010) run: interpolate/main 4: nil => ((4 string-address)) mem: ((4 string-address)): 1019 <= nil run: interpolate/main 4: nil => ((5 boolean)) mem: ((5 boolean)): 1020 <= nil run: interpolate/main 5: (((jump-unless)) ((5 boolean)) ((4 offset))) mem: ((5 boolean)) => nil run: interpolate/main 10: (_ <- ((input)) ((0 literal))) arg: (((0 literal))) 0 (1000 1010) run: interpolate/main 11: (((7 string-address)) <- ((new)) ((string literal)) ((3 integer))) mem: ((3 integer)) => 11 run: interpolate/main 11: 1075 => ((7 string-address)) mem: ((7 string-address)): 1022 <= 1075 run: interpolate/main 12: (((8 integer)) <- ((copy)) ((0 literal))) run: interpolate/main 12: 0 => ((8 integer)) mem: ((8 integer)): 1023 <= 0 run: interpolate/main 13: (((9 integer)) <- ((copy)) ((0 literal))) run: interpolate/main 13: 0 => ((9 integer)) mem: ((9 integer)): 1024 <= 0 run: interpolate/main 14: (((4 string-address)) ((5 boolean)) <- ((next-input))) arg: nil 1 (1000 1010) run: interpolate/main 14: 1010 => ((4 string-address)) mem: ((4 string-address)): 1019 <= 1010 run: interpolate/main 14: t => ((5 boolean)) mem: ((5 boolean)): 1020 <= t run: interpolate/main 15: (((jump-unless)) ((5 boolean)) ((21 offset))) mem: ((5 boolean)) => t run: interpolate/main 16: (((10 boolean)) <- ((greater-or-equal)) ((9 integer)) ((2 integer))) mem: ((9 integer)) => 0 mem: ((2 integer)) => 9 run: interpolate/main 16: nil => ((10 boolean)) mem: ((10 boolean)): 1025 <= nil run: interpolate/main 17: (((jump-if)) ((10 boolean)) ((19 offset))) mem: ((10 boolean)) => nil run: interpolate/main 18: (((11 byte)) <- ((index)) ((1 string-address) (deref)) ((9 integer))) mem: ((9 integer)) => 0 array-len: ((1000 string) (raw)) mem: ((1000 integer) (raw)) => 9 mem: ((1001 byte) (raw)) => _ run: interpolate/main 18: #\_ => ((11 byte)) mem: ((11 byte)): 1026 <= #\_ run: interpolate/main 19: (((12 boolean)) <- ((equal)) ((11 byte)) ((_ literal))) mem: ((11 byte)) => _ run: interpolate/main 19: t => ((12 boolean)) mem: ((12 boolean)): 1027 <= t run: interpolate/main 20: (((jump-if)) ((12 boolean)) ((5 offset))) mem: ((12 boolean)) => t run: interpolate/main 26: (((14 integer)) <- ((copy)) ((0 literal))) run: interpolate/main 26: 0 => ((14 integer)) mem: ((14 integer)): 1029 <= 0 run: interpolate/main 27: (((15 boolean)) <- ((greater-or-equal)) ((14 integer)) ((6 integer))) mem: ((14 integer)) => 0 mem: ((6 integer)) => 3 run: interpolate/main 27: nil => ((15 boolean)) mem: ((15 boolean)): 1030 <= nil run: interpolate/main 28: (((jump-if)) ((15 boolean)) ((6 offset))) mem: ((15 boolean)) => nil run: interpolate/main 29: (((11 byte)) <- ((index)) ((4 string-address) (deref)) ((14 integer))) mem: ((14 integer)) => 0 array-len: ((1010 string) (raw)) mem: ((1010 integer) (raw)) => 3 mem: ((1011 byte) (raw)) => a run: interpolate/main 29: #\a => ((11 byte)) mem: ((11 byte)): 1026 <= #\a run: interpolate/main 30: (((13 byte-address)) <- ((index-address)) ((7 string-address) (deref)) ((8 integer))) mem: ((8 integer)) => 0 array-len: ((1075 string) (raw)) mem: ((1075 integer) (raw)) => 11 run: interpolate/main 30: 1076 => ((13 byte-address)) mem: ((13 byte-address)): 1028 <= 1076 run: interpolate/main 31: (((13 byte-address) (deref)) <- ((copy)) ((11 byte))) mem: ((11 byte)) => a run: interpolate/main 31: #\a => ((13 byte-address) (deref)) mem: ((13 byte-address) (deref)): 1076 <= #\a run: interpolate/main 32: (((14 integer)) <- ((add)) ((14 integer)) ((1 literal))) mem: ((14 integer)) => 0 run: interpolate/main 32: 1 => ((14 integer)) mem: ((14 integer)): 1029 <= 1 run: interpolate/main 33: (((8 integer)) <- ((add)) ((8 integer)) ((1 literal))) mem: ((8 integer)) => 0 run: interpolate/main 33: 1 => ((8 integer)) mem: ((8 integer)): 1023 <= 1 run: interpolate/main 34: (((jump)) ((-8 offset))) run: interpolate/main 27: (((15 boolean)) <- ((greater-or-equal)) ((14 integer)) ((6 integer))) mem: ((14 integer)) => 1 mem: ((6 integer)) => 3 run: interpolate/main 27: nil => ((15 boolean)) mem: ((15 boolean)): 1030 <= nil run: interpolate/main 28: (((jump-if)) ((15 boolean)) ((6 offset))) mem: ((15 boolean)) => nil run: interpolate/main 29: (((11 byte)) <- ((index)) ((4 string-address) (deref)) ((14 integer))) mem: ((14 integer)) => 1 array-len: ((1010 string) (raw)) mem: ((1010 integer) (raw)) => 3 mem: ((1012 byte) (raw)) => b run: interpolate/main 29: #\b => ((11 byte)) mem: ((11 byte)): 1026 <= #\b run: interpolate/main 30: (((13 byte-address)) <- ((index-address)) ((7 string-address) (deref)) ((8 integer))) mem: ((8 integer)) => 1 array-len: ((1075 string) (raw)) mem: ((1075 integer) (raw)) => 11 run: interpolate/main 30: 1077 => ((13 byte-address)) mem: ((13 byte-address)): 1028 <= 1077 run: interpolate/main 31: (((13 byte-address) (deref)) <- ((copy)) ((11 byte))) mem: ((11 byte)) => b run: interpolate/main 31: #\b => ((13 byte-address) (deref)) mem: ((13 byte-address) (deref)): 1077 <= #\b run: interpolate/main 32: (((14 integer)) <- ((add)) ((14 integer)) ((1 literal))) mem: ((14 integer)) => 1 run: interpolate/main 32: 2 => ((14 integer)) mem: ((14 integer)): 1029 <= 2 run: interpolate/main 33: (((8 integer)) <- ((add)) ((8 integer)) ((1 literal))) mem: ((8 integer)) => 1 run: interpolate/main 33: 2 => ((8 integer)) mem: ((8 integer)): 1023 <= 2 run: interpolate/main 34: (((jump)) ((-8 offset))) run: interpolate/main 27: (((15 boolean)) <- ((greater-or-equal)) ((14 integer)) ((6 integer))) mem: ((14 integer)) => 2 mem: ((6 integer)) => 3 run: interpolate/main 27: nil => ((15 boolean)) mem: ((15 boolean)): 1030 <= nil run: interpolate/main 28: (((jump-if)) ((15 boolean)) ((6 offset))) mem: ((15 boolean)) => nil run: interpolate/main 29: (((11 byte)) <- ((index)) ((4 string-address) (deref)) ((14 integer))) mem: ((14 integer)) => 2 array-len: ((1010 string) (raw)) mem: ((1010 integer) (raw)) => 3 mem: ((1013 byte) (raw)) => c run: interpolate/main 29: #\c => ((11 byte)) mem: ((11 byte)): 1026 <= #\c run: interpolate/main 30: (((13 byte-address)) <- ((index-address)) ((7 string-address) (deref)) ((8 integer))) mem: ((8 integer)) => 2 array-len: ((1075 string) (raw)) mem: ((1075 integer
# This plugin serves as an example for adding key bindings through a plugin.
# It could replace the ten lines in the rc.conf that create the key bindings
# for the "chmod" command.
import ranger.api
old_hook_init = ranger.api.hook_init
def hook_init(fm):
old_hook_init(fm)
# Generate key bindings for the chmod command
command = "map {0}{1}{2} shell -d chmod {1}{0}{2} %s"
for mode in list('ugoa') + '':
for perm in "rwxXst":
fm.execute_console(command.format('-', mode, perm))
fm.execute_console(command.format('+', mode, perm))
ranger.api.hook_init = hook_init