mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-15 08:59:55 +00:00
Python GC.activity()
.. very basic API as we develop out, it just returns a dict for now. Need to expand to enable returning a list if compare mode is active (like R). .. implemented in a new source file Resources/python/library.py which is loaded directly after the interpreter is loaded at startup. .. also updated src.pro to add library.py and goldencheetah.sip to OTHER_FILES so they can be edited easily in QtCreator.
This commit is contained in:
@@ -87,6 +87,14 @@ PythonEmbed::PythonEmbed(const bool verbose, const bool interactive) : verbose(v
|
||||
|
||||
PyRun_SimpleString(stdOutErr.c_str()); //invoke code to redirect
|
||||
|
||||
// now load the library
|
||||
QFile lib(":python/library.py");
|
||||
if (lib.open(QFile::ReadOnly)) {
|
||||
QString libstring=lib.readAll();
|
||||
lib.close();
|
||||
PyRun_SimpleString(libstring.toLatin1().constData());
|
||||
}
|
||||
|
||||
|
||||
// setup trapping of output
|
||||
PyObject *pModule = PyImport_AddModule("__main__"); //create main module
|
||||
|
||||
Reference in New Issue
Block a user