Dokuwiki: Use Dict typing over Mapping

Mapping doesn't provide __setitem__ which we need.
This commit is contained in:
Danny Robson 2019-07-07 14:35:44 +10:00
parent 93c173ae10
commit 380254d8ab

View File

@ -2,7 +2,7 @@
###############################################################################
from typing import List, Mapping, Iterable, Callable, Generator
from typing import List, Dict, Iterable, Callable, Generator
from operator import attrgetter
import os.path
@ -274,8 +274,8 @@ class Dokuwiki:
editors. Either way it will never rewrite any data.
"""
users: Mapping[str, User]
media: Mapping[str, List[Change]]
users: Dict[str, User]
media: Dict[str, List[Change]]
changes: List[Change]
def _record_media(self, change):
@ -298,7 +298,7 @@ class Dokuwiki:
for k, v in self.media.items():
v.sort(key=attrgetter('timestamp'), reverse=True)
def _find_users(self) -> Mapping[str, User]:
def _find_users(self) -> Dict[str, User]:
"""
Parses the users.auth.php file to discover all listed users.
:return: A mapping of login to User objects