2015-08-26 10:12:52 +01:00
|
|
|
from pathlib import Path
|
2015-04-25 01:35:26 +01:00
|
|
|
from thefuck import types
|
2015-05-06 12:57:09 +01:00
|
|
|
from thefuck.conf import DEFAULT_PRIORITY
|
2015-04-25 01:35:26 +01:00
|
|
|
|
|
|
|
|
|
|
|
def Command(script='', stdout='', stderr=''):
|
|
|
|
return types.Command(script, stdout, stderr)
|
|
|
|
|
|
|
|
|
2015-09-08 12:18:11 +01:00
|
|
|
class Rule(types.Rule):
|
|
|
|
def __init__(self, name='', match=lambda *_: True,
|
|
|
|
get_new_command=lambda *_: '',
|
|
|
|
enabled_by_default=True,
|
|
|
|
side_effect=None,
|
|
|
|
priority=DEFAULT_PRIORITY,
|
|
|
|
requires_output=True):
|
|
|
|
super(Rule, self).__init__(name, match, get_new_command,
|
|
|
|
enabled_by_default, side_effect,
|
|
|
|
priority, requires_output)
|
|
|
|
|
|
|
|
|
|
|
|
class CorrectedCommand(types.CorrectedCommand):
|
|
|
|
def __init__(self, script='', side_effect=None, priority=DEFAULT_PRIORITY):
|
|
|
|
super(CorrectedCommand, self).__init__(
|
|
|
|
script, side_effect, priority)
|
2015-08-26 10:12:52 +01:00
|
|
|
|
|
|
|
|
|
|
|
root = Path(__file__).parent.parent.resolve()
|