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/uisampler.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/uisampler.py')
-rw-r--r-- | examples/uisampler.py | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/examples/uisampler.py b/examples/uisampler.py index 3465f02..76bff2a 100644 --- a/examples/uisampler.py +++ b/examples/uisampler.py @@ -12,9 +12,6 @@ from uimenus import * from uixml import * from uimisc import * -False = 0 -True = not False - listItems = {"Dialogs": {"TDEAboutDialog": ["TDEAboutApplication", "TDEAboutContainer", "KImageTrackLabel",\ "TDEAboutContainerBase", "TDEAboutContributor", "TDEAboutWidget"],\ @@ -125,7 +122,7 @@ prefix = {"Dialogs": "dlg", "Widgets": "wid", "XML": "xml", "Menus/Toolbars": "m mainGeom = TQRect (0, 0, 640, 500) treeWidth = 220 -blankMsg = """ UISampler - provides examples of PyKDE widgets +blankMsg = """ UISampler - provides examples of PyTDE widgets Select a dialog/widget/menu/etc example from the tree at left """ @@ -133,9 +130,9 @@ Select a dialog/widget/menu/etc example from the tree at left class MainWin (TDEMainWindow): def __init__ (self, *args): - apply (TDEMainWindow.__init__, (self,) + args) + TDEMainWindow.__init__(*(self,) + args) - self.setCaption ("Samples of PyKDE widget usage") + self.setCaption ("Samples of PyTDE widget usage") self.setGeometry (mainGeom) # create the main view - list view on the left and an @@ -174,10 +171,10 @@ class MainWin (TDEMainWindow): self.mainView.setSizes ([treeWidth, 375]) self.tree.setRootIsDecorated (True) self.tree.setVScrollBarMode (TQScrollView.AlwaysOn) - topLevel = listItems.keys () + topLevel = list(listItems.keys ()) for item_1 in topLevel: parent = TQListViewItem (self.tree, item_1) - secondLevel = listItems [item_1].keys () + secondLevel = list(listItems [item_1].keys ()) for item_2 in secondLevel: child = TQListViewItem (parent, item_2) for item_3 in listItems [item_1][item_2]: @@ -187,11 +184,11 @@ class MainWin (TDEMainWindow): if not lvItem: return - if lvItem.text (0).latin1 () in listItems.keys (): + if lvItem.text (0).latin1 () in list(listItems.keys ()): return p = lvItem.parent () - if p.text (0).latin1 () in listItems.keys (): + if p.text (0).latin1 () in list(listItems.keys ()): pfx = prefix [p.text (0).latin1 ()] funcCall = pfx + lvItem.text (0).latin1 () + "(self)" else: @@ -219,9 +216,9 @@ class MainWin (TDEMainWindow): #-------------------- main ------------------------------------------------ -appName = "UISampler" +appName = b"UISampler" app = TDEApplication (sys.argv, appName) -mainWindow = MainWin (None, "main window") +mainWindow = MainWin (None, b"main window") mainWindow.show() app.exec_loop() |