From 19cd10abd779b6099d6f1ac58f5e69ff50b86571 Mon Sep 17 00:00:00 2001 From: Christian Walther Date: Wed, 27 Apr 2011 20:52:15 +0200 Subject: [PATCH] Wrap uses of the missing CyPythonIDE with #ifdef HAVE_CYPYTHONIDE to make things compile, like in H-uru/Plasma. --- .../Plasma20/Sources/Plasma/Apps/plClient/plClient.cpp | 2 +- .../Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp | 2 ++ .../Plasma/FeatureLib/pfPython/cyPythonInterface.cpp | 10 +++++----- .../Plasma/FeatureLib/pfPython/cyPythonInterface.h | 6 +++--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/plClient.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/plClient.cpp index e82b92aa..a11902a5 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/plClient.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/plClient.cpp @@ -1619,7 +1619,7 @@ void plClient::ShutdownDLLs() hsBool plClient::MainLoop() { -#ifndef PLASMA_EXTERNAL_RELEASE +#if defined(HAVE_CYPYTHONIDE) && !defined(PLASMA_EXTERNAL_RELEASE) if (PythonInterface::UsePythonDebugger()) { PythonInterface::PythonDebugger()->Update(); diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp index 63607d7c..1274e06d 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp @@ -7024,6 +7024,7 @@ PF_CONSOLE_CMD( Python, // Group name } #ifndef LIMIT_CONSOLE_COMMANDS +#ifdef HAVE_CYPYTHONIDE PF_CONSOLE_CMD( Python, UsePythonDebugger, "", @@ -7031,6 +7032,7 @@ PF_CONSOLE_CMD( Python, { PythonInterface::UsePythonDebugger(true); } +#endif #include "../pfMessage/pfBackdoorMsg.h" diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.cpp index 878c179a..f965014c 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.cpp @@ -180,7 +180,7 @@ PyObject* PythonInterface::dbgOut = nil; PyObject* PythonInterface::dbgSlice = nil; // time slice function for the debug window plStatusLog* PythonInterface::dbgLog = nil; // output logfile -#ifndef PLASMA_EXTERNAL_RELEASE +#if defined(HAVE_CYPYTHONIDE) && !defined(PLASMA_EXTERNAL_RELEASE) bool PythonInterface::usePythonDebugger = false; plCyDebServer PythonInterface::debugServer; bool PythonInterface::requestedExit = false; @@ -189,7 +189,7 @@ bool PythonInterface::requestedExit = false; // stupid Windows.h and who started including that! #undef DrawText -#ifndef PLASMA_EXTERNAL_RELEASE +#if defined(HAVE_CYPYTHONIDE) && !defined(PLASMA_EXTERNAL_RELEASE) // Special includes for debugging #include @@ -840,7 +840,7 @@ void PythonInterface::initPython() Py_SetProgramName("plasma"); Py_Initialize(); -#ifndef PLASMA_EXTERNAL_RELEASE +#if defined(HAVE_CYPYTHONIDE) && !defined(PLASMA_EXTERNAL_RELEASE) if (usePythonDebugger) { debugServer.SetCallbackClass(&debServerCallback); @@ -1512,7 +1512,7 @@ void PythonInterface::finiPython() initialized--; if ( initialized < 1 && Py_IsInitialized() != 0 && IsInShutdown ) { -#ifndef PLASMA_EXTERNAL_RELEASE +#if defined(HAVE_CYPYTHONIDE) && !defined(PLASMA_EXTERNAL_RELEASE) if (usePythonDebugger) debugServer.Disconnect(); #endif @@ -1659,7 +1659,7 @@ int PythonInterface::getOutputAndReset(std::string *output) pyOutputRedirector::ClearData(stdOut); // tell python debugger -#ifndef PLASMA_EXTERNAL_RELEASE +#if defined(HAVE_CYPYTHONIDE) && !defined(PLASMA_EXTERNAL_RELEASE) if (UsePythonDebugger()) PythonInterface::PythonDebugger()->StdOut(strVal); #endif diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.h b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.h index 28751ad6..138a81ae 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.h +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.h @@ -34,7 +34,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsStlUtils.h" #include -#ifndef PLASMA_EXTERNAL_RELEASE +#if defined(HAVE_CYPYTHONIDE) && !defined(PLASMA_EXTERNAL_RELEASE) #include "../../Apps/CyPythonIDE/plCyDebug/plCyDebServer.h" #endif @@ -66,7 +66,7 @@ private: static PyObject* dbgSlice; // time slice function for the debug window static plStatusLog* dbgLog; -#ifndef PLASMA_EXTERNAL_RELEASE +#if defined(HAVE_CYPYTHONIDE) && !defined(PLASMA_EXTERNAL_RELEASE) static bool usePythonDebugger; static bool requestedExit; static plCyDebServer debugServer; @@ -212,7 +212,7 @@ public: // static pyKey* GetpyKeyFromPython(PyObject* pkey); -#ifndef PLASMA_EXTERNAL_RELEASE +#if defined(HAVE_CYPYTHONIDE) && !defined(PLASMA_EXTERNAL_RELEASE) static bool UsePythonDebugger() { return usePythonDebugger; } static void UsePythonDebugger(bool use) { usePythonDebugger = use; }