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/xmlmenudemo.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/xmlmenudemo.py')
-rw-r--r-- | examples/xmlmenudemo.py | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/examples/xmlmenudemo.py b/examples/xmlmenudemo.py index 9eacb37..ce92bd3 100644 --- a/examples/xmlmenudemo.py +++ b/examples/xmlmenudemo.py @@ -1,6 +1,6 @@ """ This template constructs an application with menus, toolbar and statusbar. -It uses KDE classes and methods that simplify the task of building and +It uses TDE classes and methods that simplify the task of building and operating a GUI. It is recommended that this approach be used, rather than the primitive approach in menuapp1.py """ @@ -35,10 +35,6 @@ copyright holder. """ -False = 0 -True = not False - - import sys, os from PyTQt.qt import TQPopupMenu, SIGNAL, TQLabel, TQIconSet @@ -53,7 +49,7 @@ STATUSBAR_RIGHT = 3 class MainWin (TDEMainWindow): def __init__ (self, *args): - apply (TDEMainWindow.__init__, (self,) + args) + TDEMainWindow.__init__(self, *args) self.initActions () self.setGeometry (0, 0, 350, 200) @@ -143,8 +139,8 @@ class MainWin (TDEMainWindow): # By using KStdAction here, the XMLGUI mechanism will automatically # create a 'View' menu and insert "Zoom In" and "Zoom Out" objects # in it. This happens because before parsing our *ui.rc file, - # the standard KDE file config/ui/ui_standards.rc is parsed, and - # then our *ui.rc file is merged with the result - this gives KDE + # the standard TDE file config/ui/ui_standards.rc is parsed, and + # then our *ui.rc file is merged with the result - this gives TDE # menus and toolBars a standard "look" and item placement (including # separators). Creating the KStdActions alone is sufficient - you # could delete their references from the *ui.rc file and the menu @@ -268,24 +264,23 @@ class MainWin (TDEMainWindow): #-------------------- main ------------------------------------------------ -description = "A basic application template" -version = "1.0" - +description = b"A basic application template" +version = b"1.0" # The appName (xmlmenudemo - first argument) is required # if the program is to automatically locate it *ui.rc file -aboutData = TDEAboutData ("xmlmenudemo", "xmlmenudemo",\ +aboutData = TDEAboutData (b"xmlmenudemo", b"xmlmenudemo",\ version, description, TDEAboutData.License_GPL,\ - "(C) 2003 whoever the author is") + b"(C) 2003 whoever the author is") -aboutData.addAuthor ("author1", "whatever they did", "email@somedomain") -aboutData.addAuthor ("author2", "they did something else", "another@email.address") +aboutData.addAuthor (b"author1", b"whatever they did", b"email@somedomain") +aboutData.addAuthor (b"author2", b"they did something else", b"another@email.address") mainpath = os.path.dirname (os.path.abspath (sys.argv[0])) -TDECmdLineArgs.init (sys.argv, aboutData) -TDECmdLineArgs.addCmdLineOptions ([("+files", "File to open")]) +TDECmdLineArgs.init (sys.argv, aboutData) +TDECmdLineArgs.addCmdLineOptions ([(b"+files", b"File to open")]) app = TDEApplication () -mainWindow = MainWin (None, "main window") +mainWindow = MainWin (None, b"main window") mainWindow.show() app.exec_loop() |