[base] Little mise a jour
This commit is contained in:
parent
5612fac842
commit
6d3944b76a
2
main.py
2
main.py
@ -74,6 +74,7 @@ class Module:
|
|||||||
return False
|
return False
|
||||||
with open(os.path.join("modules", self.name, "version.json")) as file:
|
with open(os.path.join("modules", self.name, "version.json")) as file:
|
||||||
versions = json.load(file)
|
versions = json.load(file)
|
||||||
|
print(versions)
|
||||||
if "version" not in versions.keys():
|
if "version" not in versions.keys():
|
||||||
return False
|
return False
|
||||||
if "dependencies" not in versions.keys():
|
if "dependencies" not in versions.keys():
|
||||||
@ -275,7 +276,6 @@ class LBI(discord.Client):
|
|||||||
if dep not in self.modules.keys():
|
if dep not in self.modules.keys():
|
||||||
if dep != "base":
|
if dep != "base":
|
||||||
self.load_module(dep)
|
self.load_module(dep)
|
||||||
|
|
||||||
if MODULES[module].type == "python":
|
if MODULES[module].type == "python":
|
||||||
try:
|
try:
|
||||||
self.info("Start loading module {module}...".format(module=module))
|
self.info("Start loading module {module}...".format(module=module))
|
||||||
|
@ -181,3 +181,6 @@ class BaseClass:
|
|||||||
else:
|
else:
|
||||||
# Run event
|
# Run event
|
||||||
asyncio.ensure_future(self.client._run_event(coro, method, *args, **kwargs), loop=self.client.loop)
|
asyncio.ensure_future(self.client._run_event(coro, method, *args, **kwargs), loop=self.client.loop)
|
||||||
|
|
||||||
|
async def on_error(self, event_method, *args, **kwargs):
|
||||||
|
pass
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
import os
|
import os
|
||||||
|
import shutil
|
||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import aiofiles
|
import aiofiles
|
||||||
import zipfile
|
import zipfile
|
||||||
|
|
||||||
class Api:
|
class Api:
|
||||||
def __init__(self, host="localhost:8000"):
|
def __init__(self, host="localhost:5000"):
|
||||||
self.host = host
|
self.host = host
|
||||||
self.basepath = "http://"+host+"/api/current"
|
self.basepath = "http://"+host+"/api/current"
|
||||||
|
|
||||||
@ -30,6 +31,6 @@ class Api:
|
|||||||
|
|
||||||
async def download(self, module, version):
|
async def download(self, module, version):
|
||||||
await self._download("modules/"+module+"/"+version, filename="temp.zip")
|
await self._download("modules/"+module+"/"+version, filename="temp.zip")
|
||||||
|
shutil.rmtree(os.path.join("modules, module"))
|
||||||
with zipfile.ZipFile('temp.zip', "r") as z:
|
with zipfile.ZipFile('temp.zip', "r") as z:
|
||||||
z.extractall(os.path.join("modules", module))
|
z.extractall(os.path.join("modules", module))
|
||||||
#78.200.118.13:8000
|
|
Loading…
Reference in New Issue
Block a user