[base] Suppression des prints

This commit is contained in:
Fomys 2019-08-10 10:03:59 +02:00
parent 55f1170405
commit 01d0607435
Signed by: fomys
GPG Key ID: 1ECA046A9615ABA0
4 changed files with 4 additions and 20 deletions

View File

@ -428,7 +428,6 @@ class Communication(asyncio.Protocol):
name = "Communication"
def __init__(self, client=client1):
print("créé")
self.client = client
self.transport = None
@ -452,12 +451,6 @@ communication = Communication(client1)
async def start_bot():
await client1.start(os.environ.get("DISCORD_TOKEN"), max_messages=500000)
def execption_handler(loop, context):
print('%s: %s' % ('Connection', context['exception']))
traceback.print_exc()
print(os.path.join("/tmp", os.path.dirname(os.path.realpath(__file__))) + ".sock")
loop = asyncio.get_event_loop()

View File

@ -183,8 +183,3 @@ 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):
# Basic error handler
print('Ignoring exception in {}'.format(event_method), file=sys.stderr)
traceback.print_exc()

View File

@ -39,7 +39,6 @@ class BaseClassLua(BaseClass):
super().__init__(client)
# Get lua globals
self.lua = lupa.LuaRuntime(unpack_returned_tuples=True)
print(os.path.abspath(path))
self.luaMethods = self.lua.require(path)
def call(self, method, *args, **kwargs):

View File

@ -58,10 +58,9 @@ class MainClass(BaseClassPython):
return
for arg in args:
e = self.client.load_module(arg)
print(e)
if e:
await message.channel.send("An error occurred during the loading of the module {module}."
.format(module=arg))
await message.channel.send("An error occurred during the loading of the module {module}: {error}."
.format(module=arg, error=e))
await self.com_list(message, args, kwargs)
async def com_reload(self, message, args, kwargs):
@ -78,7 +77,6 @@ class MainClass(BaseClassPython):
await self.com_list(message, args, kwargs)
return
for arg in args:
print(arg)
e = self.client.unload_module(arg)
if e:
await message.channel.send("An error occurred during the loading of the module {module}."
@ -99,11 +97,10 @@ class MainClass(BaseClassPython):
await self.com_list(message, args, kwargs)
return
for arg in args:
print(arg)
e = self.client.unload_module(arg)
if e:
await message.channel.send("An error occurred during the loading of the module {module}."
.format(module=arg))
await message.channel.send("An error occurred during the loading of the module {module}: {error}."
.format(module=arg, error=e))
await self.com_list(message, [], [])
async def com_list(self, message, args, kwargs):