Browse Source

adding full paths to foldernames

master
manetta 4 years ago
parent
commit
ef58cd2f18
  1. 16
      LogBot/logbot.py

16
LogBot/logbot.py

@ -238,13 +238,15 @@ class Logbot(Bot):
# https://git.vvvvvvaria.org/varia/bots/issues/5 # https://git.vvvvvvaria.org/varia/bots/issues/5
elif "@folder" in message.text: elif "@folder" in message.text:
match = re.findall("@folder .*", message.content)[0] match = re.findall("@folder .*", message.content)[0]
newfoldername = match.replace("@folder ", "") new_folder_name = match.replace("@folder ", "")
currentfoldername = self.db[message.room]["folder"] current_folder_name = self.db[message.room]["folder"]
if "@" in currentfoldername: # hacky if "@" in current_folder_name: # hacky
currentfoldername = self._parse_room_name(currentfoldername) current_folder_name = self._parse_room_name(current_folder_name)
os.rename(currentfoldername, newfoldername) current_folder_name_path = os.path.join(self.output, current_folder_name)
self.db[message.room]["folder"] = newfoldername new_folder_name_path = os.path.join(self.output, new_folder_name)
reply = f"The foldername of the log is changed to: { newfoldername }. The URL of the log changed into: https://vvvvvvaria.org/logs/{ newfoldername}" os.rename(current_folder_name_path, new_folder_name_path)
self.db[message.room]["folder"] = new_folder_name
reply = f"The foldername of the log is changed to: { new_folder_name }. The URL of the log changed into: https://vvvvvvaria.org/logs/{ new_folder_name}"
# Response to @style # Response to @style
elif "@style" in message.text: elif "@style" in message.text:

Loading…
Cancel
Save