Une autre partie
This commit is contained in:
parent
9a1e95cd5a
commit
bc213e65f0
5
.gitignore
vendored
5
.gitignore
vendored
@ -63,3 +63,8 @@ target/
|
|||||||
.*.kate-swp
|
.*.kate-swp
|
||||||
.swp.*
|
.swp.*
|
||||||
|
|
||||||
|
temp.zip
|
||||||
|
storage/*
|
||||||
|
config/*
|
||||||
|
.idea/*
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ import os
|
|||||||
import discord
|
import discord
|
||||||
|
|
||||||
from modules.base import BaseClass
|
from modules.base import BaseClass
|
||||||
|
from modules.modules.api import Api
|
||||||
|
|
||||||
|
|
||||||
class MainClass(BaseClass):
|
class MainClass(BaseClass):
|
||||||
@ -25,6 +25,7 @@ class MainClass(BaseClass):
|
|||||||
def __init__(self, client):
|
def __init__(self, client):
|
||||||
super().__init__(client)
|
super().__init__(client)
|
||||||
self.storage.mkdir("modules")
|
self.storage.mkdir("modules")
|
||||||
|
self.api = Api()
|
||||||
|
|
||||||
def get_all_modules(self):
|
def get_all_modules(self):
|
||||||
all_items = os.listdir("modules")
|
all_items = os.listdir("modules")
|
||||||
@ -112,4 +113,8 @@ class MainClass(BaseClass):
|
|||||||
await message.channel.send(embed=embed)
|
await message.channel.send(embed=embed)
|
||||||
|
|
||||||
async def com_web_list(self, message, args, kwargs):
|
async def com_web_list(self, message, args, kwargs):
|
||||||
pass
|
modules = self.api.list()
|
||||||
|
text = ""
|
||||||
|
for module, versions in modules.items():
|
||||||
|
text += module + " - " + ", ".join(versions)
|
||||||
|
await message.channel.send(text)
|
||||||
|
@ -5,7 +5,7 @@ import aiofiles
|
|||||||
import zipfile
|
import zipfile
|
||||||
|
|
||||||
class Api:
|
class Api:
|
||||||
def __init__(self, host):
|
def __init__(self, host="localhost:8000"):
|
||||||
self.host = host
|
self.host = host
|
||||||
self.basepath = "http://"+host+"/api/current"
|
self.basepath = "http://"+host+"/api/current"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user