From 7f285f6c51fbcff2a8d7098daa0049332d0b6b87 Mon Sep 17 00:00:00 2001
From: Scott Talbert <swt@techie.net>
Date: Mon, 12 Nov 2018 23:14:26 -0500
Subject: [PATCH] Unbundle sip
---
etg/dataview.py | 4 ++--
etg/grid.py | 4 ++--
etg/sizer.py | 4 ++--
etg/window.py | 4 ++--
unittests/test_dc.py | 10 +++++-----
wscript | 20 +-------------------
wx/lib/gizmos/dynamicsash.py | 6 +++---
7 files changed, 17 insertions(+), 35 deletions(-)
diff --git a/etg/dataview.py b/etg/dataview.py
index c0be8351..0a877a3f 100644
--- a/etg/dataview.py
+++ b/etg/dataview.py
@@ -374,8 +374,8 @@ def run():
is reference counted so it can be shared with other views.
""",
body="""\
- import wx.siplib
- wasPyOwned = wx.siplib.ispyowned(model)
+ import sip
+ wasPyOwned = sip.ispyowned(model)
self._AssociateModel(model)
# Ownership of the python object has just been transferred to
# C++, so DecRef the C++ instance associated with this python
diff --git a/etg/grid.py b/etg/grid.py
index 47c1e0ce..097e9c86 100644
--- a/etg/grid.py
+++ b/etg/grid.py
@@ -445,8 +445,8 @@ def run():
body="""\
val = self._SetTable(table, takeOwnership, selmode)
if takeOwnership:
- import wx.siplib
- wx.siplib.transferto(table, self)
+ import sip
+ sip.transferto(table, self)
return val
""")
diff --git a/etg/sizer.py b/etg/sizer.py
index a5533eab..1335987f 100644
--- a/etg/sizer.py
+++ b/etg/sizer.py
@@ -148,8 +148,8 @@ def run():
" if theSizer:\n"
" doSomething()",
body="""\
- import wx.siplib
- return not wx.siplib.isdeleted(self)
+ import sip
+ return not sip.isdeleted(self)
""")
c.addPyCode('Sizer.__bool__ = Sizer.__nonzero__') # For Python 3
diff --git a/etg/window.py b/etg/window.py
index be481ae6..a1bb0f7e 100644
--- a/etg/window.py
+++ b/etg/window.py
@@ -178,8 +178,8 @@ def run():
" if theWindow:\n"
" doSomething()",
body="""\
- import wx.siplib
- return not wx.siplib.isdeleted(self)
+ import sip
+ return not sip.isdeleted(self)
""")
c.addPyCode('Window.__bool__ = Window.__nonzero__') # For Python 3
diff --git a/unittests/test_dc.py b/unittests/test_dc.py
index 525d9694..f70ccba6 100644
--- a/unittests/test_dc.py
+++ b/unittests/test_dc.py
@@ -176,17 +176,17 @@ class dc_Tests(wtc.WidgetTestCase):
def test_dcContextManager(self):
- import wx.siplib
+ import sip
with wx.ClientDC(self.frame) as dc:
dc.DrawLine(0,0,100,100)
# check ownership
- assert wx.siplib.ispyowned(dc)
- assert not wx.siplib.isdeleted(dc)
+ assert sip.ispyowned(dc)
+ assert not sip.isdeleted(dc)
# check the DC's ownership has changed
- assert not wx.siplib.ispyowned(dc)
- assert wx.siplib.isdeleted(dc)
+ assert not sip.ispyowned(dc)
+ assert sip.isdeleted(dc)
#---------------------------------------------------------------------------
diff --git a/wscript b/wscript
index d051ebbc..9a3c26da 100644
--- a/wscript
+++ b/wscript
@@ -96,7 +96,7 @@ def configure(conf):
conf.env.msvc_relwithdebug = conf.options.msvc_relwithdebug
# Ensure that the headers in siplib and Phoenix's src dir can be found
- conf.env.INCLUDES_WXPY = ['sip/siplib', 'src']
+ conf.env.INCLUDES_WXPY = ['src']
if isWindows:
# Windows/MSVC specific stuff
@@ -506,24 +506,6 @@ def build(bld):
# Create the build tasks for each of our extension modules.
- addRelwithdebugFlags(bld, 'siplib')
- siplib = bld(
- features = 'c cxx cshlib cxxshlib pyext',
- target = makeTargetName(bld, 'siplib'),
- source = ['sip/siplib/apiversions.c',
- 'sip/siplib/array.c',
- 'sip/siplib/bool.cpp',
- 'sip/siplib/descriptors.c',
- 'sip/siplib/int_convertors.c',
- 'sip/siplib/objmap.c',
- 'sip/siplib/qtlib.c',
- 'sip/siplib/siplib.c',
- 'sip/siplib/threads.c',
- 'sip/siplib/voidptr.c',
- ],
- uselib = 'siplib WX WXPY',
- )
- makeExtCopyRule(bld, 'siplib')
# Add build rules for each of our ETG generated extension modules
makeETGRule(bld, 'etg/_core.py', '_core', 'WX')
diff --git a/wx/lib/gizmos/dynamicsash.py b/wx/lib/gizmos/dynamicsash.py
index cfda4235..ba9228fa 100644
--- a/wx/lib/gizmos/dynamicsash.py
+++ b/wx/lib/gizmos/dynamicsash.py
@@ -16,7 +16,7 @@ reunified through the user interface.
"""
import wx
-import wx.siplib
+import sip
#----------------------------------------------------------------------------
# Styles
@@ -942,7 +942,7 @@ class _DynamicSashWindowLeaf(wx.EvtHandler):
# we'll just save the object's address instead, and then use that to
# fetch the real proxy object when it's needed later.
self.m_child = None
- self.m_child_ptr = wx.siplib.unwrapinstance(window)
+ self.m_child_ptr = sip.unwrapinstance(window)
# Delay the reparenting until after the AddChild has finished.
event = _DynamicSashReparentEvent(self)
@@ -951,7 +951,7 @@ class _DynamicSashWindowLeaf(wx.EvtHandler):
def _checkPendingChild(self):
if hasattr(self, 'm_child_ptr'):
- self.m_child = wx.siplib.wrapinstance(self.m_child_ptr, wx.Object)
+ self.m_child = sip.wrapinstance(self.m_child_ptr, wx.Object)
del self.m_child_ptr
--
2.19.1