mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-10-08 14:54:36 +00:00
add logging back
This commit is contained in:
parent
0f28579840
commit
af508d4bdb
1 changed files with 22 additions and 9 deletions
|
|
@ -1,8 +1,18 @@
|
||||||
|
plugman = dict(
|
||||||
|
version="1.2.0"
|
||||||
|
)
|
||||||
|
|
||||||
import ast
|
import ast
|
||||||
import json
|
import json
|
||||||
import sys
|
import sys
|
||||||
from urllib.request import urlopen
|
from urllib.request import urlopen
|
||||||
|
|
||||||
|
DEBUG = True
|
||||||
|
def debug_print(*args, **kwargs):
|
||||||
|
if DEBUG:
|
||||||
|
print(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def get_latest_version(plugin_name, category):
|
def get_latest_version(plugin_name, category):
|
||||||
base_url = "https://github.com/bombsquad-community/plugin-manager/raw/main/"
|
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
|
latest_version = next(iter(plugin["versions"])) # Gets first key
|
||||||
return latest_version
|
return latest_version
|
||||||
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
|
|
@ -51,6 +62,7 @@ def update_plugman_json(version):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def update_plugin_json(plugin_info, category):
|
def update_plugin_json(plugin_info, category):
|
||||||
name = plugin_info["plugin_name"]
|
name = plugin_info["plugin_name"]
|
||||||
|
|
||||||
|
|
@ -90,6 +102,7 @@ def update_plugin_json(plugin_info, category):
|
||||||
def extract_plugman(plugins):
|
def extract_plugman(plugins):
|
||||||
for plugin in plugins:
|
for plugin in plugins:
|
||||||
if "plugins/" in plugin:
|
if "plugins/" in plugin:
|
||||||
|
debug_print(plugin)
|
||||||
try:
|
try:
|
||||||
# Split the path and get the part after 'plugins/'
|
# Split the path and get the part after 'plugins/'
|
||||||
parts = plugin.split("plugins/")[1].split("/")
|
parts = plugin.split("plugins/")[1].split("/")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue