# Path: ranger.py
# ARGV = sys.argv[1:sys.argv.index('--')] if '--' in sys.argv else sys.argv[1:]


import sys
import copy
import curses.ascii
    import doctest
from ranger import PY3
            del pointer[keys[pos]]
    elif len(keys) == pos + 1:
        try:
            del pointer[keys[pos]]
        except KeyError:
            pass
        try:
            keys.pop()
        except IndexError:
            pass


class KeyMaps(dict):

    def __init__(self, keybuffer=None):
        dict.__init__(self)
        self.keybuffer = keybuffer
        self.used_keymap = None

    def use_keymap(self, keymap_name):
        self.keybuffer.keymap = self.get(keymap_name, {})
        if self.used_keymap != keymap_name:
            self.used_keymap = keymap_name
            self.keybuffer.clear()

    def _clean_input(self, context, keys):
        try:
            pointer = self[context]
        except KeyError:
            self[context] = pointer = {}

# Path: ranger.py
# ARGV = sys.argv[1:sys.argv.index('--')] if '--' in sys.argv else sys.argv[1:]


# Path: ranger/ext/keybinding_parser.py
import sys
import copy
import curses.ascii
    import doctest
from ranger import PY3

            del pointer[keys[pos]]
    elif len(keys) == pos + 1:
        try:
            del pointer[keys[pos]]
        except KeyError:
            pass
        try:
            keys.pop()
        except IndexError:
            pass


class KeyMaps(dict):

    def __init__(self, keybuffer=None):
        dict.__init__(self)
        self.keybuffer = keybuffer
        self.used_keymap = None

    def use_keymap(self, keymap_name):
        self.keybuffer.keymap = self.get(keymap_name, {})
        if self.used_keymap != keymap_name:
            self.used_keymap = keymap_name
            self.keybuffer.clear()

    def _clean_input(self, context, keys):
        try:
            pointer = self[context]
        except KeyError:
            self[context] = pointer = {}

        if PY3: