ultimatepp/bazaar/PyCon/PyCon.h
kohait 7f2fe06635 bazaar: Python to Py rename to avoid ambiguity, Py prepare for boost use, fixes in PyConsoleCtrl to post result objects
git-svn-id: svn://ultimatepp.org/upp/trunk@3329 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2011-04-07 16:21:09 +00:00

35 lines
676 B
C++

#ifndef _PyCon_PyCon_h_
#define _PyCon_PyCon_h_
#include <Py/Py.h>
#include <Core/Core.h>
using namespace Upp;
#include <LogCtrl/LogCtrl.h>
class PyCon
{
public:
static PyObject* ToStdOut(PyObject* self, PyObject* pArgs);
static PyObject* ToStdErr(PyObject* self, PyObject* pArgs);
static void Init();
static void Enable(bool b = true);
static void Disable() { Enable(false); }
static bool IsEnabled() { return enabled; }
static void SetStream(Stream& _ps) { ps = &_ps; }
static Stream& GetStream() { return (ps)?(*ps):(StdLog()); }
static PyMethodDef m[];
protected:
static bool enabled;
static Stream* ps;
};
#endif