This forum has been archived. All content is frozen. Please use KDE Discuss instead.

PyKDE4 KPasswordDialog problem

Tags: None
(comma "," separated)
antroy
Registered Member
Posts
6
Karma
0
OS

PyKDE4 KPasswordDialog problem

Mon Jun 29, 2009 9:33 pm
Hi All,

I am new to KDE development, and am trying to create a simple app that simply reads a username/password and stores it in KWallet. I keep getting the following error:

Code: Select all
*** glibc detected *** /usr/bin/python: corrupted double-linked list: 0x0a02f738 ***


Now the simplest code I can get to demonstrate this is the following:

Code: Select all
#!/usr/bin/python

import sys
from PyKDE4.kdecore import ki18n, KAboutData, KCmdLineArgs
from PyKDE4.kdeui import *
from PyQt4.QtCore import QString
 
appName     = "KApplication"
catalog     = ""
programName = ki18n ("Password Test")
version     = "1.0"
description = ki18n ("Password Dialog Test")
license     = KAboutData.License_GPL
copyright   = ki18n ("(c) 2009 Anthony Roy")
text        = ki18n ("none")
homePage    = "www.antroy.co.uk"
bugEmail    = "work@antroy.co.uk"
 
aboutData   = KAboutData (appName, catalog, programName, version, description,
                        license, copyright, text, homePage, bugEmail)
 
KCmdLineArgs.init (sys.argv, aboutData)
 
app = KApplication ()

dialog = KPasswordDialog(None, KPasswordDialog.ShowUsernameLine)


My operating system is Fedora 10, running KDE4.
python: 2.5.2 (32.fc10)
glibc: 2.9 (3)
PyKDE4: 4.2.4 (2.fc10)

Any help appreciated - it's frustrating being stumped by a blocker on line 26 of a new program!
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: PyKDE4 KPasswordDialog problem

Tue Jun 30, 2009 6:46 am
Possibly because you haven't called KApplication->exec() so the event loop hasn't started?
antroy
Registered Member
Posts
6
Karma
0
OS

Re: PyKDE4 KPasswordDialog problem

Tue Jun 30, 2009 7:01 pm
Ah - ok. I would try that, except that exec is a reserved word in Python... Does anyone know the PyKDE4 equivalent? Interestingly though, the following Hello World app works fine, and I would have thought it would have had the same problem given that app.exec() (or equivalent) is not called:

Code: Select all
# Exactly the same code as above up until (and including) 'app = KApplication()'

yesButton = KGuiItem(
   i18n("Hello"),
   QString(),
   i18n("This is a tooltip."),
   i18n("This is a WhatsThis help text.")
)
KMessageBox.questionYesNo(
   None,
   i18n("Hello World!"),
   i18n("Hello"),
   yesButton
)


Cheers.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: PyKDE4 KPasswordDialog problem

Wed Jul 01, 2009 6:31 am
MessageBoxes are likely not affected since they do not require a connection to the DBus session server to use. Communicating with KWallet does require a connection however, and that is estabilished by KApplication.

Unfortunately I don't know anything about PyKDE4. You may wish to look at the printer applet, since that uses PyKDE4. Alternately you could ask on the KDE Bindings mailing list. If you know what call is done for PyQt4, then it is likely the same.
antroy
Registered Member
Posts
6
Karma
0
OS

Re: PyKDE4 KPasswordDialog problem

Wed Jul 01, 2009 12:04 pm
Thanks for the pointer to the printer applet. Looks like the call is app.exec_(). Typical - I'd tried app._exec() without success (should have known really, since a leading underscore is python convention for a private method...)

Will try it out tonight.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]