summaryrefslogtreecommitdiffstats
path: root/examples/pytde-sampler
diff options
context:
space:
mode:
Diffstat (limited to 'examples/pytde-sampler')
-rw-r--r--examples/pytde-sampler/HOWTO.samples6
-rw-r--r--examples/pytde-sampler/about.py20
-rw-r--r--examples/pytde-sampler/basic_widgets/__init__.py2
-rw-r--r--examples/pytde-sampler/basic_widgets/historycombo.py2
-rw-r--r--examples/pytde-sampler/contributors.txt2
-rw-r--r--examples/pytde-sampler/dialogs/__init__.py2
-rw-r--r--examples/pytde-sampler/dialogs/about/__init__.py2
-rw-r--r--examples/pytde-sampler/dialogs/about/abouttde.py (renamed from examples/pytde-sampler/dialogs/about/aboutkde.py)6
-rw-r--r--examples/pytde-sampler/dialogs/bugreport.py4
-rw-r--r--examples/pytde-sampler/dialogs/color.py2
-rw-r--r--examples/pytde-sampler/dialogs/edfind.py12
-rw-r--r--examples/pytde-sampler/dialogs/edreplace.py12
-rw-r--r--examples/pytde-sampler/dialogs/font.py2
-rw-r--r--examples/pytde-sampler/dialogs/msgbox.py24
-rw-r--r--examples/pytde-sampler/dialogs/passwd.py2
-rw-r--r--examples/pytde-sampler/dialogs/progress.py2
-rw-r--r--examples/pytde-sampler/dialogs/tip.py2
-rw-r--r--examples/pytde-sampler/dialogs/tips8
-rw-r--r--examples/pytde-sampler/gen_todo.py4
-rw-r--r--examples/pytde-sampler/icon_handling/__init__.py2
-rw-r--r--examples/pytde-sampler/icon_handling/misc.py2
-rw-r--r--examples/pytde-sampler/lib.py4
-rw-r--r--examples/pytde-sampler/misc/window_info.py8
-rw-r--r--examples/pytde-sampler/qt_widgets/CONTRIB2
-rw-r--r--examples/pytde-sampler/qt_widgets/table.py2
-rwxr-xr-xexamples/pytde-sampler/runner.py19
-rwxr-xr-xexamples/pytde-sampler/sampler.py33
-rw-r--r--examples/pytde-sampler/wizards/__init__.py2
-rw-r--r--examples/pytde-sampler/wizards/wiz.py2
-rw-r--r--examples/pytde-sampler/xwin/__init__.py2
30 files changed, 98 insertions, 96 deletions
diff --git a/examples/pytde-sampler/HOWTO.samples b/examples/pytde-sampler/HOWTO.samples
index 8006eb4..18b3f4b 100644
--- a/examples/pytde-sampler/HOWTO.samples
+++ b/examples/pytde-sampler/HOWTO.samples
@@ -1,4 +1,4 @@
-How to Write Samples for the PyKDE Sampler
+How to Write Samples for the PyTDE Sampler
==========================================
@@ -12,11 +12,11 @@ In side the module, add the following:
default: 'filenew'
example: 'colorize'
- When supplied, this should be the short name of a KDE icon, such as
+ When supplied, this should be the short name of a TDE icon, such as
'stop', 'editclear', etc. If available, This icon will be used as
the list item's icon in the sampler. Not all icons are available in
all themes, so try to use the icons that are available in the
- default KDE installation.
+ default TDE installation.
- labelText - string (optional)
diff --git a/examples/pytde-sampler/about.py b/examples/pytde-sampler/about.py
index f675b1c..c58de92 100644
--- a/examples/pytde-sampler/about.py
+++ b/examples/pytde-sampler/about.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-""" About the PyKDE Sampler
+""" About the PyTDE Sampler
Defines the 'about' function to create a TDEAboutData instance for the
sampler application.
@@ -8,16 +8,16 @@ from os.path import dirname, join
from tdecore import TDEAboutData
-appName = 'pytdesampler'
-progName = 'PyKDE Sampler'
-authorName = 'Troy Melhase'
-authorEmail = bugsEmailAddress = 'troy@gci.net'
-version = '0.1'
-shortDescription = 'The PyKDE Sampler'
+appName = b'pytdesampler'
+progName = b'PyTDE Sampler'
+authorName = b'Troy Melhase'
+authorEmail = bugsEmailAddress = b'troy@gci.net'
+version = b'0.1'
+shortDescription = b'The PyTDE Sampler'
licenseType = TDEAboutData.License_GPL_V2
-copyrightStatement = '(c) 2006, %s' % (authorName, )
-homePageAddress = 'http://www.riverbankcomputing.co.uk/pytde/'
-aboutText = ("The application sampler for PyKDE.")
+copyrightStatement = '(c) 2006, Troy Melhase'
+homePageAddress = b'http://www.riverbankcomputing.co.uk/pytde/'
+aboutText = (b"The application sampler for PyTDE.")
contributors = [] # module-level global for keeping the strings around; intentional
diff --git a/examples/pytde-sampler/basic_widgets/__init__.py b/examples/pytde-sampler/basic_widgets/__init__.py
index 35e708d..014db50 100644
--- a/examples/pytde-sampler/basic_widgets/__init__.py
+++ b/examples/pytde-sampler/basic_widgets/__init__.py
@@ -1,7 +1,7 @@
labelText = 'Widgets'
iconName = 'about_kde'
-helpText = """KDE provides a large set of basic widgets for application use.
+helpText = """TDE provides a large set of basic widgets for application use.
Select the children of this item to see for yourself."""
from PyTQt.qt import TQFrame, TQVBoxLayout
diff --git a/examples/pytde-sampler/basic_widgets/historycombo.py b/examples/pytde-sampler/basic_widgets/historycombo.py
index f0bb8b8..bfca05e 100644
--- a/examples/pytde-sampler/basic_widgets/historycombo.py
+++ b/examples/pytde-sampler/basic_widgets/historycombo.py
@@ -49,5 +49,5 @@ class MainFrame(TQFrame):
self.historySelection.setText)
def historyCleared(self):
- print 'History combo cleared.'
+ print('History combo cleared.')
diff --git a/examples/pytde-sampler/contributors.txt b/examples/pytde-sampler/contributors.txt
index 5063545..0f0e286 100644
--- a/examples/pytde-sampler/contributors.txt
+++ b/examples/pytde-sampler/contributors.txt
@@ -1,4 +1,4 @@
# author, contributions, email
Phil Thompson, For PyTQt and SIP, phil@riverbankcomputing.co.uk
-Jim Bublitz, For PyKDE, jbublitz@nwinternet.com
+Jim Bublitz, For PyTDE, jbublitz@nwinternet.com
diff --git a/examples/pytde-sampler/dialogs/__init__.py b/examples/pytde-sampler/dialogs/__init__.py
index c9c105a..caab63d 100644
--- a/examples/pytde-sampler/dialogs/__init__.py
+++ b/examples/pytde-sampler/dialogs/__init__.py
@@ -2,7 +2,7 @@ labelText = 'Dialog Boxes'
iconName = 'launch'
-helpText = ("KDE provides a convenient set of dialog boxes for application use. "
+helpText = ("TDE provides a convenient set of dialog boxes for application use. "
"Select the children of this item to see for yourself.")
diff --git a/examples/pytde-sampler/dialogs/about/__init__.py b/examples/pytde-sampler/dialogs/about/__init__.py
index 9fd612d..9d0092f 100644
--- a/examples/pytde-sampler/dialogs/about/__init__.py
+++ b/examples/pytde-sampler/dialogs/about/__init__.py
@@ -1,7 +1,7 @@
labelText = 'About Dialogs'
iconName = 'info'
-helpText = ("KDE has multiple dialog types to display information about your "
+helpText = ("TDE has multiple dialog types to display information about your "
"applicaiton and environment. They provide a tremendous amount of functionality "
"and consistency. They're easy to use, and they're good for the environment!")
diff --git a/examples/pytde-sampler/dialogs/about/aboutkde.py b/examples/pytde-sampler/dialogs/about/abouttde.py
index e50c88d..43e354f 100644
--- a/examples/pytde-sampler/dialogs/about/aboutkde.py
+++ b/examples/pytde-sampler/dialogs/about/abouttde.py
@@ -1,5 +1,5 @@
iconName = 'about_kde'
-labelText = 'TDEAboutKDE'
+labelText = 'TDEAboutTDE'
from PyTQt.qt import TQFrame, TQHBoxLayout, TQVBoxLayout, SIGNAL
from tdecore import i18n
@@ -7,13 +7,13 @@ from tdeui import TDEAboutKDE, KPushButton, KTextEdit
helpText = ("Typically available via the applications 'Help' menu, this "
- "dialog presents the user with the standard KDE About dialog.")
+ "dialog presents the user with the standard TDE About dialog.")
class MainFrame(TQFrame):
def __init__(self, parent=None):
TQFrame.__init__(self, parent)
- self.button = KPushButton(i18n('About KDE'), self)
+ self.button = KPushButton(i18n('About TDE'), self)
self.help = KTextEdit(helpText, '', self)
layout = TQVBoxLayout(self, 4)
layout.addWidget(self.help)
diff --git a/examples/pytde-sampler/dialogs/bugreport.py b/examples/pytde-sampler/dialogs/bugreport.py
index b06717c..74fce7e 100644
--- a/examples/pytde-sampler/dialogs/bugreport.py
+++ b/examples/pytde-sampler/dialogs/bugreport.py
@@ -1,7 +1,7 @@
iconName = 'core'
labelText = 'KBugReport'
-##~ if we wanted to, we could define the name of a KDE class used for lookup of
+##~ if we wanted to, we could define the name of a TDE class used for lookup of
##~ the documentation url. The 'labelText' string above already
##~ specifies what we want.
##~ docItemName = 'KBugReport'
@@ -11,7 +11,7 @@ from tdecore import i18n
from tdeui import TDEAboutDialog, KPushButton, KBugReport, KTextEdit
-helpText = ("KDE provides a way to report bugs from applications. This dialog"
+helpText = ("TDE provides a way to report bugs from applications. This dialog"
"is typically available from the application 'Help' menu.")
diff --git a/examples/pytde-sampler/dialogs/color.py b/examples/pytde-sampler/dialogs/color.py
index f9aeb0c..ea567e2 100644
--- a/examples/pytde-sampler/dialogs/color.py
+++ b/examples/pytde-sampler/dialogs/color.py
@@ -7,7 +7,7 @@ from tdecore import i18n
from tdeui import KPushButton, KColorDialog, KColorPatch, KTextEdit
-helpText = ("KDE provides a nifty common color selection dialog."
+helpText = ("TDE provides a nifty common color selection dialog."
"The color selection in the dialog is tracked via a SIGNAL "
"connected to the KColorPatch area below.")
diff --git a/examples/pytde-sampler/dialogs/edfind.py b/examples/pytde-sampler/dialogs/edfind.py
index 46258f5..aff61cb 100644
--- a/examples/pytde-sampler/dialogs/edfind.py
+++ b/examples/pytde-sampler/dialogs/edfind.py
@@ -34,18 +34,18 @@ class MainFrame(TQFrame):
def doneClicked(self):
- print 'done searching'
+ print('done searching')
def searchClicked(self):
- print 'searching: ', self.dlg.getText(),
+ print('searching: ', self.dlg.getText(), end=' ')
if self.dlg.get_direction():
- print '(backwards) ',
+ print('(backwards) ', end=' ')
else:
- print '(forwards) ',
+ print('(forwards) ', end=' ')
if self.dlg.case_sensitive():
- print '(case-sensitive)'
+ print('(case-sensitive)')
else:
- print '(case-insensitive)'
+ print('(case-insensitive)')
diff --git a/examples/pytde-sampler/dialogs/edreplace.py b/examples/pytde-sampler/dialogs/edreplace.py
index 1c4950b..31b03b9 100644
--- a/examples/pytde-sampler/dialogs/edreplace.py
+++ b/examples/pytde-sampler/dialogs/edreplace.py
@@ -33,19 +33,19 @@ class MainFrame(TQFrame):
def doneClicked(self):
- print 'done replacing'
+ print('done replacing')
def replaceClicked(self):
- print 'replacing: ', self.dlg.getText()
+ print('replacing: ', self.dlg.getText())
return
if self.dlg.get_direction():
- print '(backwards) ',
+ print('(backwards) ', end=' ')
else:
- print '(forwards) ',
+ print('(forwards) ', end=' ')
if self.dlg.case_sensitive():
- print '(case-sensitive)'
+ print('(case-sensitive)')
else:
- print '(case-insensitive)'
+ print('(case-insensitive)')
diff --git a/examples/pytde-sampler/dialogs/font.py b/examples/pytde-sampler/dialogs/font.py
index 175817a..298f44f 100644
--- a/examples/pytde-sampler/dialogs/font.py
+++ b/examples/pytde-sampler/dialogs/font.py
@@ -6,7 +6,7 @@ from tdeui import KPushButton, TDEFontDialog, KTextEdit
iconName = 'fonts'
labelText = 'TDEFontDialog'
docParts = ('tdeui', 'TDEFontDialog')
-helpText = ("KDE provides a font dialog box for users to select (can you "
+helpText = ("TDE provides a font dialog box for users to select (can you "
"guess??) fonts. The button below displays a font dialog box. "
"The font of this widget (the text widget you're reading) is used "
"as the default. If the dialog is accepted, the font of this "
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), ))
diff --git a/examples/pytde-sampler/dialogs/passwd.py b/examples/pytde-sampler/dialogs/passwd.py
index 3a7fd29..93d66f9 100644
--- a/examples/pytde-sampler/dialogs/passwd.py
+++ b/examples/pytde-sampler/dialogs/passwd.py
@@ -5,7 +5,7 @@ from tdeui import KPushButton, KPasswordDialog, KTextEdit
iconName = 'password'
labelText = 'KPasswordDialog'
docParts = ('tdeui', 'KPasswordDialog')
-helpText = ("KDE provides two variations on the password dialog. The simple "
+helpText = ("TDE provides two variations on the password dialog. The simple "
"one shown here prompts for a password. The other type allows the "
"user to enter a new password, and provides a second field to "
"confirm the first entry.")
diff --git a/examples/pytde-sampler/dialogs/progress.py b/examples/pytde-sampler/dialogs/progress.py
index f7d69f8..b2ead9a 100644
--- a/examples/pytde-sampler/dialogs/progress.py
+++ b/examples/pytde-sampler/dialogs/progress.py
@@ -7,7 +7,7 @@ from tdecore import i18n
from tdeui import KPushButton, KProgressDialog, KTextEdit
-helpText = """KDE provides a ready-built dialog to display a bit of text and a
+helpText = """TDE provides a ready-built dialog to display a bit of text and a
progress bar."""
diff --git a/examples/pytde-sampler/dialogs/tip.py b/examples/pytde-sampler/dialogs/tip.py
index 15ec50d..2e4fc02 100644
--- a/examples/pytde-sampler/dialogs/tip.py
+++ b/examples/pytde-sampler/dialogs/tip.py
@@ -8,7 +8,7 @@ from tdecore import i18n
from tdeui import KPushButton, KTipDatabase, KTipDialog, KTextEdit
-helpText = ("The KDE standard Tip-of-the-Day dialog.")
+helpText = ("The TDE standard Tip-of-the-Day dialog.")
class MainFrame(TQFrame):
diff --git a/examples/pytde-sampler/dialogs/tips b/examples/pytde-sampler/dialogs/tips
index 9f24457..e0439dc 100644
--- a/examples/pytde-sampler/dialogs/tips
+++ b/examples/pytde-sampler/dialogs/tips
@@ -1,23 +1,23 @@
-<tip category="PyKDE Sampler|General">
+<tip category="PyTDE Sampler|General">
<html>
<p>Don't tug on Superman's cape.</p>
</html>
</tip>
-<tip category="PyKDE Sampler|General">
+<tip category="PyTDE Sampler|General">
<html>
<p>Don't spit into the wind.</p>
</html>
</tip>
-<tip category="PyKDE Sampler|General">
+<tip category="PyTDE Sampler|General">
<html>
<p>Don't pull the mask off the Lone Ranger.</p>
</html>
</tip>
-<tip category="PyKDE Sampler|General">
+<tip category="PyTDE Sampler|General">
<html>
<p>And don't mess around with <em>Jim</em>!</p>
</html>
diff --git a/examples/pytde-sampler/gen_todo.py b/examples/pytde-sampler/gen_todo.py
index 0fc60c4..fa48137 100644
--- a/examples/pytde-sampler/gen_todo.py
+++ b/examples/pytde-sampler/gen_todo.py
@@ -2,7 +2,7 @@ mods = ['dcop', 'tdecore', 'tdefx', 'tdeprint', 'tdesu', 'tdeui', 'tdefile', 'td
all = []
-print 'Module,Item,Path,Contributor'
+print('Module,Item,Path,Contributor')
for mod in mods:
module = __import__(mod)
items = dir(module)
@@ -12,7 +12,7 @@ for mod in mods:
for item in items:
all.append(item)
- print '%s,%s,,,' % (mod, item, )
+ print('%s,%s,,,' % (mod, item, ))
diff --git a/examples/pytde-sampler/icon_handling/__init__.py b/examples/pytde-sampler/icon_handling/__init__.py
index 0b82073..87ee0c7 100644
--- a/examples/pytde-sampler/icon_handling/__init__.py
+++ b/examples/pytde-sampler/icon_handling/__init__.py
@@ -2,7 +2,7 @@ labelText = 'Icons'
iconName = 'icons'
-helpText = ("KDE icons are nice. "
+helpText = ("TDE icons are nice. "
"Select the children of this item to see for yourself.")
diff --git a/examples/pytde-sampler/icon_handling/misc.py b/examples/pytde-sampler/icon_handling/misc.py
index d3ea6a1..db7b624 100644
--- a/examples/pytde-sampler/icon_handling/misc.py
+++ b/examples/pytde-sampler/icon_handling/misc.py
@@ -26,6 +26,6 @@ class MainFrame(TQFrame):
import os
fn = os.path.abspath('.')
- print fn
+ print(fn)
self.write = KWritePermsIcon(fn)
self.write.reparent(self, 0, TQPoint(0,0), True)
diff --git a/examples/pytde-sampler/lib.py b/examples/pytde-sampler/lib.py
index 875ae1a..d81f2c3 100644
--- a/examples/pytde-sampler/lib.py
+++ b/examples/pytde-sampler/lib.py
@@ -68,8 +68,8 @@ def listmodules():
path = path.replace(samplerpath, '').replace(os.path.sep, '.')
try:
module = namedimport(path)
- except (ValueError, ImportError, ), exc:
- print 'Exception %s importing %s' % (exc, path, )
+ except (ValueError, ImportError, ) as exc:
+ print(('Exception %s importing %s' % (exc, path, )))
else:
modules.append((path, module))
modules.sort()
diff --git a/examples/pytde-sampler/misc/window_info.py b/examples/pytde-sampler/misc/window_info.py
index 12a9d66..df9a21c 100644
--- a/examples/pytde-sampler/misc/window_info.py
+++ b/examples/pytde-sampler/misc/window_info.py
@@ -25,11 +25,9 @@ class MainFrame(TQFrame):
def showWindowInfo(self):
- main = TDEApplication.kApplication()
- print main
- print main.mainWidget()
+ app = TDEApplication.kApplication()
- info = KWindowInfo(main)
- info.message('Updated Window Info', 3)
+ info = KWindowInfo(app.activeWindow())
+ info.message('Updated Window Info', 3000)
diff --git a/examples/pytde-sampler/qt_widgets/CONTRIB b/examples/pytde-sampler/qt_widgets/CONTRIB
index 65adb0f..e0425fd 100644
--- a/examples/pytde-sampler/qt_widgets/CONTRIB
+++ b/examples/pytde-sampler/qt_widgets/CONTRIB
@@ -44,7 +44,7 @@ tdecore,TDEConfigSkeleton,,,
tdecore,TDEConfigSkeletonItem,,,
tdecore,TDECrash,,,
tdecore,KDCOPPropertyProxy,,,
-tdecore,KDE,,,
+tdecore,TDE,,,
tdecore,KDesktopFile,,,
tdecore,KEntry,,,
tdecore,KEntryKey,,,
diff --git a/examples/pytde-sampler/qt_widgets/table.py b/examples/pytde-sampler/qt_widgets/table.py
index f3b9e54..b75d596 100644
--- a/examples/pytde-sampler/qt_widgets/table.py
+++ b/examples/pytde-sampler/qt_widgets/table.py
@@ -22,7 +22,7 @@ class MainFrame(TQFrame):
self.help = KTextEdit(helpText, '', self)
data = csv.reader(open(contrib))
- header = data.next()
+ header = next(data)
items = [item for item in data]
self.table = table = TQTable(len(items), len(header), self)
diff --git a/examples/pytde-sampler/runner.py b/examples/pytde-sampler/runner.py
index 8c6e8de..66056d7 100755
--- a/examples/pytde-sampler/runner.py
+++ b/examples/pytde-sampler/runner.py
@@ -3,13 +3,9 @@
"""
import sys
-from tdecore import TDEApplication, TDECmdLineArgs
-from tdeui import TDEMainWindow
from PyTQt.qt import TQVBoxLayout
-
-## relative import -- cry me a river!
-import about
-
+from tdecore import TDEApplication, TDECmdLineArgs, TDEAboutData
+from tdeui import TDEMainWindow
class SamplerRunnerWindow(TDEMainWindow):
def __init__(self, ctor):
@@ -35,14 +31,21 @@ def importItem(name):
names = name.split('.')
modname, itemname = names[0:-1], names[-1]
+ print(str.join('.', modname))
mod = importName(str.join('.', modname))
return getattr(mod, itemname)
if __name__ == '__main__':
- options = [('+item', 'An item in the sys.path')]
- TDECmdLineArgs.init(sys.argv, about.about)
+ description = b"A runner application"
+ version = b"1.0"
+ aboutData = TDEAboutData (b"", b"",\
+ version, description, TDEAboutData.License_GPL,\
+ b"(C) 2003 whoever the author is")
+
+ options = [(b'+item', b'An item in the sys.path')]
+ TDECmdLineArgs.init(sys.argv, aboutData)
TDECmdLineArgs.addCmdLineOptions(options)
args = TDECmdLineArgs.parsedArgs()
diff --git a/examples/pytde-sampler/sampler.py b/examples/pytde-sampler/sampler.py
index fec8ab7..6534829 100755
--- a/examples/pytde-sampler/sampler.py
+++ b/examples/pytde-sampler/sampler.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-""" The PyKDE application sampler
+""" The PyTDE application sampler
This module defines the top-level widgets for displaying the sampler
application.
@@ -25,7 +25,6 @@ from tdeio import TDETrader
from tdeparts import createReadOnlyPart, createReadWritePart
from tdehtml import TDEHTMLPart
-import about
import lib
@@ -114,7 +113,7 @@ class SamplerFrame(CommonFrame):
try:
frameType = module.builder()
except (AttributeError, ):
- print 'No sample callable defined in %s' % (module.name(), )
+ print('No sample callable defined in %s' % (module.name(), ))
else:
frame = frameType(self)
self.setWidget(frame)
@@ -132,7 +131,7 @@ class SourceFrame(CommonFrame):
def showModuleSource(self, item, module):
if not self.part:
- print 'No part available for displaying python source.'
+ print('No part available for displaying python source.')
return
try:
modulefile = inspect.getabsfile(module.module)
@@ -147,7 +146,7 @@ class WebFrame(CommonFrame):
""" frame with part for viewing web pages
"""
- docBase = 'http://www.riverbankcomputing.com/Docs/PyKDE3/classref/'
+ docBase = 'http://www.riverbankcomputing.com/Docs/PyTDE3/classref/'
def __init__(self, parent):
CommonFrame.__init__(self, parent)
@@ -155,7 +154,7 @@ class WebFrame(CommonFrame):
#part.connect(part, SIGNAL('tdehtmlMousePressEvent(a)'), self.onURL)
def onURL(self, a):
- print '****', a
+ print('****', a)
def showDocs(self, item, module):
try:
@@ -207,7 +206,7 @@ class SamplerListView(TDEListView):
self.setRootIsDecorated(True)
modules = lib.listmodules()
- modules.sort(lambda a, b: cmp(a[0], b[0]))
+ modules.sort(key=lambda a: a[0])
modmap = dict(modules)
modules = [(name.split('.'), name, mod) for name, mod in modules]
@@ -233,7 +232,7 @@ class SamplerListView(TDEListView):
subitem.setPixmap(0, getIcon(module.icon()))
subitem = item
- for root in roots.values():
+ for root in list(roots.values()):
self.setOpen(root, True)
@@ -272,8 +271,8 @@ class SamplerMainWindow(TDEMainWindow):
self.resize(640, 480)
height, width = self.height(), self.width()
- hSplit.setSizes([width * 0.35, width * 0.65])
- vSplit.setSizes([height * 0.80, height * 0.20])
+ hSplit.setSizes([int(width * 0.35), int(width * 0.65)])
+ vSplit.setSizes([int(height * 0.80), int(height * 0.20)])
self.xmlRcFileName = os.path.abspath(os.path.join(os.path.dirname(__file__), 'sampler.rc'))
self.setXMLFile(self.xmlRcFileName)
@@ -357,7 +356,7 @@ class SamplerMainWindow(TDEMainWindow):
"""
ret = KKeyDialog.configure(self.actionCollection(), self)
- print ret
+ print(ret)
if ret == TQDialog.Accepted:
actions = self.actionCollection()
actions.writeShortcutSettings(None, appConfig())
@@ -404,12 +403,18 @@ class SamplerMainWindow(TDEMainWindow):
def reloadModule(self, item, module):
- print >> sys.__stdout__, 'reload: ', reload(module.module)
+ print('reload: ', importlib.reload(module.module), file=sys.__stdout__)
if __name__ == '__main__':
- aboutdata = about.about()
- TDECmdLineArgs.init(sys.argv, aboutdata)
+ description = b"A sampler application"
+ version = b"1.0"
+ aboutData = TDEAboutData (b"", b"",\
+ version, description, TDEAboutData.License_GPL,\
+ b"(C) 2003 whoever the author is")
+
+ options = [(b'+item', b'An item in the sys.path')]
+ TDECmdLineArgs.init(sys.argv, aboutData)
app = TDEApplication()
splashpix = TQPixmap(os.path.join(lib.samplerpath, 'aboutkde.png'))
diff --git a/examples/pytde-sampler/wizards/__init__.py b/examples/pytde-sampler/wizards/__init__.py
deleted file mode 100644
index 63472b4..0000000
--- a/examples/pytde-sampler/wizards/__init__.py
+++ /dev/null
@@ -1,2 +0,0 @@
-iconName = 'wizard'
-labelText = 'Wizards'
diff --git a/examples/pytde-sampler/wizards/wiz.py b/examples/pytde-sampler/wizards/wiz.py
deleted file mode 100644
index 1cb5544..0000000
--- a/examples/pytde-sampler/wizards/wiz.py
+++ /dev/null
@@ -1,2 +0,0 @@
-iconName = 'wizard'
-labelText = 'Wizard'
diff --git a/examples/pytde-sampler/xwin/__init__.py b/examples/pytde-sampler/xwin/__init__.py
index 40b452a..41563ee 100644
--- a/examples/pytde-sampler/xwin/__init__.py
+++ b/examples/pytde-sampler/xwin/__init__.py
@@ -1,7 +1,7 @@
labelText = 'X Windows Features'
iconName = 'kcmx'
-helpText = """KDE and PyKDE allow interaction with the X Window system. Check
+helpText = """TDE and PyTDE allow interaction with the X Window system. Check
out the nifty samples below."""
from PyTQt.qt import TQFrame, TQLabel, TQVBoxLayout