mirror of
https://github.com/nvbn/thefuck.git
synced 2025-01-18 12:06:04 +00:00
#313 Remove types.Script
, use Command
with None
as stdout
and stderr
This commit is contained in:
parent
20f51f5ffe
commit
cf82af8978
@ -97,12 +97,12 @@ def get_command(settings, args):
|
|||||||
return types.Command(script, stdout, stderr)
|
return types.Command(script, stdout, stderr)
|
||||||
else:
|
else:
|
||||||
logs.debug(u'Execution timed out!', settings)
|
logs.debug(u'Execution timed out!', settings)
|
||||||
return types.Script(script)
|
return types.Command(script, None, None)
|
||||||
|
|
||||||
|
|
||||||
def get_matched_rule(command, rules, settings):
|
def get_matched_rule(command, rules, settings):
|
||||||
"""Returns first matched rule for command."""
|
"""Returns first matched rule for command."""
|
||||||
script_only = isinstance(command, types.Script)
|
script_only = command.stdout is None and command.stderr is None
|
||||||
|
|
||||||
for rule in rules:
|
for rule in rules:
|
||||||
if script_only and rule.requires_output:
|
if script_only and rule.requires_output:
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
import zipfile
|
import zipfile
|
||||||
from thefuck import logs
|
|
||||||
|
|
||||||
|
|
||||||
def _is_bad_zip(file):
|
def _is_bad_zip(file):
|
||||||
|
@ -2,7 +2,6 @@ from collections import namedtuple
|
|||||||
|
|
||||||
|
|
||||||
Command = namedtuple('Command', ('script', 'stdout', 'stderr'))
|
Command = namedtuple('Command', ('script', 'stdout', 'stderr'))
|
||||||
Script = namedtuple('Script', ('script'))
|
|
||||||
|
|
||||||
Rule = namedtuple('Rule', ('name', 'match', 'get_new_command',
|
Rule = namedtuple('Rule', ('name', 'match', 'get_new_command',
|
||||||
'enabled_by_default', 'side_effect',
|
'enabled_by_default', 'side_effect',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user