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


import os
import re
import ranger
        import logging
    import doctest
    import sys
from ranger import MACRO_DELIMITER, MACRO_DELIMITER_ESC
from ranger.core.shared import FileManagerAware
from ranger.ext.lazy_property import lazy_property
from ranger.api import LinemodeBase, hook_init, hook_ready, register_linemode  # COMPAT
        from os.path import dirname, basename, expanduser, join
        from os.path import dirname, basename, expanduser, join
        from ranger.ext.get_executables import get_executables
                return results.replace(MACRO_DELIMITER, MACRO_DELIMITER_ESC)
            elif hasattr(results, '__iter__'):
                return (result.replace(MACRO_DELIMITER, MACRO_DELIMITER_ESC) for result in results)
            return None
        setattr(cls, 'tab', tab)

    return cls


class CommandContainer(FileManagerAware):

    def __init__(self):
        self.commands = {}

    def __getitem__(self, key):
        return self.commands[key]

    def alias(self, name, full_command):
        cmd_name = full_command.split()[0]
        cmd_cls = self.get_command(cmd_name)
        if cmd_cls is None:
            self.fm.notify('alias failed: No such command: {0}'.format(cmd_name), bad=True)
        else:
            self.commands[name] = _command_init(command_alias_factory(name, cmd_cls, full_command))

    def load_commands_from_module(self, module):
        for var in vars(module).values():
            try:
                if issubclass(var, Command) and var != Command:
                    self.commands[var.get_name()] = _command_init(var)

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


# Path: ranger/api/commands.py
import os
import re
import ranger
        import logging
    import doctest
    import sys
from ranger import MACRO_DELIMITER, MACRO_DELIMITER_ESC
from ranger.core.shared import FileManagerAware
from ranger.ext.lazy_property import lazy_property
from ranger.api import LinemodeBase, hook_init, hook_ready, register_linemode  # COMPAT
        from os.path import dirname, basename, expanduser, join
        from os.path import dirname, basename, expanduser, join
        from ranger.ext.get_executables import get_executables

                return results.replace(MACRO_DELIMITER, MACRO_DELIMITER_ESC)
            elif hasattr(results, '__iter__'):
                return (result.replace(MACRO_DELIMITER, MACRO_DELIMITER_ESC) for result in results)
            return None
        setattr(cls, 'tab', tab)

    return cls


class CommandContainer(FileManagerAware):

    def __init__(self):
        self.commands = {}

    def __getitem__(self, key):
        return self.commands[key]

    def alias(self, name, full_command):
        cmd_name = full_command.split()[0]
        cmd_cls = self.get_command(cmd_name)
        if cmd_cls is None:
            self.fm.notify('alias failed: No such command: {0}'.format(cmd_name), bad=True)
        else:
            self.commands[name] = _command_init(command_alias_factory(name, cmd_cls, full_command))

    def load_commands_from_module(self, module):
        for var in vars(module).values():
            try:
                if issubclass(var, Command) and var != Command:
                    self.commands[var.get_name()] = _command_init(var)

            except TypeError: