add logging back

This commit is contained in:
brostos 2025-07-26 23:22:21 +03:00 committed by GitHub
parent 0f28579840
commit af508d4bdb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,8 +1,18 @@
plugman = dict(
version="1.2.0"
)
import ast
import json
import sys
from urllib.request import urlopen
DEBUG = True
def debug_print(*args, **kwargs):
if DEBUG:
print(*args, **kwargs)
def get_latest_version(plugin_name, category):
base_url = "https://github.com/bombsquad-community/plugin-manager/raw/main/"
@ -32,6 +42,7 @@ def get_latest_version(plugin_name, category):
latest_version = next(iter(plugin["versions"])) # Gets first key
return latest_version
except Exception as e:
raise e
@ -51,6 +62,7 @@ def update_plugman_json(version):
)
def update_plugin_json(plugin_info, category):
name = plugin_info["plugin_name"]
@ -90,6 +102,7 @@ def update_plugin_json(plugin_info, category):
def extract_plugman(plugins):
for plugin in plugins:
if "plugins/" in plugin:
debug_print(plugin)
try:
# Split the path and get the part after 'plugins/'
parts = plugin.split("plugins/")[1].split("/")