[790] | 1 | #!/usr/bin/env python
|
---|
| 2 | # -*- coding: utf-8 -*-
|
---|
| 3 |
|
---|
| 4 | import sys
|
---|
| 5 | from PyKDE4.kdecore import ki18n, KAboutData, KCmdLineArgs, KConfig
|
---|
| 6 | from PyKDE4.kdeui import KApplication
|
---|
| 7 |
|
---|
| 8 | #import pprint
|
---|
| 9 | #pp = pprint.PrettyPrinter(indent=4)
|
---|
| 10 |
|
---|
| 11 | def getFullName( config ):
|
---|
| 12 | if config.name() == "<default>":
|
---|
| 13 | return ""
|
---|
| 14 | else:
|
---|
| 15 | if config.parent():
|
---|
| 16 | parentsNames = getFullName( config.parent() )
|
---|
| 17 | return parentsNames + "[" + config.name() + "]"
|
---|
| 18 |
|
---|
| 19 | def dumpGroup( config ):
|
---|
| 20 | print getFullName( config )
|
---|
| 21 | for i in config.entryMap():
|
---|
| 22 | print i + ": " + config.readEntry( i )
|
---|
| 23 | print
|
---|
| 24 |
|
---|
| 25 | def dumpSubGroups( config ):
|
---|
| 26 | dumpGroup( config )
|
---|
| 27 | #print dir( config )
|
---|
| 28 | for i in config.groupList():
|
---|
| 29 | configGroup=config.group(str(i))
|
---|
| 30 | dumpSubGroups( configGroup )
|
---|
| 31 |
|
---|
| 32 |
|
---|
| 33 | appName = "KApplication"
|
---|
| 34 | catalog = ""
|
---|
| 35 | programName = ki18n ("KApplication")
|
---|
| 36 | version = "1.0"
|
---|
| 37 | description = ki18n ("KApplication/KMainWindow/KAboutData example")
|
---|
| 38 | license = KAboutData.License_GPL
|
---|
| 39 | copyright = ki18n ("(c) 2009 Jörg Steffens")
|
---|
| 40 | text = ki18n ("none")
|
---|
| 41 | homePage = "www.dass-it.de"
|
---|
| 42 | bugEmail = "rt@dass-it.de"
|
---|
| 43 |
|
---|
| 44 | aboutData = KAboutData (appName, catalog, programName, version, description,
|
---|
| 45 | license, copyright, text, homePage, bugEmail)
|
---|
| 46 |
|
---|
| 47 |
|
---|
| 48 | KCmdLineArgs.init (sys.argv, aboutData)
|
---|
| 49 | app = KApplication ()
|
---|
| 50 |
|
---|
| 51 | config = KConfig("plasma-desktoprc")
|
---|
| 52 |
|
---|
| 53 | for i in config.groupList():
|
---|
| 54 | configGroup=config.groupImpl(str(i))
|
---|
| 55 | dumpSubGroups( configGroup )
|
---|