@@ -13,7 +13,7 @@ inline pybind11::module pyobject_from_gobj(gpointer ptr){
1313 return pybind11::module (Py_None, false );
1414}
1515
16- PythonInterpreter::PythonInterpreter (){
16+ Python::Interpreter::Interpreter (){
1717 auto init_juci_api=[](){
1818 pybind11::module (pygobject_init (-1 ,-1 ,-1 ),false );
1919 pybind11::module api (" jucpp" ," Python bindings for juCi++" );
@@ -58,20 +58,20 @@ PythonInterpreter::PythonInterpreter(){
5858 if (module_name!=" __pycache__" ){
5959 auto module =import (module_name);
6060 if (!module )
61- std::cerr << std::string (PythonError ()) << std::endl;
61+ std::cerr << std::string (Error ()) << std::endl;
6262 }
6363 }
6464}
6565
66- pybind11::module PythonInterpreter ::get_loaded_module (const std::string &module_name){
66+ pybind11::module Python::Interpreter ::get_loaded_module (const std::string &module_name){
6767 return pybind11::module (PyImport_AddModule (module_name.c_str ()), true );
6868}
6969
70- pybind11::module PythonInterpreter ::import (const std::string &module_name){
70+ pybind11::module Python::Interpreter ::import (const std::string &module_name){
7171 return pybind11::module (PyImport_ImportModule (module_name.c_str ()), false );
7272}
7373
74- void PythonInterpreter ::add_path (const boost::filesystem::path &path){
74+ void Python::Interpreter ::add_path (const boost::filesystem::path &path){
7575 std::wstring sys_path (Py_GetPath ());
7676 if (!sys_path.empty ())
7777#ifdef _WIN32
@@ -83,15 +83,15 @@ void PythonInterpreter::add_path(const boost::filesystem::path &path){
8383 Py_SetPath (sys_path.c_str ());
8484}
8585
86- PythonInterpreter::~PythonInterpreter (){
87- auto err=PythonError ();
86+ Python::Interpreter::~Interpreter (){
87+ auto err=Error ();
8888 if (Py_IsInitialized ())
8989 Py_Finalize ();
9090 if (err)
9191 std::cerr << std::string (err) << std::endl;
9292}
9393
94- PythonError::PythonError (){
94+ Python::Error::Error (){
9595 pybind11::object error (PyErr_Occurred (), false );
9696 if (error){
9797 PyObject *exception,*value,*traceback;
@@ -107,10 +107,10 @@ PythonError::PythonError(){
107107 }
108108}
109109
110- PythonError ::operator std::string (){
110+ Python::Error ::operator std::string (){
111111 return exp + " \n " + val + " \n " + trace;
112112}
113113
114- PythonError ::operator bool (){
114+ Python::Error ::operator bool (){
115115 return !exp.empty ();
116116}
0 commit comments