mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-python
synced 2026-01-15 09:53:32 +01:00
Fix errors reported by mypy
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
f3ba709d21
commit
bfd0544ff8
13 changed files with 68 additions and 71 deletions
|
|
@ -29,7 +29,7 @@ class MapAttr2Shape: # export
|
|||
for name, url in self.__ns.items():
|
||||
ET.register_namespace(name, url)
|
||||
|
||||
def __keys(self, root):
|
||||
def __keys(self, root) -> dict[str, str]:
|
||||
ret: dict[str, str] = {}
|
||||
for el in root.findall('key', self.__ns):
|
||||
attr_name = el.get('attr.name')
|
||||
|
|
@ -44,7 +44,7 @@ class MapAttr2Shape: # export
|
|||
return None
|
||||
return data.text
|
||||
|
||||
def __attribs(self, node, keys):
|
||||
def __attribs(self, node, keys) -> dict[str, str]:
|
||||
ret: dict[str, str] = {}
|
||||
for name, key in keys.items():
|
||||
val = self.__value(node, key)
|
||||
|
|
@ -93,13 +93,13 @@ class MapAttr2Shape: # export
|
|||
values[key] = default
|
||||
continue
|
||||
try:
|
||||
if isinstance(str, mapping):
|
||||
if isinstance(mapping, str):
|
||||
values[key] = mapping
|
||||
continue
|
||||
mapped = mapping(self.__attribs(node, keys))
|
||||
values[key] = mapped or default
|
||||
except:
|
||||
pass
|
||||
mapped = mapping(self.__attribs(node, keys))
|
||||
values[key] = mapped or default
|
||||
|
||||
color = values['color']
|
||||
text = values['text']
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue