print('with parenthesis') fixes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@74400 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2013-07-05 22:56:14 +00:00
parent 9fdf0a9a5c
commit d64b6bb204
26 changed files with 67 additions and 68 deletions

View File

@@ -443,6 +443,7 @@ class PrintCalend:
def DoDrawing(self, DC):
size = DC.GetSize()
DC.BeginDrawing()
cal = wx.lib.calendar.PrtCalDraw(self)
@@ -495,6 +496,8 @@ class PrintCalend:
x = x + 4.0 # next column
DC.EndDrawing()
self.ymax = DC.MaxY()
self.xmax = DC.MaxX()

View File

@@ -49,8 +49,8 @@ class MyFrame(wx.Frame):
wx.DLG_SZE(panel, (36, -1)),
wx.TE_READONLY)
#print wx.DLG_PNT(panel, (24, 4)), wx.DLG_SZE(panel, (36, -1))
#print wx.DLG_PNT(panel, (24, 16)),wx.DLG_SZE(panel, (36, -1))
#print(wx.DLG_PNT(panel, (24, 4)), wx.DLG_SZE(panel, (36, -1)))
#print(wx.DLG_PNT(panel, (24, 16)),wx.DLG_SZE(panel, (36, -1)))
# This method is called automatically when the CLOSE event is
# sent to this window

View File

@@ -110,9 +110,9 @@ class TestFrame(wx.Frame):
def OnOtherBtn(self, evt):
# just for testing...
#print self.eom.numLines,
#print(self.eom.numLines)
self.eom._adjustCtrl()
#print self.eom.numLines
#print(self.eom.numLines)
#----------------------------------------------------------------------

View File

@@ -53,7 +53,7 @@ class TestPanel(wx.Panel):
def OnFind(self, evt):
#print repr(evt.GetFindString()), repr(self.findData.GetFindString())
#print(repr(evt.GetFindString()), repr(self.findData.GetFindString()))
map = {
wx.wxEVT_COMMAND_FIND : "FIND",
wx.wxEVT_COMMAND_FIND_NEXT : "FIND_NEXT",

View File

@@ -4,7 +4,7 @@ try:
import numpy as N
import numpy.random as RandomArray
haveNumpy = True
#print "Using numpy, version:", N.__version__
#print("Using numpy, version:", N.__version__)
except ImportError:
# numpy isn't there
haveNumpy = False
@@ -540,7 +540,7 @@ def BuildDrawFrame(): # this gets called when needed, rather than on import
self.NumTimeSteps = 200
self.TimeStep = 1
self.Timer.Start(self.FrameDelay)
#print "Did %i frames in %f seconds"%(N, (time.time() - start) )
#print("Did %i frames in %f seconds"%(N, (time.time() - start) ))
def TestHitTest(self, event=None):
wx.GetApp().Yield(True)
@@ -1302,14 +1302,14 @@ def BuildDrawFrame(): # this gets called when needed, rather than on import
self.Log("Loading Map from a File")
wx.GetApp().Yield(True) # so log text will get displayed now.
Shorelines = self.Read_MapGen(os.path.join("data",'world.dat'),stats = 0)
#print "It took %f seconds to load %i shorelines"%(time.clock() - start,len(Shorelines) )
#print("It took %f seconds to load %i shorelines"%(time.clock() - start,len(Shorelines) ))
#start = time.clock()
for segment in Shorelines:
self.Canvas.AddLine(segment)
#print "It took %f seconds to add %i shorelines"%(time.clock() - start,len(Shorelines) )
#print("It took %f seconds to add %i shorelines"%(time.clock() - start,len(Shorelines) ))
#start = time.clock()
self.Canvas.ZoomToBB()
#print "It took %f seconds to draw %i shorelines"%(time.clock() - start,len(Shorelines) )
#print("It took %f seconds to draw %i shorelines"%(time.clock() - start,len(Shorelines) ))
@@ -1336,10 +1336,10 @@ def BuildDrawFrame(): # this gets called when needed, rather than on import
linecolors.append(random.randint(0,len(colors)-1) )
for (points,color,width) in zip(linepoints,linecolors,linewidths):
Canvas.AddLine((points[0:2],points[2:4]), LineWidth = width, LineColor = colors[color])
#print "It took %f seconds to add %i lines"%(time.clock() - start,len(linepoints) )
#print("It took %f seconds to add %i lines"%(time.clock() - start,len(linepoints) ))
#start = time.clock()
Canvas.ZoomToBB()
#print "It took %f seconds to draw %i lines"%(time.clock() - start,len(linepoints) )
#print("It took %f seconds to draw %i lines"%(time.clock() - start,len(linepoints) ))
def ArrowLineTest(self,event = None):
wx.GetApp().Yield(True)
@@ -1384,11 +1384,11 @@ def BuildDrawFrame(): # this gets called when needed, rather than on import
for i in range(1000):
Point = (random.uniform(BigRange[0],BigRange[1]),random.uniform(BigRange[0],BigRange[1]))
coords.append( (Point) )
print "Drawing the Points"
print("Drawing the Points")
start = time.clock()
for Point in coords:
Canvas.AddPoint(Point, Diameter = 4)
print "It took %s seconds to add the points"%(time.clock() - start)
print("It took %s seconds to add the points"%(time.clock() - start))
Canvas.ZoomToBB()
def PropertiesChangeTest(self,event=None):
@@ -1571,7 +1571,7 @@ def BuildDrawFrame(): # this gets called when needed, rather than on import
self.Log("The Arrow was Clicked")
def RotateArrow(self,event):
##print "The Changeable Arrow was Clicked"
##print("The Changeable Arrow was Clicked")
## You can do them either one at a time, or both at once
## Doing them both at once prevents the arrow points from being calculated twice
#self.RotArrow.SetDirection(self.RotArrow.Direction + random.uniform(-90,90))
@@ -1742,8 +1742,8 @@ def BuildDrawFrame(): # this gets called when needed, rather than on import
for segment in Shorelines:
NumPoints = NumPoints + len(segment)
AvgPoints = NumPoints / NumSegments
print "Number of Segments: ", NumSegments
print "Average Number of Points per segment: ",AvgPoints
print("Number of Segments: ", NumSegments)
print("Average Number of Points per segment: ", AvgPoints)
if AllLines:
Lines = []
for segment in Shorelines:

View File

@@ -115,9 +115,9 @@ assert when compiled in debug mode.""",
pt = evt.GetPosition()
item = self.gbs.FindItemAtPoint(pt)
if item is None:
print "no item at", `pt`
print("no item at", `pt`)
else:
print "item found: ", `item.GetPos()`, "--", `item.GetSpan()`
print("item found: ", `item.GetPos()`, "--", `item.GetSpan()`)
#---------------------------------------------------------------------------

View File

@@ -4,9 +4,9 @@ import wx.grid as gridlib
#---------------------------------------------------------------------------
class CustomDataTable(gridlib.PyGridTableBase):
class CustomDataTable(gridlib.GridTableBase):
def __init__(self, log):
gridlib.PyGridTableBase.__init__(self)
gridlib.GridTableBase.__init__(self)
self.log = log
self.colLabels = ['ID', 'Description', 'Severity', 'Priority', 'Platform',
@@ -101,13 +101,9 @@ class CustomDataTable(gridlib.PyGridTableBase):
return self.CanGetValueAs(row, col, typeName)
#---------------------------------------------------------------------------
class CustTableGrid(gridlib.Grid):
def __init__(self, parent, log):
gridlib.Grid.__init__(self, parent, -1)
@@ -154,17 +150,17 @@ class TestFrame(wx.Frame):
p.SetSizer(bs)
def OnButton(self, evt):
print "button selected"
print("button selected")
def OnButtonFocus(self, evt):
print "button focus"
print("button focus")
#---------------------------------------------------------------------------
if __name__ == '__main__':
import sys
app = wx.PySimpleApp()
app = wx.App()
frame = TestFrame(None, sys.stdout)
frame.Show(True)
app.MainLoop()

View File

@@ -61,8 +61,8 @@ class HugeTableGrid(gridlib.Grid):
self.Bind(gridlib.EVT_GRID_CELL_RIGHT_CLICK, self.OnRightDown)
def OnRightDown(self, event):
print "hello"
print self.GetSelectedRows()
print("hello")
print(self.GetSelectedRows())
#---------------------------------------------------------------------------

View File

@@ -116,7 +116,7 @@ class MegaTable(Grid.GridTableBase):
# ------------------------------------------------------
# begin the added code to manipulate the table (non wx related)
def AppendRow(self, row):
#print 'append'
#print('append')
entry = {}
for name in self.colnames:

View File

@@ -228,7 +228,7 @@ class TestListCtrlPanel(wx.Panel, listmix.ColumnSorterMixin):
return item.GetText()
def OnItemSelected(self, event):
##print event.GetItem().GetTextColour()
##print(event.GetItem().GetTextColour())
self.currentItem = event.Index
self.log.WriteText("OnItemSelected: %s, %s, %s, %s\n" %
(self.currentItem,

View File

@@ -13,7 +13,7 @@ class TestPanel(wx.Panel):
title.SetFont(wx.FFont(24, wx.FONTFAMILY_SWISS, wx.FONTFLAG_BOLD))
title.SetForegroundColour("navy")
box.Add(title, 0, wx.ALIGN_CENTER|wx.ALL, 5)
#print title.GetBestSize(), title.GetMinSize(), title.GetSize()
#print(title.GetBestSize(), title.GetMinSize(), title.GetSize())
box.Add(wx.StaticLine(self), 0, wx.EXPAND)

View File

@@ -253,7 +253,7 @@ class TestLog:
pass
def write(self, msg):
print msg
print(msg)
#----------------------------------------------------------------------

View File

@@ -92,9 +92,9 @@ class TestPanel(wx.Panel):
def OnCloseStream(self, evt):
self.log.write('OnCloseStream\n')
#print "b4 CloseOutput"
#print("b4 CloseOutput")
self.process.CloseOutput()
#print "after CloseOutput"
#print("after CloseOutput")
def OnIdle(self, evt):
if self.process is not None:

View File

@@ -32,7 +32,7 @@ class MyEvent(wx.PyCommandEvent):
self.myVal = None
#def __del__(self):
# print '__del__'
# print('__del__')
# wx.PyCommandEvent.__del__(self)
def SetMyVal(self, val):
@@ -51,9 +51,9 @@ class MyButton(wx.Button):
pt = event.GetPosition()
evt = MyEvent(myEVT_BUTTON_CLICKPOS, self.GetId())
evt.SetMyVal(pt)
#print id(evt), sys.getrefcount(evt)
#print(id(evt), sys.getrefcount(evt))
self.GetEventHandler().ProcessEvent(evt)
#print id(evt), sys.getrefcount(evt)
#print(id(evt), sys.getrefcount(evt))
event.Skip()
@@ -79,7 +79,7 @@ class TestPanel(wx.Panel):
self.log.WriteText("OnClick\n")
def OnMyEvent(self, event):
#print id(event), sys.getrefcount(event)
#print(id(event), sys.getrefcount(event))
self.log.WriteText("MyEvent: %s\n" % (event.GetMyVal(), ) )

View File

@@ -142,7 +142,6 @@ class MyCanvas(wx.ScrolledWindow):
"red", "blue", (25,25))
self.DrawSavedLines(dc)
def DrawSavedLines(self, dc):
dc.SetPen(wx.Pen('MEDIUM FOREST GREEN', 4))
for line in self.lines:
@@ -218,7 +217,7 @@ class MyCanvas(wx.ScrolledWindow):
## delta = evt.GetWheelDelta()
## rot = evt.GetWheelRotation()
## linesPer = evt.GetLinesPerAction()
## print delta, rot, linesPer
## print(delta, rot, linesPer)
## ws = self.wheelScroll
## ws = ws + rot
## lines = ws / delta

View File

@@ -202,7 +202,7 @@ class PythonSTC(stc.StyledTextCtrl):
#for x in range(50000):
# lst.append('%05d' % x)
#st = " ".join(lst)
#print len(st)
#print(len(st))
#self.AutoCompShow(0, st)
kw = keyword.kwlist[:]
@@ -259,7 +259,7 @@ class PythonSTC(stc.StyledTextCtrl):
self.BraceHighlight(braceAtCaret, braceOpposite)
#pt = self.PointFromPosition(braceOpposite)
#self.Refresh(True, wxRect(pt.x, pt.y, 5,5))
#print pt
#print(pt)
#self.Refresh(False)

View File

@@ -306,7 +306,7 @@ class TestLog:
pass
def write(self, msg):
print msg
print(msg)
#----------------------------------------------------------------------

View File

@@ -6,13 +6,13 @@ import wx
class TestPanel(wx.Panel):
# def OnSetFocus(self, evt):
# print "OnSetFocus"
# print("OnSetFocus")
# evt.Skip()
# def OnKillFocus(self, evt):
# print "OnKillFocus"
# print("OnKillFocus")
# evt.Skip()
# def OnWindowDestroy(self, evt):
# print "OnWindowDestroy"
# print("OnWindowDestroy")
# evt.Skip()

View File

@@ -205,7 +205,7 @@ class TestPanel( scrolled.ScrolledPanel ):
min, max = None, None
cur_min, cur_max = self.target_ctrl.GetBounds()
print cur_min, min
print(cur_min, min)
if min and (min != cur_min): self.target_ctrl.SetMin( min )
if max and (max != cur_max): self.target_ctrl.SetMax( max )

View File

@@ -166,7 +166,7 @@ class TestTreeCtrlPanel(wx.Panel):
self.log.WriteText("BoundingRect: %s\n" %
self.tree.GetBoundingRect(self.item, True))
#items = self.tree.GetSelections()
#print map(self.tree.GetItemText, items)
#print(map(self.tree.GetItemText, items))
event.Skip()
def OnActivate(self, event):

View File

@@ -44,11 +44,11 @@ class XMLTree(wx.TreeCtrl):
self.draggingItem = None
if not itemDst.IsOk():
print "Can't drag to here..."
print("Can't drag to here...")
return
if self.IsDescendant(itemDst, itemSrc):
print "Can't move item to its descendant"
print("Can't move item to its descendant")
return
# For this simple example just take the text of the source item

View File

@@ -335,8 +335,8 @@ class TestListCtrlPanel(wx.Panel, listmix.ColumnSorterMixin):
def OnPopupOne(self, event):
self.log.WriteText("Popup one\n")
print "FindItem:", self.list.FindItem(-1, "Roxette")
print "FindItemData:", self.list.FindItemData(-1, 11)
print("FindItem:", self.list.FindItem(-1, "Roxette"))
print("FindItemData:", self.list.FindItemData(-1, 11))
def OnPopupTwo(self, event):
self.log.WriteText("Selected items:\n")
@@ -356,7 +356,7 @@ class TestListCtrlPanel(wx.Panel, listmix.ColumnSorterMixin):
def OnPopupFive(self, event):
item = self.list.GetItem(self.currentItem)
print item.Text, item.Id, self.list.GetItemData(self.currentItem)
print(item.Text, item.Id, self.list.GetItemData(self.currentItem))
def OnPopupSix(self, event):
self.list.EditLabel(self.currentItem)

View File

@@ -23,8 +23,8 @@ import wx.lib.mixins.inspection
import sys, os
# stuff for debugging
print "wx.version:", wx.version()
print "pid:", os.getpid()
print("wx.version:", wx.version())
print("pid:", os.getpid())
##raw_input("Press Enter...")
assertMode = wx.PYAPP_ASSERT_DIALOG
@@ -145,7 +145,7 @@ def main(argv):
break
if len(argv) < 2:
print "Please specify a demo module name on the command-line"
print("Please specify a demo module name on the command-line")
raise SystemExit
name, ext = os.path.splitext(argv[1])

View File

@@ -23,10 +23,10 @@ import wx.lib.mixins.inspection
import sys, os
# stuff for debugging
print("Python " + sys.version)
print("wx.version: " + wx.version())
print("pid: " + str(os.getpid()))
##print "executable:", sys.executable; raw_input("Press Enter...")
print("Python", sys.version)
print("wx.version:", wx.version())
print("pid:", os.getpid())
##print("executable:", sys.executable; raw_input("Press Enter..."))
assertMode = wx.APP_ASSERT_DIALOG
##assertMode = wx.APP_ASSERT_EXCEPTION
@@ -146,7 +146,7 @@ def main(argv):
break
if len(argv) < 2:
print "Please specify a demo module name on the command-line"
print("Please specify a demo module name on the command-line")
raise SystemExit
# ensure the CWD is the demo folder
@@ -156,6 +156,7 @@ def main(argv):
name, ext = os.path.splitext(argv[1])
module = __import__(name)
app = RunDemoApp(name, module, useShell)
app.MainLoop()