Ejemplo n.º 1
0
def is_archive(file):
    path = PurePath(file)
    file_format = PurePath.suffix(path)[1:]
    supported_filetype = ['.zip', '.rar', '.7zip']

    for type_ in supported_filetype:
        if type_ == file_format:
            return True
    else:
        return False
Ejemplo n.º 2
0
def is_image(file):
    path = PurePath(file)
    file_format = PurePath.suffix(path)[1:]
    supported_filetype = ['.jpg', '.png']

    for type_ in supported_filetype:
        if type_ == file_format:
            return True
    else:
        return False