mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-28 09:26:52 +00:00
Add a settings window entry to add extra python stubs paths
This commit is contained in:
@@ -364,6 +364,12 @@ DECLARE_REFLECTION_STRUCT(BugReport);
|
||||
"type: List[str]"); \
|
||||
CONFIG_SETTING(public, QVariantList, rdcarray<rdcstr>, TextureViewer_ShaderDirs) \
|
||||
\
|
||||
DOCUMENT( \
|
||||
"List of extra directories to write python stubs into.\n" \
|
||||
"\n:" \
|
||||
"type: List[str]"); \
|
||||
CONFIG_SETTING(public, QVariantList, rdcarray<rdcstr>, Python_StubDirs) \
|
||||
\
|
||||
DOCUMENT( \
|
||||
"``True`` if when loading a capture that was originally captured on a remote device but " \
|
||||
"uses an API that can be supported locally, should be loaded locally without prompting to " \
|
||||
|
||||
@@ -401,7 +401,7 @@ void PythonContext::GenerateStubs(const rdcarray<rdcstr> &extraPaths)
|
||||
qInfo() << "Stubs generation processed in" << timer.elapsed() << "ms";
|
||||
}
|
||||
|
||||
void PythonContext::GlobalInit()
|
||||
void PythonContext::GlobalInit(PersistantConfig &config)
|
||||
{
|
||||
// must happen on the UI thread
|
||||
if(qApp->thread() != QThread::currentThread())
|
||||
@@ -417,10 +417,10 @@ void PythonContext::GlobalInit()
|
||||
PyImport_AppendInittab("qrenderdoc", &PyInit_qrenderdoc);
|
||||
|
||||
#if PY_VERSION_HEX > 0x030B0000
|
||||
PyConfig config;
|
||||
PyConfig_InitPythonConfig(&config);
|
||||
config.configure_c_stdio = 0;
|
||||
config.parse_argv = 0;
|
||||
PyConfig pyconfig;
|
||||
PyConfig_InitPythonConfig(&pyconfig);
|
||||
pyconfig.configure_c_stdio = 0;
|
||||
pyconfig.parse_argv = 0;
|
||||
#endif
|
||||
|
||||
#if defined(STATIC_QRENDERDOC)
|
||||
@@ -433,7 +433,7 @@ void PythonContext::GlobalInit()
|
||||
pylibs.toWCharArray(python_home);
|
||||
|
||||
#if PY_VERSION_HEX > 0x030B0000
|
||||
config.home = python_home;
|
||||
pyconfig.home = python_home;
|
||||
#else
|
||||
Py_SetPythonHome(python_home);
|
||||
#endif
|
||||
@@ -441,11 +441,11 @@ void PythonContext::GlobalInit()
|
||||
#endif
|
||||
|
||||
#if PY_VERSION_HEX > 0x030B0000
|
||||
config.program_name = program_name;
|
||||
pyconfig.program_name = program_name;
|
||||
|
||||
config.use_environment = 0;
|
||||
pyconfig.use_environment = 0;
|
||||
|
||||
Py_InitializeFromConfig(&config);
|
||||
Py_InitializeFromConfig(&pyconfig);
|
||||
#else
|
||||
Py_SetProgramName(program_name);
|
||||
|
||||
@@ -477,7 +477,7 @@ void PythonContext::GlobalInit()
|
||||
|
||||
main_dict = PyModule_GetDict(main_module);
|
||||
|
||||
GenerateStubs({});
|
||||
GenerateStubs(config.Python_StubDirs);
|
||||
|
||||
// replace sys.stdout and sys.stderr with our own objects. These have a 'this' pointer of NULL,
|
||||
// which then indicates they need to forward to a global object
|
||||
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
void PausePythonThreading();
|
||||
void ResumePythonThreading();
|
||||
|
||||
static void GlobalInit();
|
||||
static void GlobalInit(PersistantConfig &config);
|
||||
static void GlobalShutdown();
|
||||
|
||||
static QStringList GetApplicationExtensionsPaths();
|
||||
|
||||
@@ -286,7 +286,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
{
|
||||
QCoreApplication application(argc, mod_argv);
|
||||
PythonContext::GlobalInit();
|
||||
PersistantConfig cfg;
|
||||
PythonContext::GlobalInit(cfg);
|
||||
|
||||
logstream << "Checking python binding consistency.\n";
|
||||
|
||||
@@ -631,7 +632,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
PythonContext::GlobalInit();
|
||||
PythonContext::GlobalInit(config);
|
||||
|
||||
if(updateApplied)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user