Add path_edit.py to bazel BUILD
Add the path_edit tool to bazel. Abstract out the shared base_window
class used for path_edit and graph_edit.
Change-Id: I8c3d493cfa7fc954e39da82210cf1cb7ec880b13
diff --git a/y2018/control_loops/python/BUILD b/y2018/control_loops/python/BUILD
index d445f8a..4e18423 100644
--- a/y2018/control_loops/python/BUILD
+++ b/y2018/control_loops/python/BUILD
@@ -160,18 +160,32 @@
],
)
+py_library(
+ name = "basic_window",
+ srcs = [
+ "basic_window.py",
+ ],
+ restricted_to = ["//tools:k8"],
+ deps = [
+ ":python_init",
+ "@python_gtk",
+ ],
+)
+
py_binary(
name = "graph_edit",
srcs = [
- "basic_window.py",
"graph_edit.py",
"graph_generate.py",
],
default_python_version = "PY3",
legacy_create_init = False,
srcs_version = "PY3",
+ restricted_to = ["//tools:k8"],
deps = [
+ ":basic_window",
":python_init",
+ "@python_gtk",
],
)
@@ -189,6 +203,22 @@
],
)
+py_binary(
+ name = "path_edit",
+ srcs = [
+ "path_edit.py",
+ ],
+ default_python_version = "PY3",
+ legacy_create_init = False,
+ srcs_version = "PY3",
+ restricted_to = ["//tools:k8"],
+ deps = [
+ ":basic_window",
+ ":python_init",
+ "@python_gtk",
+ ],
+)
+
py_library(
name = "python_init",
srcs = ["__init__.py"],
diff --git a/y2018/control_loops/python/path_edit.py b/y2018/control_loops/python/path_edit.py
index 885b36c..ce2118a 100644
--- a/y2018/control_loops/python/path_edit.py
+++ b/y2018/control_loops/python/path_edit.py
@@ -1,3 +1,5 @@
+#!/usr/bin/python3
+
from __future__ import print_function
import os
import basic_window