diff --git a/bin/filecheck.py b/bin/filecheck.py index 8440bd6..9a83b27 100644 --- a/bin/filecheck.py +++ b/bin/filecheck.py @@ -144,11 +144,7 @@ class File(FileBase): class KittenGroomerFileCheck(KittenGroomerBase): - def __init__(self, root_src=None, root_dst=None, max_recursive_depth=2, debug=False): - if root_src is None: - root_src = os.path.join(os.sep, 'media', 'src') - if root_dst is None: - root_dst = os.path.join(os.sep, 'media', 'dst') + def __init__(self, root_src, root_dst, max_recursive_depth=2, debug=False): super(KittenGroomerFileCheck, self).__init__(root_src, root_dst, debug) self.recursive_archive_depth = 0 self.max_recursive_depth = max_recursive_depth diff --git a/kittengroomer/helpers.py b/kittengroomer/helpers.py index d140ecc..3ccbb08 100644 --- a/kittengroomer/helpers.py +++ b/kittengroomer/helpers.py @@ -9,7 +9,6 @@ desired behavior. import os -import sys import hashlib import shutil import argparse @@ -198,27 +197,6 @@ class KittenGroomerBase(object): def tree(self, base_dir, padding=' '): """Writes a graphical tree to the log for a given directory.""" - if sys.version_info.major == 2: - self.__tree_py2(base_dir, padding) - else: - self.__tree_py3(base_dir, padding) - - def __tree_py2(self, base_dir, padding=' '): - with open(self.log_content, 'ab') as lf: - lf.write('#' * 80 + '\n') - lf.write('{}+- {}/\n'.format(padding, os.path.basename(os.path.abspath(base_dir)))) - padding += '| ' - files = sorted(os.listdir(base_dir)) - for f in files: - curpath = os.path.join(base_dir, f) - if os.path.islink(curpath): - lf.write('{}+-- {}\t- Symbolic link to {}\n'.format(padding, f, os.readlink(curpath))) - elif os.path.isdir(curpath): - self.tree(curpath, padding) - elif os.path.isfile(curpath): - lf.write('{}+-- {}\t- {}\n'.format(padding, f, self._computehash(curpath))) - - def __tree_py3(self, base_dir, padding=' '): with open(self.log_content, 'ab') as lf: lf.write(bytes('#' * 80 + '\n', 'UTF-8')) lf.write(bytes('{}+- {}/\n'.format(padding, os.path.basename(os.path.abspath(base_dir)).encode()), 'utf8'))