python-lottie  0.6.10+dev4166086
A framework to work with lottie files and telegram animated stickers (tgs)
__init__.py
Go to the documentation of this file.
1 import os
2 import subprocess
3 from . import objects, parsers, utils, exporters, nvector, importers
4 from .nvector import *
5 from .utils.color import Color
6 
7 try:
8  from .version import __version__
9 except ImportError:
10  here = os.path.dirname(os.path.abspath(__file__))
11  pipe = subprocess.Popen(
12  ['git', 'describe', '--abbrev=0', '--tags'],
13  cwd=here,
14  stderr=subprocess.DEVNULL,
15  stdout=subprocess.PIPE
16  )
17  out, err = pipe.communicate()
18  if pipe.returncode == 0:
19  __version__ = out.strip()[1:].decode("ascii") + "+git"
20  else:
21  vfn = os.path.join(os.path.dirname(os.path.dirname(here)), "version")
22  if os.path.exists(vfn):
23  with open(vfn) as vf:
24  __version__ = vf.read().strip() + "+src"
25  else:
26  __version__ = "unknown"
27 
28 try:
29  version_tuple = tuple(map(int, __version__.split("+")[0].split("."))) if __version__ != "unknown" else (0, 0, 0)
30 except ValueError:
31  version_tuple = (0, 0, 0)
32  __version__ = "unknown"
33 
34 
35 __all__ = ["objects", "parsers", "utils", "exporters", "nvector", "NVector", "Point", "Color", "importers"]