def _is_valid(self, *args, **kwargs): from sys import version # a valid artio header file starts with a prefix and ends with .art if not args[0].endswith(".art"): return False if version < '3': return artio_is_valid(args[0][:-4]) else: return artio_is_valid(bytes(args[0][:-4], 'utf-8'))
def _is_valid(cls, filename, *args, **kwargs): from sys import version # a valid artio header file starts with a prefix and ends with .art if not filename.endswith(".art"): return False if version < "3": return artio_is_valid(filename[:-4]) else: return artio_is_valid(bytes(filename[:-4], "utf-8"))
def _is_valid(cls, filename, *args, **kwargs): # a valid artio header file starts with a prefix and ends with .art name, _, ext = filename.rpartition(".") if ext != "art": return False return artio_is_valid(bytes(name, "utf-8"))