Skip to content

Commit

Permalink
Remove debug mess.
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Jul 29, 2019
1 parent 7c4a0f4 commit 795301e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 21 deletions.
10 changes: 1 addition & 9 deletions plugins/python/filters/PythonFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ struct PythonFilter::Args

PythonFilter::PythonFilter() :
m_script(nullptr), m_pythonMethod(nullptr), m_args(new Args)
{ std::cerr << "Made python filter!\n"; }
{}


PythonFilter::~PythonFilter()
Expand Down Expand Up @@ -99,23 +99,16 @@ void PythonFilter::addDimensions(PointLayoutPtr layout)

void PythonFilter::ready(PointTableRef table)
{
std::cerr << "Ready!\n";
if (m_args->m_source.empty())
m_args->m_source = FileUtils::readFileIntoString(m_args->m_scriptFile);
std::cerr << "Get log stream!\n";
std::ostream *out = log()->getLogStream();
std::cerr << "Get environment!\n";
plang::EnvironmentPtr env = plang::Environment::get();
std::cerr << "Set stdout!\n";
env->set_stdout(out);
std::cerr << "New script!\n";
m_script = new plang::Script(m_args->m_source, m_args->m_module,
m_args->m_function);

std::cerr << "New invocation!\n";
m_pythonMethod = new plang::Invocation(*m_script);
m_pythonMethod->compile();
std::cerr << "Compiled!\n";
m_totalMetadata = table.metadata();
}

Expand All @@ -133,7 +126,6 @@ PointViewSet PythonFilter::run(PointViewPtr view)
args << m_args->m_pdalargs;
m_pythonMethod->setKWargs(args.str());
}
std::cerr << "Executing python!\n";
m_pythonMethod->execute();

PointViewSet viewSet;
Expand Down
11 changes: 2 additions & 9 deletions plugins/python/plang/Environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,28 +116,22 @@ Environment::Environment()
import_array();
};

std::cerr << "Initialize check!\n";
if (!Py_IsInitialized())
{
std::cerr << "Not init!\n";
// PyImport_AppendInittab(const_cast<char*>("redirector"), redirector_init);
std::cerr << "Import inittab!\n";
PyImport_AppendInittab(const_cast<char*>("redirector"),
redirector_init);
Py_Initialize();
std::cerr << "Done py init!\n";
}
else
{
std::cerr << "Yes init!\n";
m_redirector.init();
PyObject* added = PyImport_AddModule("redirector");
if (!added)
throw pdal_error("unable to add redirector module!");
}

initNumpy();
std::cerr << "Init redirector!\n";
PyImport_ImportModule("redirector");
std::cerr << "Done redirector!\n";
}

Environment::~Environment()
Expand All @@ -147,7 +141,6 @@ Environment::~Environment()

void Environment::set_stdout(std::ostream* ostr)
{
std::cerr << "Set stdout!\n";
m_redirector.set_stdout(ostr);
}

Expand Down
3 changes: 0 additions & 3 deletions plugins/python/plang/Redirector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,9 @@ PyMODINIT_FUNC redirector_init(void)

PyObject* Redirector::init()
{
std::cerr << "New redirector!\n";
StdoutType.tp_new = PyType_GenericNew;
if (PyType_Ready(&StdoutType) < 0)
return NULL;
std::cerr << "Create module!\n";
PyObject* m = PyModule_Create(&redirectordef);
if (m)
{
Expand All @@ -175,7 +173,6 @@ std::cerr << "Create module!\n";
PyModule_AddObject(m, "Stdout", reinterpret_cast<PyObject*>(&StdoutType));
#pragma GCC diagnostic pop
}
std::cerr << "Returning redirector!\n";
return m;
}

Expand Down

0 comments on commit 795301e

Please sign in to comment.