source: kde/kreadconfig/kreadconfig.py@ 791

Last change on this file since 791 was 791, checked in by joergs, on Sep 2, 2009 at 3:37:29 PM

added comment

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4"""
5kreadconfig.py dumps KDE configuration files.
6It is usefull for debugging KDE Kiosks settings,
7where multiple config files are merged into the final configuration.
8
9The directory hierarchie for config files
10is based on the KDEDIRS environment variable
11and can be made visible by the command
12kde4-config --path config
13
14kreadconfig has a similiar purpose,
15but is limited to a single value
16"""
17
18# $Id: kreadconfig.py 791 2009-09-02 13:37:29Z joergs $
19
20import sys
21from PyKDE4.kdecore import ki18n, KAboutData, KCmdLineArgs, KConfig
22from PyKDE4.kdeui import KApplication
23
24#import pprint
25#pp = pprint.PrettyPrinter(indent=4)
26
27def getFullName( config ):
28 if config.name() == "<default>":
29 return ""
30 else:
31 if config.parent():
32 parentsNames = getFullName( config.parent() )
33 return parentsNames + "[" + config.name() + "]"
34
35def dumpGroup( config ):
36 print getFullName( config )
37 for i in config.entryMap():
38 print i + ": " + config.readEntry( i )
39 print
40
41def dumpSubGroups( config ):
42 dumpGroup( config )
43 #print dir( config )
44 for i in config.groupList():
45 configGroup=config.group(str(i))
46 dumpSubGroups( configGroup )
47
48
49appName = "KApplication"
50catalog = ""
51programName = ki18n ("KApplication")
52version = "1.0"
53description = ki18n ("KApplication/KMainWindow/KAboutData example")
54license = KAboutData.License_GPL
55copyright = ki18n ("(c) 2009 Jörg Steffens")
56text = ki18n ("none")
57homePage = "www.dass-it.de"
58bugEmail = "rt@dass-it.de"
59
60aboutData = KAboutData (appName, catalog, programName, version, description,
61 license, copyright, text, homePage, bugEmail)
62
63
64KCmdLineArgs.init (sys.argv, aboutData)
65app = KApplication ()
66
67config = KConfig("plasma-desktoprc")
68
69for i in config.groupList():
70 configGroup=config.groupImpl(str(i))
71 dumpSubGroups( configGroup )
Note: See TracBrowser for help on using the repository browser.