24 using namespace frepple;
37 static bool initialized =
false;
38 if (initialized)
return;
47 string init = Environment::searchFile(
"init.py");
53 PythonInterpreter::executeFile(init);
57 logger <<
"Exception caught during execution of 'init.py'" << endl;
63 init = Environment::searchFile(
"init.xml");
70 logger <<
"Exception caught during execution of 'init.xml'" << endl;
92 xercesc::StdInInputSource in;
99 else if (validateonly)
112 PythonInterpreter::executeFile(filename);
131 Environment::setLogFile(
"");
150 catch (...) {
return EXIT_FAILURE;}
158 catch (...) {
return EXIT_FAILURE;}
166 catch (...) {
return EXIT_FAILURE;}
174 catch (...) {
return EXIT_FAILURE;}
182 catch (...) {
return EXIT_FAILURE;}
190 catch (...) {
return EXIT_FAILURE;}
196 #if PY_MAJOR_VERSION >= 3
197 PyMODINIT_FUNC PyInit_frepple(
void)
205 #if PY_MAJOR_VERSION >= 3
206 return PythonInterpreter::getModule();
209 catch(
const exception& e)
211 logger <<
"Initialization failed: " << e.what() << endl;
212 #if PY_MAJOR_VERSION >= 3
218 logger <<
"Initialization failed: reason unknown" << endl;
219 #if PY_MAJOR_VERSION >= 3