You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
565 B
20 lines
565 B
import os
|
|
import capnp
|
|
|
|
CEREAL_PATH = os.path.dirname(os.path.abspath(__file__))
|
|
capnp.remove_import_hook()
|
|
|
|
if os.getenv("NEWCAPNP"):
|
|
import tempfile
|
|
import pyximport
|
|
|
|
importers = pyximport.install(build_dir=os.path.join(tempfile.gettempdir(), ".pyxbld"))
|
|
try:
|
|
import cereal.gen.cython.log_capnp_cython as log
|
|
import cereal.gen.cython.car_capnp_cython as car
|
|
finally:
|
|
pyximport.uninstall(*importers)
|
|
del importers
|
|
else:
|
|
log = capnp.load(os.path.join(CEREAL_PATH, "log.capnp"))
|
|
car = capnp.load(os.path.join(CEREAL_PATH, "car.capnp"))
|
|
|