diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-01-03 15:29:41 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-01-07 22:14:56 +0900 |
commit | 4ce11cc30df1805459a615960fdec204a975548a (patch) | |
tree | 084f1e1fa404bdf0d082b1a58acf392b5d177326 /examples/pytde-sampler/dialogs/msgbox.py | |
parent | 065f41b4908b11278d4334e8c85150ec0fd4a9f6 (diff) | |
download | pytde-4ce11cc30df1805459a615960fdec204a975548a.tar.gz pytde-4ce11cc30df1805459a615960fdec204a975548a.zip |
Drop python2 support.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'examples/pytde-sampler/dialogs/msgbox.py')
-rw-r--r-- | examples/pytde-sampler/dialogs/msgbox.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/examples/pytde-sampler/dialogs/msgbox.py b/examples/pytde-sampler/dialogs/msgbox.py index 93f0d24..1ccfe3a 100644 --- a/examples/pytde-sampler/dialogs/msgbox.py +++ b/examples/pytde-sampler/dialogs/msgbox.py @@ -3,7 +3,7 @@ labelText = 'KMessageBox' from random import random from traceback import print_exc -from StringIO import StringIO +from io import StringIO from PyTQt.qt import TQFrame, TQGridLayout, TQLabel, TQStringList, SIGNAL from tdecore import i18n @@ -87,11 +87,11 @@ class MainFrame(TQFrame): def questionYesNo(self): dlg = KMessageBox.questionYesNo(self, self.msg, self.caption) - print 'You pressed "%s"' % (self.responses.get(dlg, dlg), ) + print('You pressed "%s"' % (self.responses.get(dlg, dlg), )) def warningYesNoCancel(self): dlg = KMessageBox.warningYesNoCancel(self, self.msg, self.caption) - print 'You pressed "%s"' % (self.responses.get(dlg, dlg), ) + print('You pressed "%s"' % (self.responses.get(dlg, dlg), )) def warningContinueCancelList(self): uiitem = KGuiItem('Time to Eat', 'favorites') @@ -99,43 +99,43 @@ class MainFrame(TQFrame): dlgid = '%s' % random() args = self, self.msg, self.items, self.caption, uiitem, dlgid dlg = ctor(*args) - print 'You pressed "%s"' % (self.responses.get(dlg, dlg), ) + print('You pressed "%s"' % (self.responses.get(dlg, dlg), )) def error(self): dlg = KMessageBox.error(self, self.err) - print 'You pressed "%s"' % (self.responses.get(dlg, dlg), ) + print('You pressed "%s"' % (self.responses.get(dlg, dlg), )) def detailedError(self): try: x = self.thisAttributeDoesNotExist - except (AttributeError, ), ex: + except (AttributeError, ) as ex: handle = StringIO() print_exc(0, handle) details = handle.getvalue() dlg = KMessageBox.detailedError(self, self.err, details) - print 'You pressed "%s"' % (self.responses.get(dlg, dlg), ) + print('You pressed "%s"' % (self.responses.get(dlg, dlg), )) def sorry(self): dlg = KMessageBox.sorry(self, self.err) - print 'You pressed "%s"' % (self.responses.get(dlg, dlg), ) + print('You pressed "%s"' % (self.responses.get(dlg, dlg), )) def detailedSorry(self): try: x = self.thisAttributeDoesNotExist - except (AttributeError, ), ex: + except (AttributeError, ) as ex: handle = StringIO() print_exc(0, handle) details = handle.getvalue() dlg = KMessageBox.detailedSorry(self, self.err, details) - print 'You pressed "%s"' % (self.responses.get(dlg, dlg), ) + print('You pressed "%s"' % (self.responses.get(dlg, dlg), )) def information(self): dlgid = '%s' % random() dlg = KMessageBox.information(self, self.info, '', dlgid) - print 'You pressed "%s"' % (self.responses.get(dlg, dlg), ) + print('You pressed "%s"' % (self.responses.get(dlg, dlg), )) def informationList(self): dlgid = '%s' % random() ctor = KMessageBox.informationList dlg = ctor(self, self.info, self.items, '', dlgid) - print 'You pressed "%s"' % (self.responses.get(dlg, dlg), ) + print('You pressed "%s"' % (self.responses.get(dlg, dlg), )) |