#366 Add type annotations in core components
This commit is contained in:
@@ -54,6 +54,7 @@ class CommandSelector(object):
|
||||
"""Helper for selecting rule from rules list."""
|
||||
|
||||
def __init__(self, commands):
|
||||
""":type commands: Iterable[thefuck.types.CorrectedCommand]"""
|
||||
self._commands_gen = commands
|
||||
try:
|
||||
self._commands = [next(self._commands_gen)]
|
||||
@@ -77,6 +78,7 @@ class CommandSelector(object):
|
||||
|
||||
@property
|
||||
def value(self):
|
||||
""":rtype hefuck.types.CorrectedCommand"""
|
||||
return self._commands[self._index]
|
||||
|
||||
|
||||
@@ -87,6 +89,9 @@ def select_command(corrected_commands):
|
||||
- None when ctrl+c pressed;
|
||||
- selected command.
|
||||
|
||||
:type corrected_commands: Iterable[thefuck.types.CorrectedCommand]
|
||||
:rtype: thefuck.types.CorrectedCommand | None
|
||||
|
||||
"""
|
||||
try:
|
||||
selector = CommandSelector(corrected_commands)
|
||||
|
||||
Reference in New Issue
Block a user