From fd0e6e3aa0e7523a36011a2f0264737772aa5e24 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 7 Aug 2016 22:20:45 +0200 Subject: templates: nodemcu-arduino: NodeMCU with Arduino. o Moving headers so they match the namespace they declare. o Reducing debug logging. --- cli/generate-header.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'cli') 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 &python_paths) { + python_init(bool debug, const char *argv0, const vector &python_paths) { std::wstring_convert> 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()); -- cgit v1.2.3