Jelajahi Sumber

remove unused imports, add missing imports

Thomas Waldmann 9 tahun lalu
induk
melakukan
6d5cc06cf6
7 mengubah file dengan 2 tambahan dan 9 penghapusan
  1. 1 1
      borg/archiver.py
  2. 0 4
      borg/cache.py
  3. 1 0
      borg/key.py
  4. 0 1
      borg/logger.py
  5. 0 1
      borg/repository.py
  6. 0 1
      borg/testsuite/logger.py
  7. 0 1
      setup.py

+ 1 - 1
borg/archiver.py

@@ -17,7 +17,7 @@ import traceback
 from . import __version__
 from .helpers import Error, location_validator, format_time, format_file_size, \
     format_file_mode, ExcludePattern, IncludePattern, exclude_path, adjust_patterns, to_localtime, timestamp, \
-    get_cache_dir, get_keys_dir, format_timedelta, prune_within, prune_split, \
+    get_cache_dir, get_keys_dir, prune_within, prune_split, \
     Manifest, remove_surrogates, update_excludes, format_archive, check_extension_modules, Statistics, \
     is_cachedir, bigint_to_int, ChunkerParams, CompressionSpec, have_cython, is_slow_msgpack, yes, \
     EXIT_SUCCESS, EXIT_WARNING, EXIT_ERROR

+ 0 - 4
borg/cache.py

@@ -1,14 +1,10 @@
 import configparser
 from .remote import cache_if_remote
 from collections import namedtuple
-import errno
 import os
 import stat
-import sys
 from binascii import hexlify
 import shutil
-import tarfile
-import tempfile
 
 from .key import PlaintextKey
 from .logger import create_logger

+ 1 - 0
borg/key.py

@@ -2,6 +2,7 @@ from binascii import hexlify, a2b_base64, b2a_base64
 import configparser
 import getpass
 import os
+import sys
 import textwrap
 import hmac
 from hashlib import sha256

+ 0 - 1
borg/logger.py

@@ -32,7 +32,6 @@ The way to use this is as follows:
 
 import inspect
 import logging
-import sys
 
 
 def setup_logging(stream=None):

+ 0 - 1
borg/repository.py

@@ -8,7 +8,6 @@ logger = logging.getLogger(__name__)
 import os
 import shutil
 import struct
-import sys
 from zlib import crc32
 
 from .helpers import Error, ErrorWithTraceback, IntegrityError, read_msgpack, write_msgpack, unhexlify, have_cython

+ 0 - 1
borg/testsuite/logger.py

@@ -1,7 +1,6 @@
 import logging
 from io import StringIO
 
-from mock import Mock
 import pytest
 
 from ..logger import find_parent_module, create_logger, setup_logging

+ 0 - 1
setup.py

@@ -6,7 +6,6 @@ from glob import glob
 
 from distutils.command.build import build
 from distutils.core import Command
-from distutils.errors import DistutilsOptionError
 from distutils import log
 from setuptools.command.build_py import build_py