# Path: thefuck/conf.py
# class Settings(dict):
#     def __getattr__(self, item):
#     def __setattr__(self, key, value):
#     def init(self, args=None):
#     def _init_settings_file(self):
#     def _get_user_dir_path(self):
#     def _setup_user_dir(self):
#     def _settings_from_file(self):
#     def _rules_from_env(self, val):
#     def _priority_from_env(self, val):
#     def _val_from_env(self, env, attr):
#     def _settings_from_env(self):
#     def _settings_from_args(self, args):
# 
# Path: thefuck/const.py
# ARGUMENT_PLACEHOLDER = 'THEFUCK_ARGUMENT_PLACEHOLDER'


from subprocess import Popen, PIPE
from time import time
from .. import logs
from ..conf import settings
from ..const import ARGUMENT_PLACEHOLDER
from ..utils import DEVNULL, cache
from .generic import Generic
import os
import sys
import six
                '  if [ "$unfucked_command" != "" ]\n'
                '    eval $unfucked_command\n{1}'
                '  end\n'
                'end').format(alias_name, alter_history, ARGUMENT_PLACEHOLDER)

    def get_aliases(self):
        overridden = self._get_overridden_aliases()
        functions = _get_functions(overridden)
        raw_aliases = _get_aliases(overridden)
        functions.update(raw_aliases)
        return functions

    def _expand_aliases(self, command_script):
        aliases = self.get_aliases()
        binary = command_script.split(' ')[0]
        if binary in aliases and aliases[binary] != binary:
            return command_script.replace(binary, aliases[binary], 1)
        elif binary in aliases:
            return u'fish -ic "{}"'.format(command_script.replace('"', r'\"'))
        else:
            return command_script

    def _get_history_file_name(self):
        return os.path.expanduser('~/.config/fish/fish_history')

    def _get_history_line(self, command_script):
        return u'- cmd: {}\n   when: {}\n'.format(command_script, int(time()))

    def _script_from_history(self, line):
        if '- cmd: ' in line:

# Path: thefuck/conf.py
# class Settings(dict):
#     def __getattr__(self, item):
#     def __setattr__(self, key, value):
#     def init(self, args=None):
#     def _init_settings_file(self):
#     def _get_user_dir_path(self):
#     def _setup_user_dir(self):
#     def _settings_from_file(self):
#     def _rules_from_env(self, val):
#     def _priority_from_env(self, val):
#     def _val_from_env(self, env, attr):
#     def _settings_from_env(self):
#     def _settings_from_args(self, args):
# 
# Path: thefuck/const.py
# ARGUMENT_PLACEHOLDER = 'THEFUCK_ARGUMENT_PLACEHOLDER'


# Path: thefuck/shells/fish.py
from subprocess import Popen, PIPE
from time import time
from .. import logs
from ..conf import settings
from ..const import ARGUMENT_PLACEHOLDER
from ..utils import DEVNULL, cache
from .generic import Generic
import os
import sys
import six

                '  if [ "$unfucked_command" != "" ]\n'
                '    eval $unfucked_command\n{1}'
                '  end\n'
                'end').format(alias_name, alter_history, ARGUMENT_PLACEHOLDER)

    def get_aliases(self):
        overridden = self._get_overridden_aliases()
        functions = _get_functions(overridden)
        raw_aliases = _get_aliases(overridden)
        functions.update(raw_aliases)
        return functions

    def _expand_aliases(self, command_script):
        aliases = self.get_aliases()
        binary = command_script.split(' ')[0]
        if binary in aliases and aliases[binary] != binary:
            return command_script.replace(binary, aliases[binary], 1)
        elif binary in aliases:
            return u'fish -ic "{}"'.format(command_script.replace('"', r'\"'))
        else:
            return command_script

    def _get_history_file_name(self):
        return os.path.expanduser('~/.config/fish/fish_history')

    def _get_history_line(self, command_script):
        return u'- cmd: {}\n   when: {}\n'.format(command_script, int(time()))

    def _script_from_history(self, line):
        if '- cmd: ' in line:

            return line.split('- cmd: ', 1)[1]