mirror of
https://github.com/quantum5/win2xcur.git
synced 2025-08-04 00:58:53 -04:00
15 lines
403 B
Python
15 lines
403 B
Python
from typing import List, Type
|
|
|
|
from win2xcur.parser.ani import ANIParser
|
|
from win2xcur.parser.base import BaseParser
|
|
from win2xcur.parser.cur import CURParser
|
|
|
|
PARSERS: List[Type[BaseParser]] = [CURParser, ANIParser]
|
|
|
|
|
|
def open_blob(blob: bytes) -> BaseParser:
|
|
for parser in PARSERS:
|
|
if parser.can_parse(blob):
|
|
return parser(blob)
|
|
raise ValueError('Unsupported file format')
|