Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get(cls, filename, tags=True, duration=True, image=False):
- parser_class = None
- size = os.path.getsize(filename)
- if not size > 0:
- return TinyTag(None, 0)
- if cls == TinyTag: # if `get` is invoked on TinyTag, find parser by ext
- parser_class = cls._get_parser_for_filename(filename, exception=True)
- else: # otherwise use the class on which `get` was invoked
- parser_class = cls
- with io.open(filename, 'rb') as af:
- tag = parser_class(af, size)
- tag.load(tags=tags, duration=duration, image=image)
- return tag
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement