mypy: Minor zthumbor annotation changes.

- Any->Text in helpers.py;
- Remove ignore and add generic params.

revert thumbor except type.
This commit is contained in:
neiljp (Neil Pilgrim) 2018-03-12 02:27:29 +00:00 committed by Tim Abbott
parent 21033669a8
commit aa48929f66
2 changed files with 3 additions and 3 deletions

View File

@ -35,7 +35,7 @@ else:
secrets_file.read(os.path.join(DEPLOY_ROOT, "zproject/dev-secrets.conf"))
def get_secret(key):
# type: (str) -> Any
# type: (str) -> Optional[Text]
if secrets_file.has_option('secrets', key):
return secrets_file.get('secrets', key)
return None

View File

@ -19,9 +19,9 @@ def get_not_found_result():
result.successful = False
return result
@return_future # type: ignore # This was giving mypy error for missing generic datatype?
@return_future
def load(context, url, callback):
# type: (Context, str, Callable) -> None
# type: (Context, str, Callable[..., Any]) -> None
url = urllib.parse.unquote(url)
url_params = get_url_params(url)
source_type = url_params.get('source_type')