class FileNotExistInDatabase(Exception):
"""
Исключение: файл не найден в бд
"""
def __init__ (self, *args):
if args:
self.message = args[0]
else:
self.message = None
def __str__ (self):
if self.message:
return f"FileNotExistInDatabase , {self.message}"
else:
return "FileNotExistInDatabase, has been raised"
class MergeFilesError(Exception):
"""
Исключение: ошибка при слиянии файлов
"""
def __init__ (self, *args):
if args:
self.message = args[0]
else:
self.message = None
def __str__ (self):
if self.message:
return f"MergeFilesError, {self.message}"
else:
return "MergeFilesError, has been raised"
Y2xhc3MgRmlsZU5vdEV4aXN0SW5EYXRhYmFzZShFeGNlcHRpb24pOgogICAgIiIiCiAgICAgICAg0JjRgdC60LvRjtGH0LXQvdC40LU6INGE0LDQudC7INC90LUg0L3QsNC50LTQtdC9INCyINCx0LQKICAgICIiIgogICAgZGVmIF9faW5pdF9fIChzZWxmLCAqYXJncyk6CiAgICAgICAgaWYgYXJnczoKICAgICAgICAgICAgc2VsZi5tZXNzYWdlID0gYXJnc1swXQogICAgICAgIGVsc2U6CiAgICAgICAgICAgIHNlbGYubWVzc2FnZSA9IE5vbmUKCiAgICBkZWYgX19zdHJfXyAoc2VsZik6CiAgICAgICAgaWYgc2VsZi5tZXNzYWdlOgogICAgICAgICAgICByZXR1cm4gZiJGaWxlTm90RXhpc3RJbkRhdGFiYXNlICwge3NlbGYubWVzc2FnZX0iCiAgICAgICAgZWxzZToKICAgICAgICAgICAgcmV0dXJuICJGaWxlTm90RXhpc3RJbkRhdGFiYXNlLCBoYXMgYmVlbiByYWlzZWQiCgpjbGFzcyBNZXJnZUZpbGVzRXJyb3IoRXhjZXB0aW9uKToKICAgICIiIgogICAgICAgINCY0YHQutC70Y7Rh9C10L3QuNC1OiDQvtGI0LjQsdC60LAg0L/RgNC4INGB0LvQuNGP0L3QuNC4INGE0LDQudC70L7QsgogICAgIiIiCiAgICBkZWYgX19pbml0X18gKHNlbGYsICphcmdzKToKICAgICAgICBpZiBhcmdzOgogICAgICAgICAgICBzZWxmLm1lc3NhZ2UgPSBhcmdzWzBdCiAgICAgICAgZWxzZToKICAgICAgICAgICAgc2VsZi5tZXNzYWdlID0gTm9uZQoKICAgIGRlZiBfX3N0cl9fIChzZWxmKToKICAgICAgICBpZiBzZWxmLm1lc3NhZ2U6CiAgICAgICAgICAgIHJldHVybiBmIk1lcmdlRmlsZXNFcnJvciwge3NlbGYubWVzc2FnZX0iCiAgICAgICAgZWxzZToKICAgICAgICAgICAgcmV0dXJuICJNZXJnZUZpbGVzRXJyb3IsIGhhcyBiZWVuIHJhaXNlZCI=