From 6d3944b76a4883fa90d736c18ba3d70192cf1f78 Mon Sep 17 00:00:00 2001 From: Fomys Date: Sun, 11 Aug 2019 18:07:58 +0200 Subject: [PATCH] [base] Little mise a jour --- main.py | 2 +- modules/base/Base.py | 3 +++ modules/modules/api.py | 5 +++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 88bc0bf..f50fcb2 100644 --- a/main.py +++ b/main.py @@ -74,6 +74,7 @@ class Module: return False with open(os.path.join("modules", self.name, "version.json")) as file: versions = json.load(file) + print(versions) if "version" not in versions.keys(): return False if "dependencies" not in versions.keys(): @@ -275,7 +276,6 @@ class LBI(discord.Client): if dep not in self.modules.keys(): if dep != "base": self.load_module(dep) - if MODULES[module].type == "python": try: self.info("Start loading module {module}...".format(module=module)) diff --git a/modules/base/Base.py b/modules/base/Base.py index f099d0f..fd72e52 100644 --- a/modules/base/Base.py +++ b/modules/base/Base.py @@ -181,3 +181,6 @@ class BaseClass: else: # Run event 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 diff --git a/modules/modules/api.py b/modules/modules/api.py index 786c2e4..4726f03 100644 --- a/modules/modules/api.py +++ b/modules/modules/api.py @@ -1,11 +1,12 @@ import os +import shutil import aiohttp import aiofiles import zipfile class Api: - def __init__(self, host="localhost:8000"): + def __init__(self, host="localhost:5000"): self.host = host self.basepath = "http://"+host+"/api/current" @@ -30,6 +31,6 @@ class Api: async def download(self, module, version): await self._download("modules/"+module+"/"+version, filename="temp.zip") + shutil.rmtree(os.path.join("modules, module")) with zipfile.ZipFile('temp.zip', "r") as z: z.extractall(os.path.join("modules", module)) -#78.200.118.13:8000 \ No newline at end of file