From ebef0dc5655dcebec05fde0025b941f8e4b27c00 Mon Sep 17 00:00:00 2001 From: Vadim Troshchinskiy Date: Tue, 8 Oct 2024 13:25:34 +0200 Subject: [PATCH] Lint fixes --- gitlib/gitlib.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/gitlib/gitlib.py b/gitlib/gitlib.py index 0fc7ea2..5959d2a 100755 --- a/gitlib/gitlib.py +++ b/gitlib/gitlib.py @@ -10,12 +10,12 @@ # import os import shutil -import git + import argparse import tempfile import logging import subprocess -import libarchive + import pwd import grp import datetime @@ -24,19 +24,24 @@ import sys from pathlib import Path -import xattr -import posix1e + + import base64 -import blkid + import stat import time from enum import Enum +import git +import libarchive +import xattr +import posix1e +import blkid class OgProgressPrinter(git.RemoteProgress): - def __init__(self, logger): - self.logger = logger + def __init__(self, parentLogger): + self.logger = parentLogger def update(self, op_code, cur_count, max_count=None, message=""): self.logger.debug(f"Progress: {op_code} {cur_count}/{max_count}: {message}") @@ -144,11 +149,6 @@ class NTFSLibrary: else: raise ValueError("Unknown NTFS implementation: {self.implementation}") - - # We've mounted a new filesystem, update our filesystems list - self.mounts = self._parse_mounts() - - def _hex_to_bin(self, hex_str): while len(hex_str) != 16: @@ -1028,7 +1028,7 @@ class OpengnsysGitLibrary: if os.path.isfile(full_path) and file in self.rename_list and root != path: # Process this last so that all the metadata references the real names. - logger.debug(f"Found file to rename: {full_path}") + self.logger.debug(f"Found file to rename: {full_path}") renamed_file_path = full_path + "-opengnsys-renamed" renamed_file_path_rel = full_path_rel + "-opengnsys-renamed" @@ -1049,7 +1049,7 @@ class OpengnsysGitLibrary: if os.path.isdir(full_path) and subdir in self.rename_list and root != path: - logger.debug(f"Found directory to rename: {full_path}") + self.logger.debug(f"Found directory to rename: {full_path}") renamed_dir_path = full_path + "-opengnsys-renamed" renamed_dir_path_rel = full_path_rel + "-opengnsys-renamed" @@ -1305,7 +1305,7 @@ class OpengnsysGitLibrary: self.logger.debug(f"Will mount repo at {path}") if not os.path.exists(path): - os.path.mkdir(path) + os.mkdir(path)