Skip to content

Commit

Permalink
Merge pull request #3 from JoshuaVandaele/fstrings_fix
Browse files Browse the repository at this point in the history
Fstrings fix
  • Loading branch information
JoshuaVandaele authored Feb 7, 2024
2 parents e32f34f + 55f3fdf commit 01f415b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
21 changes: 11 additions & 10 deletions modules/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
import os
import re
import shutil
import tomllib
import traceback
import uuid

import requests
import tomllib
from bs4 import BeautifulSoup, Tag
from tqdm import tqdm

from pgpy import PGPKey, PGPSignature
from tqdm import tqdm

READ_CHUNK_SIZE = 524288

Expand Down Expand Up @@ -88,7 +87,7 @@ def md5_hash_check(file: str, hash: str) -> bool:
result = hash.lower() == file_hash.hexdigest()

logging.debug(
f"[md5_hash_check] {os.path.abspath(file)}: `{hash.lower()}` is{"" if result else "n't"} equal to file hash `{file_hash.hexdigest()}`"
f"[md5_hash_check] {os.path.abspath(file)}: `{hash.lower()}` is {'' if result else 'not'} equal to file hash `{file_hash.hexdigest()}`"
)
return result

Expand All @@ -111,7 +110,7 @@ def sha1_hash_check(file: str, hash: str) -> bool:
result = hash.lower() == file_hash.hexdigest()

logging.debug(
f"[sha1_hash_check] {os.path.abspath(file)}: `{hash.lower()}` is{"" if result else "n't"} equal to file hash `{file_hash.hexdigest()}`"
f"[sha1_hash_check] {os.path.abspath(file)}: `{hash.lower()}` is {'' if result else 'not'} equal to file hash `{file_hash.hexdigest()}`"
)
return result

Expand All @@ -134,7 +133,7 @@ def sha256_hash_check(file: str, hash: str) -> bool:
result = hash.lower() == file_hash.hexdigest()

logging.debug(
f"[sha256_hash_check] {os.path.abspath(file)}: `{hash.lower()}` is{"" if result else "n't"} equal to file hash `{file_hash.hexdigest()}`"
f"[sha256_hash_check] {os.path.abspath(file)}: `{hash.lower()}` is {'' if result else 'not'} equal to file hash `{file_hash.hexdigest()}`"
)
return result

Expand All @@ -157,7 +156,7 @@ def sha512_hash_check(file: str, hash: str) -> bool:
result = hash.lower() == file_hash.hexdigest()

logging.debug(
f"[sha512_hash_check] {os.path.abspath(file)}: `{hash.lower()}` is{"" if result else "n't"} equal to file hash `{file_hash.hexdigest()}`"
f"[sha512_hash_check] {os.path.abspath(file)}: `{hash.lower()}` is {'' if result else 'not'} equal to file hash `{file_hash.hexdigest()}`"
)
return result

Expand Down Expand Up @@ -193,10 +192,12 @@ def pgp_check(file_path: str, signature: str | bytes, public_key: str | bytes) -

with open(file_path, "rb") as f:
file_content = f.read()

result = bool(pub_key.verify(file_content, sig))

print(f"[pgp_check] {os.path.abspath(file_path)}: Signature is{'' if result else "n't"} valid")

print(
f"[pgp_check] {os.path.abspath(file_path)}: Signature is {'' if result else 'not'} valid"
)

return result

Expand Down
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@
https://raw.githubusercontent.com/pypa/sampleproject/db5806e0a3204034c51b1c00dde7d5eb3fa2532e/setup.py
"""

# Always prefer setuptools over distutils
from setuptools import setup, find_packages
import pathlib

# Always prefer setuptools over distutils
from setuptools import find_packages, setup

here = pathlib.Path(__file__).parent.resolve()

# Get the long description from the README file
long_description = (here / "README.md").read_text(encoding="utf-8")

setup(
name="sisou", # Required
version="1.1.2", # Required
version="1.1.3", # Required
description="A powerful tool to conveniently update all of your ISO files!", # Optional
long_description=long_description, # Optional
long_description_content_type="text/markdown", # Optional
Expand Down

0 comments on commit 01f415b

Please sign in to comment.