doku2git: Use PEP8 spacing
This commit is contained in:
parent
2516091c4d
commit
93c173ae10
10
doku2git.py
10
doku2git.py
@ -14,7 +14,7 @@ import itertools
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
logging.basicConfig(level = logging.WARNING)
|
logging.basicConfig(level=logging.WARNING)
|
||||||
log = logging.getLogger()
|
log = logging.getLogger()
|
||||||
|
|
||||||
|
|
||||||
@ -286,8 +286,8 @@ class Dokuwiki:
|
|||||||
self.users = self._find_users()
|
self.users = self._find_users()
|
||||||
self.media = collections.defaultdict(list)
|
self.media = collections.defaultdict(list)
|
||||||
|
|
||||||
page_generator = self._find_meta(os.path.join (self.root, 'data', 'meta'), PageChange)
|
page_generator = self._find_meta(os.path.join(self.root, 'data', 'meta'), PageChange)
|
||||||
media_generator = self._find_meta(os.path.join (self.root, 'data', 'media_meta'), MediaChange)
|
media_generator = self._find_meta(os.path.join(self.root, 'data', 'media_meta'), MediaChange)
|
||||||
|
|
||||||
self.changes = list(page_generator)
|
self.changes = list(page_generator)
|
||||||
for entry in media_generator:
|
for entry in media_generator:
|
||||||
@ -295,7 +295,7 @@ class Dokuwiki:
|
|||||||
self.changes.append(entry)
|
self.changes.append(entry)
|
||||||
|
|
||||||
self.changes.sort(key=attrgetter('timestamp'))
|
self.changes.sort(key=attrgetter('timestamp'))
|
||||||
for k,v in self.media.items():
|
for k, v in self.media.items():
|
||||||
v.sort(key=attrgetter('timestamp'), reverse=True)
|
v.sort(key=attrgetter('timestamp'), reverse=True)
|
||||||
|
|
||||||
def _find_users(self) -> Mapping[str, User]:
|
def _find_users(self) -> Mapping[str, User]:
|
||||||
@ -324,7 +324,6 @@ class Dokuwiki:
|
|||||||
found[None] = User(login="system", real_name="system", email="system@mlug-au.org")
|
found[None] = User(login="system", real_name="system", email="system@mlug-au.org")
|
||||||
return found
|
return found
|
||||||
|
|
||||||
|
|
||||||
def _find_meta(self, root: str, type):
|
def _find_meta(self, root: str, type):
|
||||||
for dirpath, dirnames, filenames in os.walk(root):
|
for dirpath, dirnames, filenames in os.walk(root):
|
||||||
for file in filenames:
|
for file in filenames:
|
||||||
@ -343,7 +342,6 @@ class Dokuwiki:
|
|||||||
for change in self._read_meta(path, type):
|
for change in self._read_meta(path, type):
|
||||||
yield change
|
yield change
|
||||||
|
|
||||||
|
|
||||||
def _read_meta(self, path: str, type):
|
def _read_meta(self, path: str, type):
|
||||||
log.debug("extracting meta from %s", path)
|
log.debug("extracting meta from %s", path)
|
||||||
with open(path, 'r') as data:
|
with open(path, 'r') as data:
|
||||||
|
Loading…
Reference in New Issue
Block a user