Browse Source

defining output_path for logs

master
manetta 4 years ago
parent
commit
1accd7d1c1
  1. 14
      LogBot/logbot.py

14
LogBot/logbot.py

@ -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('------------------')

Loading…
Cancel
Save