diff --git a/README.md b/README.md index 5c85508..8b72e9e 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ chkbit will Run `chkbit PATH` to verify only. ``` -usage: chkbit.py [-h] [-u] [--algo ALGO] [-f] [-i] [-s] [-w N] [-q] [-v] [PATH ...] +usage: chkbit [-h] [-u] [--algo ALGO] [-f] [-i] [-s] [-w N] [-q] [-v] [PATH ...] Checks the data integrity of your files. See https://github.com/laktak/chkbit-py diff --git a/chkbit/context.py b/chkbit/context.py index 607ab73..4bbede8 100644 --- a/chkbit/context.py +++ b/chkbit/context.py @@ -1,9 +1,5 @@ -import hashlib - - class Context: def __init__(self, verify_index, update, force, hash_algo, skip_symlinks): - self.verify_index = verify_index self.update = update self.force = force diff --git a/chkbit/hashfile.py b/chkbit/hashfile.py index e8f5b00..0c995fe 100644 --- a/chkbit/hashfile.py +++ b/chkbit/hashfile.py @@ -5,7 +5,6 @@ BLOCKSIZE = 2**10 * 128 # kb def hashfile(path, hash_algo=None): - if not hash_algo or hash_algo == "md5": h = hashlib.md5() elif hash_algo == "sha512": diff --git a/chkbit/indexthread.py b/chkbit/indexthread.py index b55ce69..3b910d9 100644 --- a/chkbit/indexthread.py +++ b/chkbit/indexthread.py @@ -41,7 +41,6 @@ class IndexThread: # load index e = Index(parent, files, log=self._log) if e.load() or not self.verify_index_only: - # calc the new hashes e.update(self.context) diff --git a/chkbit/main.py b/chkbit/main.py index 013d947..d00376e 100644 --- a/chkbit/main.py +++ b/chkbit/main.py @@ -30,7 +30,6 @@ class Main: self._parse_args() def _log(self, idx, stat, path): - if stat == Stat.FLAG_MOD: self.modified = True else: @@ -121,7 +120,6 @@ class Main: self.res_queue.task_done() def process(self): - self.res_queue = queue.Queue() # the todo queue is used to distribute the work diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..3c447fe --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,17 @@ +[project] +name = "chkbit" +version = "2.3.0" +description = "chkbit checks the data integrity of your files" +authors = [ + {name = "Christian Zangl", email = "laktak@cdak.net"}, +] +dependencies = [] +requires-python = ">=3.6.0" +readme = "README.md" +license = {file = "LICENSE"} + +[project.urls] +Homepage = "https://github.com/laktak/chkbit-py" + +[project.scripts] +chkbit = "chkbit.main:main" diff --git a/setup.py b/setup.py deleted file mode 100644 index 4281b6f..0000000 --- a/setup.py +++ /dev/null @@ -1,25 +0,0 @@ -import sys -from setuptools import setup -import os - -if sys.version_info < (3, 6): - sys.exit("Please install with Python >= 3.6") - -with open(os.path.join(os.path.dirname(__file__), "README.md"), encoding="utf-8") as f: - readme = f.read() - - -setup( - name="chkbit", - version="2.3.0", - url="https://github.com/laktak/chkbit-py", - author="Christian Zangl", - author_email="laktak@cdak.net", - description="chkbit checks the data integrity of your files", - long_description=readme, - long_description_content_type="text/markdown", - entry_points={"console_scripts": ["chkbit = chkbit.main:main"]}, - packages=["chkbit"], - install_requires=[], - python_requires=">=3.6.0", -)