From 1accd7d1c1191894b40b49c74ae0b165f3122016 Mon Sep 17 00:00:00 2001 From: manetta Date: Mon, 1 Feb 2021 11:26:25 +0100 Subject: [PATCH] defining output_path for logs --- LogBot/logbot.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/LogBot/logbot.py b/LogBot/logbot.py index 5e16cf7..c41c6cb 100644 --- a/LogBot/logbot.py +++ b/LogBot/logbot.py @@ -99,18 +99,20 @@ logbot @uptime: To check how long @logbot has been around def group(self, message): - # create a folder + database item - # for each of the rooms in which + # create a folder + database item + # for each of the rooms in which # logbot is hanging around :) if not message.room in self.db.keys(): self.db[message.room] = {} self.db[message.room]['messages'] = {} self.db[message.room]['title'] = message.room - if not os.path.isdir(message.room): - os.mkdir(message.room) - shutil.copy('stylesheet.css', message.room) + output_path = os.path.join(server, message.room) + if not os.path.isdir(output_path): + os.mkdir(output_path) + print('This folder is created:', output_path) + shutil.copy('stylesheet.css', output_path) else: - print('WARNING! This folder already exists:', message.room) + print('WARNING! This folder already exists:', output_path) # to debug in the terminal print('------------------')