File indexing completed on 2025-01-19 03:59:55

0001 import os
0002 import subprocess
0003 from . import objects, parsers, utils, exporters, nvector, importers
0004 from .nvector import *
0005 from .utils.color import Color
0006 
0007 try:
0008     from .version import __version__
0009 except ImportError:
0010     here = os.path.dirname(os.path.abspath(__file__))
0011     pipe = subprocess.Popen(
0012         ['git', 'describe', '--abbrev=0', '--tags'],
0013         cwd=here,
0014         stderr=subprocess.DEVNULL,
0015         stdout=subprocess.PIPE
0016     )
0017     out, err = pipe.communicate()
0018     if pipe.returncode == 0:
0019         __version__ = out.strip()[1:].decode("ascii") + "+git"
0020     else:
0021         vfn = os.path.join(os.path.dirname(os.path.dirname(here)), "version")
0022         if os.path.exists(vfn):
0023             with open(vfn) as vf:
0024                 __version__ = vf.read().strip() + "+src"
0025         else:
0026             __version__ = "unknown"
0027 
0028 try:
0029     version_tuple = tuple(map(int, __version__.split("+")[0].split("."))) if __version__ != "unknown" else (0, 0, 0)
0030 except ValueError:
0031     version_tuple = (0, 0, 0)
0032     __version__ = "unknown"
0033 
0034 
0035 __all__ = ["objects", "parsers", "utils", "exporters", "nvector", "NVector", "Point", "Color", "importers"]