-
Notifications
You must be signed in to change notification settings - Fork 75
/
fw_build_id.py
35 lines (27 loc) · 975 Bytes
/
fw_build_id.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#
# Copyright (c) Memfault, Inc.
# See LICENSE for details
#
"""
Shim around mflt_build_id to keep the original fw_build_id.py file (this file) working as before.
See mflt-build-id/src/mflt_build_id/__init__.py for actual source code.
"""
import os
import sys
scripts_dir = os.path.dirname(os.path.realpath(__file__))
bundled_mflt_build_id_src_dir = os.path.join(scripts_dir, "mflt-build-id", "src")
internal_mflt_build_id_src_dir = os.path.join(
os.path.dirname(os.path.dirname(os.path.dirname(scripts_dir))),
"py-packages",
"mflt-build-id",
"src",
)
if os.path.exists(bundled_mflt_build_id_src_dir):
# Released SDK:
sys.path.insert(0, bundled_mflt_build_id_src_dir)
if os.path.isdir(internal_mflt_build_id_src_dir):
sys.path.append(internal_mflt_build_id_src_dir)
from mflt_build_id import * # noqa: E402, F403 # pyright: ignore[reportWildcardImportFromLibrary]
if __name__ == "__main__":
from mflt_build_id import main
main()