+++ /dev/null
-"""my_install_data.py
-
-Provides a more sophisticated facility to install data files
-than distutils' install_data does.
-You can specify your files as a template like in MANIFEST.in
-and you have more control over the copy process.
-
-"""
-
-# created 2000/08/01, Rene Liebscher <R.Liebscher@gmx.de>
-
-###########################################################################
-# import some modules we need
-
-import os,sys,string
-from types import StringType,TupleType,ListType
-from distutils.util import change_root
-from distutils.filelist import FileList
-from distutils.command.install_data import install_data
-
-###########################################################################
-# a container class for our more sophisticated install mechanism
-
-class Data_Files:
- """ container for list of data files.
- supports alternate base_dirs e.g. 'install_lib','install_header',...
- supports a directory where to copy files
- supports templates as in MANIFEST.in
- supports preserving of paths in filenames
- eg. foo/xyz is copied to base_dir/foo/xyz
- supports stripping of leading dirs of source paths
- eg. foo/bar1/xyz, foo/bar2/abc can be copied to bar1/xyz, bar2/abc
- """
-
- def __init__(self,base_dir=None,files=None,copy_to=None,template=None,preserve_path=0,strip_dirs=0):
- self.base_dir = base_dir
- self.files = files
- self.copy_to = copy_to
- self.template = template
- self.preserve_path = preserve_path
- self.strip_dirs = strip_dirs
- self.finalized = 0
-
- def warn (self, msg):
- sys.stderr.write ("warning: %s: %s\n" %
- ("install_data", msg))
-
- def debug_print (self, msg):
- """Print 'msg' to stdout if the global DEBUG (taken from the
- DISTUTILS_DEBUG environment variable) flag is true.
- """
- from distutils.core import DEBUG
- if DEBUG:
- print msg
-
-
- def finalize(self):
- """ complete the files list by processing the given template """
- if self.finalized:
- return
- if self.files == None:
- self.files = []
- if self.template != None:
- if type(self.template) == StringType:
- self.template = string.split(self.template,";")
- filelist = FileList(self.warn,self.debug_print)
- for line in self.template:
- filelist.process_template_line(string.strip(line))
- filelist.sort()
- filelist.remove_duplicates()
- self.files.extend(filelist.files)
- self.finalized = 1
-
-# end class Data_Files
-
-###########################################################################
-# a more sophisticated install routine than distutils install_data
-
-class my_install_data (install_data):
-
- def check_data(self,d):
- """ check if data are in new format, if not create a suitable object.
- returns finalized data object
- """
- if not isinstance(d, Data_Files):
- self.warn(("old-style data files list found "
- "-- please convert to Data_Files instance"))
- if type(d) is TupleType:
- if len(d) != 2 or not (type(d[1]) is ListType):
- raise DistutilsSetupError, \
- ("each element of 'data_files' option must be an "
- "Data File instance, a string or 2-tuple (string,[strings])")
- d = Data_Files(copy_to=d[0],files=d[1])
- else:
- if not (type(d) is StringType):
- raise DistutilsSetupError, \
- ("each element of 'data_files' option must be an "
- "Data File instance, a string or 2-tuple (string,[strings])")
- d = Data_Files(files=[d])
- d.finalize()
- return d
-
- def run(self):
- self.outfiles = []
- install_cmd = self.get_finalized_command('install')
-
- for d in self.data_files:
- d = self.check_data(d)
-
- install_dir = self.install_dir
- # alternative base dir given => overwrite install_dir
- if d.base_dir != None:
- install_dir = getattr(install_cmd,d.base_dir)
-
- # copy to an other directory
- if d.copy_to != None:
- if not os.path.isabs(d.copy_to):
- # relatiev path to install_dir
- dir = os.path.join(install_dir, d.copy_to)
- elif install_cmd.root:
- # absolute path and alternative root set
- dir = change_root(self.root,d.copy_to)
- else:
- # absolute path
- dir = d.copy_to
- else:
- # simply copy to install_dir
- dir = install_dir
- # warn if necceassary
- self.warn("setup script did not provide a directory to copy files to "
- " -- installing right in '%s'" % install_dir)
-
- dir=os.path.normpath(dir)
- # create path
- self.mkpath(dir)
-
- # copy all files
- for src in d.files:
- if d.strip_dirs > 0:
- dst = string.join(string.split(os.path.normcase(src),os.sep)[d.strip_dirs:],os.sep)
- else:
- dst = src
- if d.preserve_path:
- # preserve path in filename
- self.mkpath(os.path.dirname(os.path.join(dir,dst)))
- out = self.copy_file(src, os.path.join(dir,dst))
- else:
- out = self.copy_file(src, dir)
- if type(out) is TupleType:
- out = out[0]
- self.outfiles.append(out)
-
- return self.outfiles
-
- def get_inputs (self):
- inputs = []
- for d in self.data_files:
- d = self.check_data(d)
- inputs.append(d.files)
- return inputs
-
- def get_outputs (self):
- return self.outfiles
-
-
-###########################################################################
-
def LoadStxText(self, text):
# Old ST
- #html = str(StructuredText.html_with_references(text))
+ html = str(StructuredText.html_with_references(text))
# NG Version
- st = StructuredText.Basic(text)
- doc = StructuredText.Document(st)
- html = StructuredText.HTMLNG(doc)
+ #st = StructuredText.Basic(text)
+ #doc = StructuredText.Document(st)
+ #html = StructuredText.HTMLNG(doc)
self.htmlWin.SetPage(html)
self.editWin.SetValue(text)
//---------------------------------------------------------------------------
-class wxHtmlBookRecord : public wxObject {
+class wxHtmlBookRecord {
public:
wxHtmlBookRecord(const wxString& bookfile, const wxString& basepath,
const wxString& title, const wxString& start);
static void SetTimestamp(const wxString& ts);
static const wxString& GetTimestamp();
- bool GetVerbose() const { return m_bVerbose; }
+ bool GetVerbose() const;
static wxTraceMask GetTraceMask();
static bool IsAllowedTraceMask(const wxString& mask);
};
-class wxLogNull
-{
-public:
- wxLogNull();
- ~wxLogNull();
-};
-
-
class wxLogChain : public wxLog
{
public:
%name(wxLogStatusFrame)void wxLogStatus(wxFrame *pFrame, const wxString& szFormat);
void wxLogSysError(const wxString& szFormat);
+// Suspress logging while an instance of this class exists
+class wxLogNull
+{
+public:
+ wxLogNull();
+ ~wxLogNull();
+};
+
+
+
%{
-// A Log class that can be derived from in wxPython
+// A wxLog class that can be derived from in wxPython
class wxPyLog : public wxLog {
public:
wxPyLog() : wxLog() {}
#ifdef __cplusplus
extern "C" {
#endif
-static void *SwigwxHtmlBookRecordTowxObject(void *ptr) {
- wxHtmlBookRecord *src;
- wxObject *dest;
- src = (wxHtmlBookRecord *) ptr;
- dest = (wxObject *) src;
- return (void *) dest;
-}
-
#define new_wxHtmlBookRecord(_swigarg0,_swigarg1,_swigarg2,_swigarg3) (new wxHtmlBookRecord(_swigarg0,_swigarg1,_swigarg2,_swigarg3))
static PyObject *_wrap_new_wxHtmlBookRecord(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
{ "_wxHtmlContentsItem","_struct_wxHtmlContentsItem",0},
{ "_wxObject","_wxHtmlHelpController",SwigwxHtmlHelpControllerTowxObject},
{ "_wxObject","_wxHtmlHelpFrame",SwigwxHtmlHelpFrameTowxObject},
- { "_wxObject","_wxHtmlBookRecord",SwigwxHtmlBookRecordTowxObject},
{ "_signed_short","_WXTYPE",0},
{ "_signed_short","_short",0},
{ "_unsigned_char","_byte",0},
from sizers import *
from filesys import *
-class wxHtmlBookRecordPtr(wxObjectPtr):
+class wxHtmlBookRecordPtr :
def __init__(self,this):
self.this = this
self.thisown = 0
#include <wx/generic/dragimgg.h>
-// A Log class that can be derived from in wxPython
+// A wxLog class that can be derived from in wxPython
class wxPyLog : public wxLog {
public:
wxPyLog() : wxLog() {}
return _resultobj;
}
-#define new_wxLogNull() (new wxLogNull())
-static PyObject *_wrap_new_wxLogNull(PyObject *self, PyObject *args, PyObject *kwargs) {
- PyObject * _resultobj;
- wxLogNull * _result;
- char *_kwnames[] = { NULL };
- char _ptemp[128];
-
- self = self;
- if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxLogNull",_kwnames))
- return NULL;
-{
- PyThreadState* __tstate = wxPyBeginAllowThreads();
- _result = (wxLogNull *)new_wxLogNull();
-
- wxPyEndAllowThreads(__tstate);
- if (PyErr_Occurred()) return NULL;
-} if (_result) {
- SWIG_MakePtr(_ptemp, (char *) _result,"_wxLogNull_p");
- _resultobj = Py_BuildValue("s",_ptemp);
- } else {
- Py_INCREF(Py_None);
- _resultobj = Py_None;
- }
- return _resultobj;
-}
-
-#define delete_wxLogNull(_swigobj) (delete _swigobj)
-static PyObject *_wrap_delete_wxLogNull(PyObject *self, PyObject *args, PyObject *kwargs) {
- PyObject * _resultobj;
- wxLogNull * _arg0;
- PyObject * _argo0 = 0;
- char *_kwnames[] = { "self", NULL };
-
- self = self;
- if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxLogNull",_kwnames,&_argo0))
- return NULL;
- if (_argo0) {
- if (_argo0 == Py_None) { _arg0 = NULL; }
- else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxLogNull_p")) {
- PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxLogNull. Expected _wxLogNull_p.");
- return NULL;
- }
- }
-{
- PyThreadState* __tstate = wxPyBeginAllowThreads();
- delete_wxLogNull(_arg0);
-
- wxPyEndAllowThreads(__tstate);
- if (PyErr_Occurred()) return NULL;
-} Py_INCREF(Py_None);
- _resultobj = Py_None;
- return _resultobj;
-}
-
static void *SwigwxLogChainTowxLog(void *ptr) {
wxLogChain *src;
wxLog *dest;
return _resultobj;
}
+#define new_wxLogNull() (new wxLogNull())
+static PyObject *_wrap_new_wxLogNull(PyObject *self, PyObject *args, PyObject *kwargs) {
+ PyObject * _resultobj;
+ wxLogNull * _result;
+ char *_kwnames[] = { NULL };
+ char _ptemp[128];
+
+ self = self;
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxLogNull",_kwnames))
+ return NULL;
+{
+ PyThreadState* __tstate = wxPyBeginAllowThreads();
+ _result = (wxLogNull *)new_wxLogNull();
+
+ wxPyEndAllowThreads(__tstate);
+ if (PyErr_Occurred()) return NULL;
+} if (_result) {
+ SWIG_MakePtr(_ptemp, (char *) _result,"_wxLogNull_p");
+ _resultobj = Py_BuildValue("s",_ptemp);
+ } else {
+ Py_INCREF(Py_None);
+ _resultobj = Py_None;
+ }
+ return _resultobj;
+}
+
+#define delete_wxLogNull(_swigobj) (delete _swigobj)
+static PyObject *_wrap_delete_wxLogNull(PyObject *self, PyObject *args, PyObject *kwargs) {
+ PyObject * _resultobj;
+ wxLogNull * _arg0;
+ PyObject * _argo0 = 0;
+ char *_kwnames[] = { "self", NULL };
+
+ self = self;
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxLogNull",_kwnames,&_argo0))
+ return NULL;
+ if (_argo0) {
+ if (_argo0 == Py_None) { _arg0 = NULL; }
+ else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxLogNull_p")) {
+ PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxLogNull. Expected _wxLogNull_p.");
+ return NULL;
+ }
+ }
+{
+ PyThreadState* __tstate = wxPyBeginAllowThreads();
+ delete_wxLogNull(_arg0);
+
+ wxPyEndAllowThreads(__tstate);
+ if (PyErr_Occurred()) return NULL;
+} Py_INCREF(Py_None);
+ _resultobj = Py_None;
+ return _resultobj;
+}
+
static void *SwigwxPyLogTowxLog(void *ptr) {
wxPyLog *src;
wxLog *dest;
{ "wxPyLog_Destroy", (PyCFunction) _wrap_wxPyLog_Destroy, METH_VARARGS | METH_KEYWORDS },
{ "wxPyLog__setCallbackInfo", (PyCFunction) _wrap_wxPyLog__setCallbackInfo, METH_VARARGS | METH_KEYWORDS },
{ "new_wxPyLog", (PyCFunction) _wrap_new_wxPyLog, METH_VARARGS | METH_KEYWORDS },
+ { "delete_wxLogNull", (PyCFunction) _wrap_delete_wxLogNull, METH_VARARGS | METH_KEYWORDS },
+ { "new_wxLogNull", (PyCFunction) _wrap_new_wxLogNull, METH_VARARGS | METH_KEYWORDS },
{ "wxLogChain_GetOldLog", (PyCFunction) _wrap_wxLogChain_GetOldLog, METH_VARARGS | METH_KEYWORDS },
{ "wxLogChain_IsPassingMessages", (PyCFunction) _wrap_wxLogChain_IsPassingMessages, METH_VARARGS | METH_KEYWORDS },
{ "wxLogChain_PassMessages", (PyCFunction) _wrap_wxLogChain_PassMessages, METH_VARARGS | METH_KEYWORDS },
{ "wxLogChain_SetLog", (PyCFunction) _wrap_wxLogChain_SetLog, METH_VARARGS | METH_KEYWORDS },
{ "new_wxLogChain", (PyCFunction) _wrap_new_wxLogChain, METH_VARARGS | METH_KEYWORDS },
- { "delete_wxLogNull", (PyCFunction) _wrap_delete_wxLogNull, METH_VARARGS | METH_KEYWORDS },
- { "new_wxLogNull", (PyCFunction) _wrap_new_wxLogNull, METH_VARARGS | METH_KEYWORDS },
{ "wxLogWindow_PassMessages", (PyCFunction) _wrap_wxLogWindow_PassMessages, METH_VARARGS | METH_KEYWORDS },
{ "wxLogWindow_IsPassingMessages", (PyCFunction) _wrap_wxLogWindow_IsPassingMessages, METH_VARARGS | METH_KEYWORDS },
{ "wxLogWindow_GetOldLog", (PyCFunction) _wrap_wxLogWindow_GetOldLog, METH_VARARGS | METH_KEYWORDS },
-class wxLogNullPtr :
- def __init__(self,this):
- self.this = this
- self.thisown = 0
- def __del__(self,misc2c=misc2c):
- if self.thisown == 1 :
- misc2c.delete_wxLogNull(self)
- def __repr__(self):
- return "<C wxLogNull instance at %s>" % (self.this,)
-class wxLogNull(wxLogNullPtr):
- def __init__(self,*_args,**_kwargs):
- self.this = apply(misc2c.new_wxLogNull,_args,_kwargs)
- self.thisown = 1
-
-
-
-
class wxLogChainPtr(wxLogPtr):
def __init__(self,this):
self.this = this
+class wxLogNullPtr :
+ def __init__(self,this):
+ self.this = this
+ self.thisown = 0
+ def __del__(self,misc2c=misc2c):
+ if self.thisown == 1 :
+ misc2c.delete_wxLogNull(self)
+ def __repr__(self):
+ return "<C wxLogNull instance at %s>" % (self.this,)
+class wxLogNull(wxLogNullPtr):
+ def __init__(self,*_args,**_kwargs):
+ self.this = apply(misc2c.new_wxLogNull,_args,_kwargs)
+ self.thisown = 1
+
+
+
+
class wxPyLogPtr(wxLogPtr):
def __init__(self,this):
self.this = this
wxPyApp* wxGetApp() {
- return wxPythonApp;
+ //return wxPythonApp;
+ return (wxPyApp*)wxGetApp();
}
void wxApp_CleanUp() {
%inline %{
wxPyApp* wxGetApp() {
- return wxPythonApp;
+ //return wxPythonApp;
+ return (wxPyApp*)wxGetApp();
}
%}