diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2016-08-07 22:20:45 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2016-08-07 22:21:31 +0200 |
commit | fd0e6e3aa0e7523a36011a2f0264737772aa5e24 (patch) | |
tree | 9ada25e6f4d072e2fc01ca62120cc416af8fc716 /python | |
parent | 535d856a39b177642724bcfe6009985bf4262dbd (diff) | |
download | kicad-utils-fd0e6e3aa0e7523a36011a2f0264737772aa5e24.tar.gz kicad-utils-fd0e6e3aa0e7523a36011a2f0264737772aa5e24.tar.bz2 kicad-utils-fd0e6e3aa0e7523a36011a2f0264737772aa5e24.tar.xz kicad-utils-fd0e6e3aa0e7523a36011a2f0264737772aa5e24.zip |
templates: nodemcu-arduino: NodeMCU with Arduino.
o Moving headers so they match the namespace they declare.
o Reducing debug logging.
Diffstat (limited to 'python')
-rw-r--r-- | python/include/trygvis/kicad/GenerateHeaderPy.h | 2 | ||||
-rw-r--r-- | python/kicad_utils_py.cpp | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/python/include/trygvis/kicad/GenerateHeaderPy.h b/python/include/trygvis/kicad/GenerateHeaderPy.h index 893b7ed..9e831e9 100644 --- a/python/include/trygvis/kicad/GenerateHeaderPy.h +++ b/python/include/trygvis/kicad/GenerateHeaderPy.h @@ -1,7 +1,7 @@ #ifndef KICAD_UTILS_GENERATEHEADEPY_H #define KICAD_UTILS_GENERATEHEADEPY_H -#include "trygvis/kicad.h" +#include "trygvis/kicad/netlist.h" #include "pybind11/pybind11.h" #include <memory> #include <sstream> diff --git a/python/kicad_utils_py.cpp b/python/kicad_utils_py.cpp index 6cd3948..8cb91ee 100644 --- a/python/kicad_utils_py.cpp +++ b/python/kicad_utils_py.cpp @@ -6,6 +6,11 @@ using namespace std; using namespace trygvis::kicad::netlist; using namespace trygvis::kicad::python; +static +py::object net_name(const net &n) { + return n.name ? static_cast<py::object>(py::str(n.name.value())) : py::none(); +} + void init_module(py::module &m) { py::class_<node>(m, "node"). def_readonly("ref", &node::ref). @@ -13,12 +18,12 @@ void init_module(py::module &m) { py::class_<net>(m, "net"). def_readonly("code", &net::code). - def_readonly("name", &net::name). + def_property_readonly("name", &net_name). def_readonly("nodes", &net::nodes). def("node_for_ref", &net::node_for_ref, py::return_value_policy::reference); py::class_<nl>(m, "netlist"). - def("find_usages_of", &nl::find_usage_of, py::return_value_policy::reference); + def("find_nets_using_ref", &nl::find_nets_using_ref, py::return_value_policy::reference); py::class_<GenerateHeaderPy>(m, "GenerateHeader"). def(py::init<const string &, nl *>()). |