Browse Source

Wrap uses of the missing CyPythonIDE with #ifdef HAVE_CYPYTHONIDE

to make things compile, like in H-uru/Plasma.
cypythonide
Christian Walther 14 years ago
parent
commit
19cd10abd7
  1. 2
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/plClient.cpp
  2. 2
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp
  3. 10
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.cpp
  4. 6
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.h

2
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/plClient.cpp

@ -1619,7 +1619,7 @@ void plClient::ShutdownDLLs()
hsBool plClient::MainLoop() hsBool plClient::MainLoop()
{ {
#ifndef PLASMA_EXTERNAL_RELEASE #if defined(HAVE_CYPYTHONIDE) && !defined(PLASMA_EXTERNAL_RELEASE)
if (PythonInterface::UsePythonDebugger()) if (PythonInterface::UsePythonDebugger())
{ {
PythonInterface::PythonDebugger()->Update(); PythonInterface::PythonDebugger()->Update();

2
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp

@ -7024,6 +7024,7 @@ PF_CONSOLE_CMD( Python, // Group name
} }
#ifndef LIMIT_CONSOLE_COMMANDS #ifndef LIMIT_CONSOLE_COMMANDS
#ifdef HAVE_CYPYTHONIDE
PF_CONSOLE_CMD( Python, PF_CONSOLE_CMD( Python,
UsePythonDebugger, UsePythonDebugger,
"", "",
@ -7031,6 +7032,7 @@ PF_CONSOLE_CMD( Python,
{ {
PythonInterface::UsePythonDebugger(true); PythonInterface::UsePythonDebugger(true);
} }
#endif
#include "../pfMessage/pfBackdoorMsg.h" #include "../pfMessage/pfBackdoorMsg.h"

10
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 PyObject* PythonInterface::dbgSlice = nil; // time slice function for the debug window
plStatusLog* PythonInterface::dbgLog = nil; // output logfile plStatusLog* PythonInterface::dbgLog = nil; // output logfile
#ifndef PLASMA_EXTERNAL_RELEASE #if defined(HAVE_CYPYTHONIDE) && !defined(PLASMA_EXTERNAL_RELEASE)
bool PythonInterface::usePythonDebugger = false; bool PythonInterface::usePythonDebugger = false;
plCyDebServer PythonInterface::debugServer; plCyDebServer PythonInterface::debugServer;
bool PythonInterface::requestedExit = false; bool PythonInterface::requestedExit = false;
@ -189,7 +189,7 @@ bool PythonInterface::requestedExit = false;
// stupid Windows.h and who started including that! // stupid Windows.h and who started including that!
#undef DrawText #undef DrawText
#ifndef PLASMA_EXTERNAL_RELEASE #if defined(HAVE_CYPYTHONIDE) && !defined(PLASMA_EXTERNAL_RELEASE)
// Special includes for debugging // Special includes for debugging
#include <frameobject.h> #include <frameobject.h>
@ -840,7 +840,7 @@ void PythonInterface::initPython()
Py_SetProgramName("plasma"); Py_SetProgramName("plasma");
Py_Initialize(); Py_Initialize();
#ifndef PLASMA_EXTERNAL_RELEASE #if defined(HAVE_CYPYTHONIDE) && !defined(PLASMA_EXTERNAL_RELEASE)
if (usePythonDebugger) if (usePythonDebugger)
{ {
debugServer.SetCallbackClass(&debServerCallback); debugServer.SetCallbackClass(&debServerCallback);
@ -1512,7 +1512,7 @@ void PythonInterface::finiPython()
initialized--; initialized--;
if ( initialized < 1 && Py_IsInitialized() != 0 && IsInShutdown ) if ( initialized < 1 && Py_IsInitialized() != 0 && IsInShutdown )
{ {
#ifndef PLASMA_EXTERNAL_RELEASE #if defined(HAVE_CYPYTHONIDE) && !defined(PLASMA_EXTERNAL_RELEASE)
if (usePythonDebugger) if (usePythonDebugger)
debugServer.Disconnect(); debugServer.Disconnect();
#endif #endif
@ -1659,7 +1659,7 @@ int PythonInterface::getOutputAndReset(std::string *output)
pyOutputRedirector::ClearData(stdOut); pyOutputRedirector::ClearData(stdOut);
// tell python debugger // tell python debugger
#ifndef PLASMA_EXTERNAL_RELEASE #if defined(HAVE_CYPYTHONIDE) && !defined(PLASMA_EXTERNAL_RELEASE)
if (UsePythonDebugger()) if (UsePythonDebugger())
PythonInterface::PythonDebugger()->StdOut(strVal); PythonInterface::PythonDebugger()->StdOut(strVal);
#endif #endif

6
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 "hsStlUtils.h"
#include <python.h> #include <python.h>
#ifndef PLASMA_EXTERNAL_RELEASE #if defined(HAVE_CYPYTHONIDE) && !defined(PLASMA_EXTERNAL_RELEASE)
#include "../../Apps/CyPythonIDE/plCyDebug/plCyDebServer.h" #include "../../Apps/CyPythonIDE/plCyDebug/plCyDebServer.h"
#endif #endif
@ -66,7 +66,7 @@ private:
static PyObject* dbgSlice; // time slice function for the debug window static PyObject* dbgSlice; // time slice function for the debug window
static plStatusLog* dbgLog; static plStatusLog* dbgLog;
#ifndef PLASMA_EXTERNAL_RELEASE #if defined(HAVE_CYPYTHONIDE) && !defined(PLASMA_EXTERNAL_RELEASE)
static bool usePythonDebugger; static bool usePythonDebugger;
static bool requestedExit; static bool requestedExit;
static plCyDebServer debugServer; static plCyDebServer debugServer;
@ -212,7 +212,7 @@ public:
// //
static pyKey* GetpyKeyFromPython(PyObject* pkey); static pyKey* GetpyKeyFromPython(PyObject* pkey);
#ifndef PLASMA_EXTERNAL_RELEASE #if defined(HAVE_CYPYTHONIDE) && !defined(PLASMA_EXTERNAL_RELEASE)
static bool UsePythonDebugger() { return usePythonDebugger; } static bool UsePythonDebugger() { return usePythonDebugger; }
static void UsePythonDebugger(bool use) { usePythonDebugger = use; } static void UsePythonDebugger(bool use) { usePythonDebugger = use; }

Loading…
Cancel
Save