From 4ce11cc30df1805459a615960fdec204a975548a Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Tue, 3 Jan 2023 15:29:41 +0900 Subject: Drop python2 support. Signed-off-by: Michele Calgaro --- examples/mimetype.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'examples/mimetype.py') diff --git a/examples/mimetype.py b/examples/mimetype.py index 044bc7a..26fbe7f 100644 --- a/examples/mimetype.py +++ b/examples/mimetype.py @@ -4,8 +4,6 @@ methods (KMimeType, KService, etc). It generally tests the *::List methods for these classes (eg KService::List) since that also tests the *::Ptr mapped type code (eg KService::Ptr) at the same time. -This version is suitable for KDE >= 3.0.0 (some methods not available -in earlier versions) """ """ @@ -47,7 +45,7 @@ from tdeio import KMimeType, KService, KServiceGroup, KServiceType, TDETrader, K class MainWin (TDEMainWindow): def __init__ (self, *args): - apply (TDEMainWindow.__init__, (self,) + args) + TDEMainWindow.__init__(*(self,) + args) tabctl = KTabCtl (self) self.setGeometry (0, 0, 600, 400) @@ -88,7 +86,7 @@ class OfferListTab (TQWidget): trader = TDETrader.self () slist = trader.query ("image/jpeg", "Type == 'Application'") - print "TDETrader returned:", slist + print("TDETrader returned:", slist) for s in slist: lvi = TQListViewItem (lv, s.type_ (), s.name (), s.exec_ (), s.library ()) @@ -253,16 +251,16 @@ class KMimeTypeTab (TQWidget): #-------------------- main ------------------------------------------------ -description = "Test/demo TDESharedPtr related methods/classes" -version = "1.0" -aboutData = TDEAboutData ("", "",\ + +description = b"Test/demo TDESharedPtr related methods/classes" +version = b"1.0" +aboutData = TDEAboutData (b"MyApp", b"MyApp",\ version, description, TDEAboutData.License_GPL,\ - "(C) 2003 Jim Bublitz") + b"(C) 2003 Jim Bublitz") TDECmdLineArgs.init (sys.argv, aboutData) -TDECmdLineArgs.addCmdLineOptions ([("+files", "File to open")]) - +TDECmdLineArgs.addCmdLineOptions ([(b"+files", b"File to open")]) app = TDEApplication () mainWindow = MainWin (None, "main window") mainWindow.show() -- cgit v1.2.3