@@ -66,7 +66,7 @@ object Form1: TForm1
6666 ' self.Height = 400'
6767 ''
6868 ' def btnCloseClick(self, Sender):'
69- ' print "Close!"'
69+ ' print( "Close!") '
7070 ' self.Close()'
7171 ''
7272 ' def MyFormCloseQuery(self, Sender, CanClose):'
@@ -78,7 +78,7 @@ object Form1: TForm1
7878 ' def grdTestDrawCell(self, Sender, Col, Row, Rect, State):'
7979 ' if gdSelected in State:'
8080 ' Sender.Canvas.Brush.Color = clBlue # 0x00ff0000 # blue'
81- ' print "Cell[%d, %d] is selected, Rect=%s, State=%s" % (Col, Row, Rect, State)'
81+ ' print( "Cell[%d, %d] is selected, Rect=%s, State=%s" % (Col, Row, Rect, State) )'
8282 ' Sender.Canvas.TextRect(Rect, Rect.Left+2, Rect.Top+2, "%d @ %d" % (Col, Row))'
8383 ''
8484 ' def grdTestSelectCell(self, Sender, Col, Row, CanSelect):'
@@ -102,8 +102,8 @@ object Form1: TForm1
102102 ' self.assertEqual(DVar.IValue, 70)'
103103 ' MainForm.Caption = ''PyDelphi rocks!'' #setting properties'
104104 ' self.assertEqual(MainForm.Caption, ''PyDelphi rocks!'')'
105- ' print'
106- ' print ''MainForm.ActiveControl='', MainForm.ActiveControl # class properties'
105+ ' print() '
106+ ' print( ''MainForm.ActiveControl='', MainForm.ActiveControl # class properties) '
107107 ' MainForm.BorderStyle = ''bsSizeable'' #enumeration property'
108108 ' MainForm.Anchors = [''akTop'', ''akLeft''] #set property'
109109 ' self.assertEqual(MainForm.Anchors, [''akTop'', ''akLeft''])'
@@ -117,23 +117,23 @@ object Form1: TForm1
117117 ' DVar.SetMeUp(''Age'', 25)'
118118 ' self.assertEqual(DVar.SValue, ''Age'')'
119119 ' self.assertEqual(DVar.IValue, 25)'
120- ' print'
121- ' print DVar.DescribeMe() #method calls'
120+ ' print() '
121+ ' print( DVar.DescribeMe() #method calls) '
122122 ''
123123 ' def testRepr(self):'
124- ' print'
125- ' print ''Representation of Delphi objects'''
126- ' print DVar'
127- ' print MainForm'
124+ ' print() '
125+ ' print( ''Representation of Delphi objects'') '
126+ ' print( DVar) '
127+ ' print( MainForm) '
128128 ' if DelphiVersion >= 7:'
129- ' print DVar.DescribeMe # method object'
130- ' print DVar.SL # TStrings'
129+ ' print( DVar.DescribeMe # method object) '
130+ ' print( DVar.SL # TStrings) '
131131 ''
132132 ' def testTStrings(self):'
133133 ' SL = DVar.SL'
134134 ' self.assertEqual(len(SL), 2)'
135- ' print'
136- ' for i in DVar.SL: print i, '' contains '', DVar.SL[i]'
135+ ' print() '
136+ ' for i in DVar.SL: print( i, '' contains '', DVar.SL[i]) '
137137 ' SL.Add(''New String'')'
138138 ' self.assertEqual(len(SL), 3)'
139139 ' self.assertEqual(SL.IndexOf(''New String''), 2)'
@@ -148,7 +148,7 @@ object Form1: TForm1
148148 ' self.assertEqual(MainForm in SL.Objects, True)'
149149 ' SL.Delete(2)'
150150 ' self.assertEqual(len(SL), 2)'
151- ' print "str(SL) =", str(SL)'
151+ ' print( "str(SL) =", str(SL) )'
152152 ' SL.Assign([1, 2, 3])'
153153 ' self.assertEqual(len(SL), 3)'
154154 ' self.assertEqual(''2'' in SL, True)'
@@ -180,7 +180,7 @@ object Form1: TForm1
180180 ' self.assertEqual(MainForm.Button1.Caption, ''Click me!!!!'')'
181181 ' # Test Owner property and DelphiObject comparison'
182182 ' self.assert_(MainForm.Button1.Owner == MainForm)'
183- ' print [i.Name for i in MainForm.Components]'
183+ ' print( [i.Name for i in MainForm.Components]) '
184184 ''
185185 ' def testCreateComponent(self):'
186186 ' NewButton = CreateComponent(''TButton'', None)'
@@ -191,9 +191,9 @@ object Form1: TForm1
191191 ''
192192 ' def testWinControls(self):'
193193 ' self.assertEqual(MainForm.Panel1.Parent, MainForm)'
194- ' print'
195- ' print ''MainForm contains '', MainForm.ControlCount, '' controls'''
196- ' print [i.Name for i in MainForm.Controls]'
194+ ' print() '
195+ ' print( ''MainForm contains '', MainForm.ControlCount, '' controls'') '
196+ ' print( [i.Name for i in MainForm.Controls]) '
197197 ''
198198 ' def testForm(self):'
199199 ' MyForm = CreateComponent(''TForm'', None)'
@@ -246,7 +246,7 @@ object Form1: TForm1
246246 ' B2.ModalResult = mrOk'
247247 ' B2.TabOrder = 3'
248248 ' def ClickHandler(Sender):'
249- ' print Sender.Name, '' was clicked'''
249+ ' print( Sender.Name, '' was clicked'') '
250250 ' LB.Items.Add(Edit.Text)'
251251 ' B1.OnClick = ClickHandler'
252252 ' def KeyPressHandler(Sender, Key):'
@@ -302,29 +302,29 @@ object Form1: TForm1
302302 ' def testFormSubclass(self):'
303303 ' f = MyForm(Application)'
304304 ' try:'
305- ' print f.ShowModal()'
305+ ' print( f.ShowModal() )'
306306 ' finally:'
307307 ' f.Free()'
308308 ''
309309 ' def testFormSubclass2(self):'
310310 ' f = TTestForm(Application)'
311311 ' try:'
312- ' print f.ShowModal()'
312+ ' print( f.ShowModal() )'
313313 ' finally:'
314314 ' f.Free()'
315315 ''
316316 ' def testPointConversions(self):'
317317 ' p1 = Point(10, 10)'
318318 ' p = MainForm.ClientToScreen(p1)'
319- ' print p '
319+ ' print(p) '
320320 ' p2 = MainForm.ScreenToClient(p)'
321321 ' self.assertEqual(p2.X, p1.X)'
322322 ' self.assertEqual(p2.Y, p1.Y)'
323323 ''
324324 ' def testObjectNotification(self):'
325325 ' DVar.IValue = 0'
326326 ' def ChangeHandler(Sender):'
327- ' print Sender'
327+ ' print( Sender) '
328328 ' Sender.IValue = 55'
329329 ' DVar.OnChange = ChangeHandler'
330330 ' if DelphiVersion >= 7:'
@@ -343,7 +343,7 @@ object Form1: TForm1
343343 ' MainForm.actTest.Execute()'
344344 ' self.assertEqual(DVar.IValue, 1)'
345345 ' def ActionHandler(Sender):'
346- ' print "Action", Sender.Name, "executed from Python"'
346+ ' print( "Action", Sender.Name, "executed from Python") '
347347 ' DVar.IValue = 2'
348348 ' self.assertEqual(MainForm.actTest.OnExecute, None)'
349349 ' MainForm.actTest.OnExecute = ActionHandler'
@@ -371,8 +371,8 @@ object Form1: TForm1
371371 ' MainForm.Button1.SetFocus()'
372372 ' self.assertEqual(Screen.ActiveControl, MainForm.Button1)'
373373 ' def ActiveControlChangeHandler(Sender):'
374- ' print "ActiveControlChangeHandler fired"'
375- ' print "New active constrol is", Sender.ActiveControl.Name'
374+ ' print( "ActiveControlChangeHandler fired") '
375+ ' print( "New active constrol is", Sender.ActiveControl.Name) '
376376 ' DVar.IValue = 2'
377377 ' self.assertEqual(Screen.OnActiveControlChange, None)'
378378 ' Screen.OnActiveControlChange = ActiveControlChangeHandler'
0 commit comments