mirror of
https://github.com/TeamPGM/PagerMaid-Pyro.git
synced 2024-11-16 11:42:16 +00:00
🚑️ hotfix: install remote plugins
This commit is contained in:
parent
0c87310f77
commit
f19293ca12
@ -63,10 +63,11 @@ class RemotePlugin(LocalPlugin):
|
|||||||
supported: bool
|
supported: bool
|
||||||
des: str = ""
|
des: str = ""
|
||||||
des_short: str = ""
|
des_short: str = ""
|
||||||
|
remote_source: str
|
||||||
...
|
...
|
||||||
|
|
||||||
async def install(self) -> bool:
|
async def install(self) -> bool:
|
||||||
html = await client.get(f"{Config.GIT_SOURCE}{self.name}/main.py")
|
html = await client.get(f"{self.remote_source}{self.name}/main.py")
|
||||||
if html.status_code == 200:
|
if html.status_code == 200:
|
||||||
self.remove()
|
self.remove()
|
||||||
with open(plugins_path / f"{self.name}.py", mode="wb") as f:
|
with open(plugins_path / f"{self.name}.py", mode="wb") as f:
|
||||||
@ -221,7 +222,7 @@ class PluginManager:
|
|||||||
self.remote_manager.enable_remote(remote)
|
self.remote_manager.enable_remote(remote)
|
||||||
for plugin in plugin_list:
|
for plugin in plugin_list:
|
||||||
try:
|
try:
|
||||||
plugin_model = RemotePlugin(**plugin, status=False)
|
plugin_model = RemotePlugin(**plugin, status=False, remote_source=remote)
|
||||||
if plugin_model.name in plugins_name:
|
if plugin_model.name in plugins_name:
|
||||||
continue
|
continue
|
||||||
plugins.append(plugin_model)
|
plugins.append(plugin_model)
|
||||||
|
Loading…
Reference in New Issue
Block a user