mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-12-16 09:40:07 +01:00
remove usage of six.print_()
This commit is contained in:
committed by
Scott Talbert
parent
5abeba2f5d
commit
beb9932241
@@ -1,5 +1,6 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import wx
|
||||
from six import print_
|
||||
import os
|
||||
|
||||
FONTSIZE = 10
|
||||
@@ -180,7 +181,7 @@ class PrintFrameworkSample(wx.Frame):
|
||||
data = dlg.GetPageSetupData()
|
||||
self.pdata = wx.PrintData(data.GetPrintData()) # force a copy
|
||||
self.pdata.SetPaperId(data.GetPaperId())
|
||||
#print_("paperID %r, paperSize %r" % (self.pdata.GetPaperId(), self.pdata.GetPaperSize()))
|
||||
#print("paperID %r, paperSize %r" % (self.pdata.GetPaperId(), self.pdata.GetPaperSize()))
|
||||
self.margins = (data.GetMarginTopLeft(),
|
||||
data.GetMarginBottomRight())
|
||||
dlg.Destroy()
|
||||
@@ -226,20 +227,20 @@ class PrintFrameworkSample(wx.Frame):
|
||||
dlg = wx.PrintDialog(self, data)
|
||||
if dlg.ShowModal() == wx.ID_OK:
|
||||
data = dlg.GetPrintDialogData()
|
||||
print_()
|
||||
print_("GetFromPage:", data.GetFromPage())
|
||||
print_("GetToPage:", data.GetToPage())
|
||||
print_("GetMinPage:", data.GetMinPage())
|
||||
print_("GetMaxPage:", data.GetMaxPage())
|
||||
print_("GetNoCopies:", data.GetNoCopies())
|
||||
print_("GetAllPages:", data.GetAllPages())
|
||||
print_("GetSelection:", data.GetSelection())
|
||||
print_("GetCollate:", data.GetCollate())
|
||||
print_("GetPrintToFile:", data.GetPrintToFile())
|
||||
print()
|
||||
print("GetFromPage:", data.GetFromPage())
|
||||
print("GetToPage:", data.GetToPage())
|
||||
print("GetMinPage:", data.GetMinPage())
|
||||
print("GetMaxPage:", data.GetMaxPage())
|
||||
print("GetNoCopies:", data.GetNoCopies())
|
||||
print("GetAllPages:", data.GetAllPages())
|
||||
print("GetSelection:", data.GetSelection())
|
||||
print("GetCollate:", data.GetCollate())
|
||||
print("GetPrintToFile:", data.GetPrintToFile())
|
||||
|
||||
self.pdata = wx.PrintData(data.GetPrintData())
|
||||
print_()
|
||||
print_("GetPrinterName:", self.pdata.GetPrinterName())
|
||||
print()
|
||||
print("GetPrinterName:", self.pdata.GetPrinterName())
|
||||
|
||||
dlg.Destroy()
|
||||
|
||||
|
||||
@@ -36,8 +36,9 @@
|
||||
# ideal Roses program should be, however, callers are welcome to assert their
|
||||
# independence, override defaults, ignore features, etc.
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
from math import sin, cos, pi
|
||||
from six import print_
|
||||
|
||||
# Rose class knows about:
|
||||
# > Generating points and vectors (returning data as a list of points)
|
||||
@@ -151,7 +152,7 @@ class rose:
|
||||
# update parameters or stop.
|
||||
def restart(self):
|
||||
if self.verbose:
|
||||
print_('restart: int_state', self.int_state, 'cmd_state', self.cmd_state)
|
||||
print('restart: int_state', self.int_state, 'cmd_state', self.cmd_state)
|
||||
try:
|
||||
tmp = self.sin_table[0]
|
||||
except:
|
||||
@@ -192,7 +193,7 @@ class rose:
|
||||
# before initialization is done.
|
||||
def repaint(self, delay):
|
||||
if self.int_state != self.INT_RESIZE:
|
||||
# print_('repaint after', delay)
|
||||
# print('repaint after', delay)
|
||||
self.int_state = self.INT_RESIZE
|
||||
self.AppCancelTimer()
|
||||
self.AppAfter(delay, self.clock)
|
||||
@@ -264,7 +265,7 @@ class rose:
|
||||
# roses is 0.)
|
||||
def clock(self):
|
||||
if self.int_state == self.INT_IDLE:
|
||||
# print_('clock called in idle state')
|
||||
# print('clock called in idle state')
|
||||
delay = 0
|
||||
elif self.int_state == self.INT_DRAW:
|
||||
line, run = self.roselet()
|
||||
@@ -295,7 +296,7 @@ class rose:
|
||||
|
||||
if delay == 0:
|
||||
if self.verbose:
|
||||
print_('clock: going idle from state', self.int_state)
|
||||
print('clock: going idle from state', self.int_state)
|
||||
else:
|
||||
self.AppAfter(delay, self.clock)
|
||||
|
||||
|
||||
@@ -68,10 +68,11 @@
|
||||
# control the display (without blocking the user's control) would be pretty
|
||||
# straightforward.
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import wx
|
||||
import clroses
|
||||
import wx.lib.colourselect as cs
|
||||
from six import print_
|
||||
|
||||
# Class SpinPanel creates a control that includes both a StaticText widget
|
||||
# which holds the the name of a parameter and a SpinCtrl widget which
|
||||
@@ -109,7 +110,7 @@ class SpinPanel(wx.Panel):
|
||||
name = self.st.GetLabel()
|
||||
value = self.sc.GetValue()
|
||||
if verbose:
|
||||
print_('OnSpin', name, '=', value)
|
||||
print('OnSpin', name, '=', value)
|
||||
self.callback(name, value) # Call MyFrame.OnSpinback to call clroses
|
||||
|
||||
|
||||
@@ -372,10 +373,10 @@ class MyFrame(wx.Frame, clroses.rose):
|
||||
h = max(600, fh) # Change 600 to desired minimum size
|
||||
w = h + fw - rw
|
||||
if verbose:
|
||||
print_('rose panel size', (rw, rh))
|
||||
print_('side panel size', (sw, sh))
|
||||
print_(' frame size', (fw, fh))
|
||||
print_('Want size', (w,h))
|
||||
print('rose panel size', (rw, rh))
|
||||
print('side panel size', (sw, sh))
|
||||
print(' frame size', (fw, fh))
|
||||
print('Want size', (w,h))
|
||||
self.SetSize((w, h))
|
||||
self.SupplyControlValues() # Ask clroses to tell us all the defaults
|
||||
self.Show()
|
||||
@@ -386,25 +387,25 @@ class MyFrame(wx.Frame, clroses.rose):
|
||||
# Go/Stop button
|
||||
def OnGoStop(self, event):
|
||||
if verbose:
|
||||
print_('OnGoStop')
|
||||
print('OnGoStop')
|
||||
self.cmd_go_stop()
|
||||
|
||||
# Redraw/Redraw
|
||||
def OnRedraw(self, event):
|
||||
if verbose:
|
||||
print_('OnRedraw')
|
||||
print('OnRedraw')
|
||||
self.cmd_redraw()
|
||||
|
||||
# Backward/Reverse
|
||||
def OnBackward(self, event):
|
||||
if verbose:
|
||||
print_('OnBackward')
|
||||
print('OnBackward')
|
||||
self.cmd_backward()
|
||||
|
||||
# Forward/Skip
|
||||
def OnForward(self, event):
|
||||
if verbose:
|
||||
print_('OnForward')
|
||||
print('OnForward')
|
||||
self.cmd_step()
|
||||
|
||||
|
||||
@@ -415,7 +416,7 @@ class MyFrame(wx.Frame, clroses.rose):
|
||||
|
||||
def AppClear(self):
|
||||
if verbose:
|
||||
print_('AppClear: clear screen')
|
||||
print('AppClear: clear screen')
|
||||
self.rose_panel.Clear()
|
||||
|
||||
def AppCreateLine(self, line):
|
||||
@@ -467,8 +468,8 @@ class MyFrame(wx.Frame, clroses.rose):
|
||||
# Method to provide a single callback after some amount of time.
|
||||
def AppAfter(self, msec, callback):
|
||||
if self.timer_callback:
|
||||
print_('AppAfter: timer_callback already set!')
|
||||
# print_('AppAfter:', callback)
|
||||
print('AppAfter: timer_callback already set!')
|
||||
# print('AppAfter:', callback)
|
||||
self.timer_callback = callback
|
||||
self.timer.Start(msec, True)
|
||||
|
||||
@@ -476,14 +477,14 @@ class MyFrame(wx.Frame, clroses.rose):
|
||||
# interest in.
|
||||
def AppCancelTimer(self):
|
||||
self.timer.Stop()
|
||||
# print_('AppCancelTimer')
|
||||
# print('AppCancelTimer')
|
||||
self.timer_callback = None
|
||||
|
||||
# When the timer happens, we come here and jump off to clroses internal code.
|
||||
def OnTimer(self, evt):
|
||||
callback = self.timer_callback
|
||||
self.timer_callback = None
|
||||
# print_('OnTimer,', callback)
|
||||
# print('OnTimer,', callback)
|
||||
if callback:
|
||||
callback() # Often calls AppAfter() and sets the callback
|
||||
else:
|
||||
@@ -502,7 +503,7 @@ class MyFrame(wx.Frame, clroses.rose):
|
||||
# Called when data in spin boxes changes.
|
||||
def OnSpinback(self, name, value):
|
||||
if verbose:
|
||||
print_('OnSpinback', name, value)
|
||||
print('OnSpinback', name, value)
|
||||
if name == 'Style':
|
||||
self.SetStyle(value)
|
||||
elif name == 'Sincr':
|
||||
@@ -530,7 +531,7 @@ class MyFrame(wx.Frame, clroses.rose):
|
||||
elif name == 'Delay':
|
||||
self.SetWaitDelay(value)
|
||||
else:
|
||||
print_('OnSpinback: Don\'t recognize', name)
|
||||
print('OnSpinback: Don\'t recognize', name)
|
||||
|
||||
verbose = 0 # Need some command line options...
|
||||
spin_panels = {} # Hooks to get from rose to panel labels
|
||||
@@ -539,6 +540,6 @@ ctrl_buttons = {} # Button widgets for command (NE) panel
|
||||
app = wx.App(False)
|
||||
MyFrame()
|
||||
if verbose:
|
||||
print_('spin_panels', list(spin_panels))
|
||||
print_('ctrl_buttons', list(ctrl_buttons))
|
||||
print('spin_panels', list(spin_panels))
|
||||
print('ctrl_buttons', list(ctrl_buttons))
|
||||
app.MainLoop()
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import wx
|
||||
from six import print_
|
||||
|
||||
print_(wx.version())
|
||||
#import os; print_('PID:', os.getpid()); raw_input('Ready to start, press enter...')
|
||||
print(wx.version())
|
||||
#import os; print('PID:', os.getpid()); raw_input('Ready to start, press enter...')
|
||||
|
||||
|
||||
class MyFrame(wx.Frame):
|
||||
@@ -13,21 +13,21 @@ class MyFrame(wx.Frame):
|
||||
wx.CallAfter(self.after, 1, 2, 3)
|
||||
|
||||
def after(self, a, b, c):
|
||||
print_('Called via wx.CallAfter:', a, b, c)
|
||||
print('Called via wx.CallAfter:', a, b, c)
|
||||
|
||||
def onSize(self, evt):
|
||||
print_(repr(evt.Size))
|
||||
print(repr(evt.Size))
|
||||
evt.Skip()
|
||||
|
||||
class MyApp(wx.App):
|
||||
def OnInit(self):
|
||||
print_('OnInit')
|
||||
print('OnInit')
|
||||
frm = MyFrame(None, title="Hello with Events", size=(480,360))
|
||||
frm.Show()
|
||||
return True
|
||||
|
||||
def OnExit(self):
|
||||
print_('OnExit')
|
||||
print('OnExit')
|
||||
return 0
|
||||
|
||||
app = MyApp()
|
||||
|
||||
Reference in New Issue
Block a user