mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-22 06:17:50 +00:00
typing is .. good?
This commit is contained in:
parent
356a1d0f79
commit
a5b95273d7
@ -33,7 +33,7 @@ Ported to Python 3.
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from six import ensure_text
|
from six import ensure_text
|
||||||
from typing import Union, Callable, Any, Optional, cast
|
from typing import Union, Callable, Any, Optional, cast, Dict
|
||||||
from os import urandom
|
from os import urandom
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
@ -202,14 +202,15 @@ class StorageClientConfig(object):
|
|||||||
in getPlugins(IFoolscapStoragePlugin)
|
in getPlugins(IFoolscapStoragePlugin)
|
||||||
}
|
}
|
||||||
|
|
||||||
configured = dict()
|
# mypy doesn't like "str" in place of Any ...
|
||||||
|
configured: Dict[Any, IFoolscapStoragePlugin] = dict()
|
||||||
for plugin_name in self.storage_plugins:
|
for plugin_name in self.storage_plugins:
|
||||||
try:
|
try:
|
||||||
plugin = plugins[plugin_name]
|
plugin = plugins[plugin_name]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raise MissingPlugin(plugin_name)
|
raise MissingPlugin(plugin_name)
|
||||||
configured[plugin_name] = plugin
|
configured[plugin_name] = plugin
|
||||||
return configured # type: ignore
|
return configured
|
||||||
|
|
||||||
|
|
||||||
@implementer(IStorageBroker)
|
@implementer(IStorageBroker)
|
||||||
|
Loading…
Reference in New Issue
Block a user