remove git

This commit is contained in:
JJTech0130 2023-08-27 20:42:42 -04:00
parent 769332f5fa
commit 3500879256
No known key found for this signature in database
GPG key ID: 23C92EBCCF8F93D6

15
demo.py
View file

@ -5,7 +5,6 @@ import threading
import time import time
from base64 import b64decode, b64encode from base64 import b64decode, b64encode
from getpass import getpass from getpass import getpass
from subprocess import PIPE, Popen
from rich.logging import RichHandler from rich.logging import RichHandler
@ -34,11 +33,6 @@ logging.getLogger("imessage").setLevel(logging.INFO)
logging.captureWarnings(True) logging.captureWarnings(True)
process = Popen(["git", "rev-parse", "HEAD"], stdout=PIPE) # type: ignore
(commit_hash, err) = process.communicate()
exit_code = process.wait()
commit_hash = commit_hash.decode().strip()
# Try and load config.json # Try and load config.json
try: try:
with open("config.json", "r") as f: with open("config.json", "r") as f:
@ -46,15 +40,6 @@ try:
except FileNotFoundError: except FileNotFoundError:
CONFIG = {} CONFIG = {}
# Re-register if the commit hash has changed
FORCE_REREGISTER = True
if CONFIG.get("commit_hash") != commit_hash or FORCE_REREGISTER:
logging.warning("pypush commit is different, forcing re-registration...")
CONFIG["commit_hash"] = commit_hash
if "id" in CONFIG:
del CONFIG["id"]
def safe_b64decode(s): def safe_b64decode(s):
try: try:
return b64decode(s) return b64decode(s)