Type Hints - __main__ (#2574)

* Add __main__ type hints

* Fix most errors of __main__

* Add ignore for script.run()

* Add type annotations for from_config_dict and from_config_file

* Fix errors

* Fix requirement error

* Add mypy type check to tests

* Enable travis typing check

* Messed up the tox deps

* Laxer type checker
This commit is contained in:
Fabian Heredia Montiel authored and Paulus Schoutsen committed 2016-07-20 22:38:52 -07:00
1 parent d570d38d5c
commit 08226a4864
10 files changed
+58 -32

No files matched your search

+2 -2
View File
@@ -3,7 +3,7 @@ import importlib
import os
def run(args):
def run(args: str) -> int:
"""Run a script."""
scripts = [fil[:-3] for fil in os.listdir(os.path.dirname(__file__))
if fil.endswith('.py') and fil != '__init__.py']
@@ -19,4 +19,4 @@ def run(args):
return 1
script = importlib.import_module('homeassistant.scripts.' + args[0])
return script.run(args[1:])
return script.run(args[1:]) # type: ignore