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:
Robin Dunn
2014-01-11 23:12:35 +00:00
parent 4f3de49192
commit c1beea6cfa
10 changed files with 26 additions and 26 deletions

View File

@@ -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()

View File

@@ -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

View File

@@ -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()

View File

@@ -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

View File

@@ -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):

View File

@@ -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()

View File

@@ -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

View File

@@ -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('')

View File

@@ -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('')

View File

@@ -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