mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-06 20:10:08 +01:00
PR 39 from Metallicow. Py3 and Phoenix updates, Pen and Brush style updates
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@75600 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -71,9 +71,9 @@ def main():
|
||||
sys.app = app
|
||||
del sys
|
||||
# Cleanup the main namespace some more.
|
||||
if md.has_key('App') and md['App'] is App:
|
||||
if 'App' in md and md['App'] is App:
|
||||
del md['App']
|
||||
if md.has_key('__main__') and md['__main__'] is __main__:
|
||||
if '__main__' in md and md['__main__'] is __main__:
|
||||
del md['__main__']
|
||||
# Start the wxPython event loop.
|
||||
app.MainLoop()
|
||||
|
||||
@@ -59,9 +59,9 @@ def main():
|
||||
# Create an application instance.
|
||||
app = App(0)
|
||||
# Cleanup the main namespace some more.
|
||||
if md.has_key('App') and md['App'] is App:
|
||||
if 'App' in md and md['App'] is App:
|
||||
del md['App']
|
||||
if md.has_key('__main__') and md['__main__'] is __main__:
|
||||
if '__main__' in md and md['__main__'] is __main__:
|
||||
del md['__main__']
|
||||
# Mimic the contents of the standard Python shell's sys.path.
|
||||
import sys
|
||||
|
||||
@@ -10,8 +10,8 @@ original = __main__.__dict__.keys()
|
||||
|
||||
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com> / "
|
||||
__author__ += "David N. Mashburn <david.n.mashburn@gmail.com>"
|
||||
__cvsid__ = "$Id: PySlices.py 36607 2005-12-30 23:02:03Z RD $" # Hmmm...
|
||||
__revision__ = "$Revision: 36607 $"[11:-2] #Hmmm...
|
||||
__cvsid__ = "$Id$" # Hmmm...
|
||||
__revision__ = "$Revision$"[11:-2] #Hmmm...
|
||||
|
||||
import wx
|
||||
import os
|
||||
@@ -87,11 +87,11 @@ def main(filename=None):
|
||||
sys.app = app
|
||||
del sys
|
||||
# Cleanup the main namespace some more.
|
||||
if md.has_key('App') and md['App'] is App:
|
||||
if 'App' in md and md['App'] is App:
|
||||
del md['App']
|
||||
if md.has_key('filename') and md['filename'] is filename:
|
||||
if 'filename' in md and md['filename'] is filename:
|
||||
del md['filename']
|
||||
if md.has_key('__main__') and md['__main__'] is __main__:
|
||||
if '__main__' in md and md['__main__'] is __main__:
|
||||
del md['__main__']
|
||||
# Start the wxPython event loop.
|
||||
app.MainLoop()
|
||||
|
||||
@@ -9,8 +9,8 @@ import __main__
|
||||
original = __main__.__dict__.keys()
|
||||
|
||||
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
|
||||
__cvsid__ = "$Id: PySlicesShell.py 41078 2006-09-09 00:38:53Z RD $"
|
||||
__revision__ = "$Revision: 41078 $"[11:-2]
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
import wx
|
||||
import os
|
||||
@@ -73,11 +73,11 @@ def main(filename=None):
|
||||
# Create an application instance.
|
||||
app = App(filename=filename)
|
||||
# Cleanup the main namespace some more.
|
||||
if md.has_key('App') and md['App'] is App:
|
||||
if 'App' in md and md['App'] is App:
|
||||
del md['App']
|
||||
if md.has_key('filename') and md['filename'] is filename:
|
||||
if 'filename' in md and md['filename'] is filename:
|
||||
del md['filename']
|
||||
if md.has_key('__main__') and md['__main__'] is __main__:
|
||||
if '__main__' in md and md['__main__'] is __main__:
|
||||
del md['__main__']
|
||||
# Mimic the contents of the standard Python shell's sys.path.
|
||||
import sys
|
||||
|
||||
@@ -204,7 +204,7 @@ class Calltip(wx.TextCtrl):
|
||||
dispatcher.connect(receiver=self.display, signal=self.ShellClassName+'.calltip')
|
||||
|
||||
df = self.GetFont()
|
||||
font = wx.Font(df.GetPointSize(), wx.TELETYPE, wx.NORMAL, wx.NORMAL)
|
||||
font = wx.Font(df.GetPointSize(), wx.FONTFAMILY_TELETYPE, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)
|
||||
self.SetFont(font)
|
||||
|
||||
def display(self, calltip):
|
||||
@@ -231,7 +231,7 @@ class SessionListing(wx.TextCtrl):
|
||||
signal=ShellClassName+".loadHistory")
|
||||
|
||||
df = self.GetFont()
|
||||
font = wx.Font(df.GetPointSize(), wx.TELETYPE, wx.NORMAL, wx.NORMAL)
|
||||
font = wx.Font(df.GetPointSize(), wx.FONTFAMILY_TELETYPE, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)
|
||||
self.SetFont(font)
|
||||
|
||||
def loadHistory(self, history):
|
||||
@@ -260,7 +260,7 @@ class DispatcherListing(wx.TextCtrl):
|
||||
dispatcher.connect(receiver=self.spy)
|
||||
|
||||
df = self.GetFont()
|
||||
font = wx.Font(df.GetPointSize(), wx.TELETYPE, wx.NORMAL, wx.NORMAL)
|
||||
font = wx.Font(df.GetPointSize(), wx.FONTFAMILY_TELETYPE, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)
|
||||
self.SetFont(font)
|
||||
|
||||
def spy(self, signal, sender):
|
||||
|
||||
@@ -792,7 +792,7 @@ class ShellFrameMixin:
|
||||
|
||||
dlg = wx.lib.dialogs.ScrolledMessageDialog(self, text, title,
|
||||
size = ((700, 540)))
|
||||
fnt = wx.Font(10, wx.TELETYPE, wx.NORMAL, wx.NORMAL)
|
||||
fnt = wx.Font(10, wx.FONTFAMILY_TELETYPE, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)
|
||||
dlg.GetChildren()[0].SetFont(fnt)
|
||||
dlg.GetChildren()[0].SetInsertionPoint(0)
|
||||
dlg.ShowModal()
|
||||
|
||||
@@ -177,7 +177,7 @@ def getCallTip(command='', locals=None):
|
||||
pass
|
||||
elif inspect.isfunction(object):
|
||||
# tip1 is a string like: "getCallTip(command='', locals=None)"
|
||||
argspec = apply(inspect.formatargspec, inspect.getargspec(object))
|
||||
argspec = inspect.formatargspec(inspect.getargspec(object))
|
||||
if dropSelf:
|
||||
# The first parameter to a method is a reference to an
|
||||
# instance, usually coded as "self", and is usually passed
|
||||
|
||||
@@ -185,7 +185,7 @@ class ShellFacade:
|
||||
raise AttributeError(name)
|
||||
|
||||
def __setattr__(self, name, value):
|
||||
if self.__dict__.has_key(name):
|
||||
if name in self.__dict__:
|
||||
self.__dict__[name] = value
|
||||
elif hasattr(self.other, name):
|
||||
setattr(self.other, name, value)
|
||||
@@ -418,7 +418,7 @@ class Shell(editwindow.EditWindow):
|
||||
"""Execute the user's PYTHONSTARTUP script if they have one."""
|
||||
if startupScript and os.path.isfile(startupScript):
|
||||
text = 'Startup script executed: ' + startupScript
|
||||
self.push('print %r; execfile(%r)' % (text, startupScript))
|
||||
self.push('print(%r); execfile(%r)' % (text, startupScript))
|
||||
self.interp.startupScript = startupScript
|
||||
else:
|
||||
self.push('')
|
||||
|
||||
@@ -560,7 +560,7 @@ class SlicesShellFacade:
|
||||
raise AttributeError(name)
|
||||
|
||||
def __setattr__(self, name, value):
|
||||
if self.__dict__.has_key(name):
|
||||
if name in self.__dict__:
|
||||
self.__dict__[name] = value
|
||||
elif hasattr(self.other, name):
|
||||
setattr(self.other, name, value)
|
||||
@@ -1001,7 +1001,7 @@ class SlicesShell(editwindow.EditWindow):
|
||||
"""Execute the user's PYTHONSTARTUP script if they have one."""
|
||||
if startupScript and os.path.isfile(startupScript):
|
||||
text = 'Startup script executed: ' + startupScript
|
||||
self.push('print %r; execfile(%r)' % (text, startupScript))
|
||||
self.push('print(%r); execfile(%r)' % (text, startupScript))
|
||||
self.interp.startupScript = startupScript
|
||||
else:
|
||||
self.push('')
|
||||
|
||||
@@ -694,7 +694,7 @@ class GetAttributeNamesTestCase(GetAttributeTestCase):
|
||||
def test_getAttributeNames(self):
|
||||
for item in self.items:
|
||||
self._checkAttributeNames(item)
|
||||
if __builtins__.has_key('object'):
|
||||
if 'object' in __builtins__:
|
||||
self._checkAttributeNames(object)
|
||||
|
||||
def test_getAttributeNames_NoSingle(self):
|
||||
@@ -800,7 +800,7 @@ class C1(A1):
|
||||
class D1(C1, B1):
|
||||
pass
|
||||
|
||||
if __builtins__.has_key('object'):
|
||||
if 'object' in __builtins__:
|
||||
class A2(object):
|
||||
def __init__(self, a):
|
||||
self.a = a
|
||||
@@ -851,7 +851,7 @@ class GetConstructorTestCase(unittest.TestCase):
|
||||
args = ('self', 'a')
|
||||
varnames = introspect.getConstructor(D1).func_code.co_varnames
|
||||
self.assertEqual(varnames, args)
|
||||
if __builtins__.has_key('object'):
|
||||
if 'object' in __builtins__:
|
||||
# Test new style inheritance rules as well.
|
||||
args = ('self', 'b')
|
||||
varnames = introspect.getConstructor(D2).func_code.co_varnames
|
||||
|
||||
Reference in New Issue
Block a user