aboutsummaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2016-08-07 22:20:45 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2016-08-07 22:21:31 +0200
commitfd0e6e3aa0e7523a36011a2f0264737772aa5e24 (patch)
tree9ada25e6f4d072e2fc01ca62120cc416af8fc716 /cli
parent535d856a39b177642724bcfe6009985bf4262dbd (diff)
downloadkicad-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 'cli')
-rw-r--r--cli/generate-header.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/cli/generate-header.cpp b/cli/generate-header.cpp
index 9d5a4f4..3ff39f6 100644
--- a/cli/generate-header.cpp
+++ b/cli/generate-header.cpp
@@ -1,4 +1,4 @@
-#include "trygvis/kicad.h"
+#include "trygvis/kicad/netlist.h"
using namespace trygvis::kicad;
using trygvis::kicad::netlist::component;
@@ -172,7 +172,7 @@ public:
python_init_error(const string &what) : runtime_error(what) {}
};
- python_init(const char *argv0, const vector<fs::path> &python_paths) {
+ python_init(bool debug, const char *argv0, const vector<fs::path> &python_paths) {
std::wstring_convert<codecvt_utf8<wchar_t>> converter;
wstring pythonpath(Py_GetPath());
@@ -182,7 +182,10 @@ public:
}
pythonpath = converter.from_bytes(path.string() + PATH_SEPARATOR) + pythonpath;
}
- wcerr << "PYTHONPATH: " << pythonpath << endl;
+
+ if (debug) {
+ wcerr << "PYTHONPATH: " << pythonpath << endl;
+ }
Py_SetPath(pythonpath.c_str());
program = Py_DecodeLocale(argv0, NULL);
@@ -191,7 +194,9 @@ public:
}
Py_SetProgramName(program);
- show_py_info();
+ if (debug) {
+ show_py_info();
+ }
Py_Initialize();
}
@@ -246,7 +251,7 @@ int main(int argc, char **argv) {
basedir / "lib",
};
- python_init python(argv[0], module_paths);
+ python_init python(opts.debug, argv[0], module_paths);
try {
auto ok = generate(opts.ref, &netlist, out, py_template.value());