Create C++ -> Python interface for calling LogReader
This provides an interface that allows the user to extract json data
from the logfiles directly into Python.
Change-Id: Iafd1e4ac2301befe1f8939b396d6e40a3133b2a2
diff --git a/frc971/analysis/BUILD b/frc971/analysis/BUILD
index b45031f..b526712 100644
--- a/frc971/analysis/BUILD
+++ b/frc971/analysis/BUILD
@@ -21,3 +21,30 @@
srcs = ["__init__.py"],
deps = ["//frc971:python_init"],
)
+
+cc_binary(
+ name = "py_log_reader.so",
+ srcs = ["py_log_reader.cc"],
+ linkshared = True,
+ restricted_to = ["//tools:k8"],
+ deps = [
+ "//aos:configuration",
+ "//aos:json_to_flatbuffer",
+ "//aos/events:shm_event_loop",
+ "//aos/events:simulated_event_loop",
+ "//aos/events/logging:logger",
+ "@com_github_google_glog//:glog",
+ "@python_repo//:python3.5_lib",
+ ],
+)
+
+py_test(
+ name = "log_reader_test",
+ srcs = ["log_reader_test.py"],
+ data = [
+ ":py_log_reader.so",
+ "@sample_logfile//file",
+ ],
+ restricted_to = ["//tools:k8"],
+ deps = ["//aos:configuration_fbs_python"],
+)