1 #ifndef _PYTHONQTIMPORTER_
2 #define _PYTHONQTIMPORTER_
50 #include "structmember.h"
91 static void writeCompiledModule(PyCodeObject *co,
const QString& filename,
long mtime,
long sourceSize);
113 const char* fullname, QString& modpath, QString& cachemodpath);
implements importing of python files into PythonQt
static QString getSubName(const QString &str)
get the last name of a dot chain (first.second.last)
static QString getSourceFilename(const QString &cacheFile)
Returns the filename of the source file for the given cache file, e.g. test.py for test....
static QString getCacheFilename(const QString &sourceFile, bool isOptimizedFilename)
Returns the filename of the cache file for the given source file, e.g. test.pyc for test....
static PyObject * getCodeFromData(const QString &path, int isbytecode=0, int ispackage=0, time_t mtime=0)
static time_t getMTimeOfSource(const QString &path)
get time stamp of file
static ModuleInfo getModuleInfo(PythonQtImporter *self, const QString &fullname)
Return if module exists and is a package or a module.
static PyObject * unmarshalCode(const QString &path, const QByteArray &data, time_t mtime)
static QString replaceExtension(const QString &str, const QString &ext)
replace extension of file
static PyObject * compileSource(const QString &path, const QByteArray &data)
static void writeCompiledModule(PyCodeObject *co, const QString &filename, long mtime, long sourceSize)
writes the python code to disk, marshalling and writing the time stamp
static PyObject * getModuleCode(PythonQtImporter *self, const char *fullname, QString &modpath, QString &cachemodpath)
static void init()
initialize
static long getLong(unsigned char *buf)
static PyObject * getCodeFromPyc(const QString &file)
gets the compiled code for the given *.py file if there is a valid pyc file, otherwise compiles the f...
QString moduleName
the module name without the package prefix
QString fullPath
the full path to the found file
defines a python object that stores a Qt slot info
PyObject_HEAD QString * _path