defining output_path for logs

This commit is contained in:
manetta 2021-02-01 11:26:25 +01:00
parent 20d9d16879
commit 1accd7d1c1

View File

@ -99,18 +99,20 @@ logbot @uptime: To check how long @logbot has been around
def group(self, message): def group(self, message):
# create a folder + database item # create a folder + database item
# for each of the rooms in which # for each of the rooms in which
# logbot is hanging around :) # logbot is hanging around :)
if not message.room in self.db.keys(): if not message.room in self.db.keys():
self.db[message.room] = {} self.db[message.room] = {}
self.db[message.room]['messages'] = {} self.db[message.room]['messages'] = {}
self.db[message.room]['title'] = message.room self.db[message.room]['title'] = message.room
if not os.path.isdir(message.room): output_path = os.path.join(server, message.room)
os.mkdir(message.room) if not os.path.isdir(output_path):
shutil.copy('stylesheet.css', message.room) os.mkdir(output_path)
print('This folder is created:', output_path)
shutil.copy('stylesheet.css', output_path)
else: else:
print('WARNING! This folder already exists:', message.room) print('WARNING! This folder already exists:', output_path)
# to debug in the terminal # to debug in the terminal
print('------------------') print('------------------')