From 6d0b2aebe0e4576edd2ced8d063b9cb5d6e9ae4f Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Sun, 7 Jul 2019 14:37:09 +1000 Subject: [PATCH] doku2git: prefix unused variables with an underscore This prevents PyCharm from generating unused variable warnings. --- doku2git.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doku2git.py b/doku2git.py index d429a5c..67224d3 100755 --- a/doku2git.py +++ b/doku2git.py @@ -88,11 +88,11 @@ class Change(object): def __str__(self): return f'{self.user}@{self.timestamp}:{self.page} "{self.description}"' - def _delete(self, src: str, dst: str) -> Generator[str, None, None]: + def _delete(self, _src: str, _dst: str) -> Generator[str, None, None]: """ Generates the required commands to delete a given page - :param src: The Dokuwiki instance the change belongs to - :param dst: The path to the root of the git repository. + :param _src: The Dokuwiki instance the change belongs to + :param _dst: The path to the root of the git repository. """ localpath = self.page.replace(':', os.path.sep) yield f'git rm --quiet "{localpath}.txt"' @@ -156,10 +156,10 @@ class PageChange(Change): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - def _attic(self, src) -> str: + def _attic(self, _src) -> str: """ Find the path to the history data within the Dokuwiki directories. - :param src: The Dokuwiki instance this change belongs to. + :param _src: The Dokuwiki instance this change belongs to. :return: The relative path from the root of Dokuwiki to the compressed data. This is always gzip compressed. """ @@ -378,7 +378,7 @@ if __name__ == "__main__": 'die() { echo "$*" 1>&2 ; exit 1; }', ] - def preamble(src, dst: str): + def preamble(_src, dst: str): cmds = [ f'git init "{dst}"', f'cd "{dst}"', @@ -387,7 +387,7 @@ if __name__ == "__main__": for c in cmds: yield c - def finish(src, dst: str): + def finish(_src, _dst: str): arguments = [ f'git commit', ' --quiet',