Changeset 817 for kde/kreadconfig/kread-ressource.py
- Timestamp:
- Feb 1, 2010, 4:20:49 PM (14 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
kde/kreadconfig/kread-ressource.py
r816 r817 3 3 4 4 """ 5 kread config.py dumps KDE configuration files.5 kread-ressource.py dumps a KDE configuration file. 6 6 It is usefull for debugging KDE Kiosks settings, 7 7 where multiple config files are merged into the final configuration. … … 19 19 20 20 import sys 21 import os 21 22 from PyKDE4.kdecore import ki18n, KAboutData, KCmdLineArgs, KCmdLineOptions, KConfig 22 23 from PyKDE4.kdeui import KApplication … … 49 50 print getFullName( config ) 50 51 #print dir(config) 51 for i in config.entryMap(): 52 #for i in config.entryMap(): 53 for i in config.keyList(): 52 54 immutaleString = '' 53 55 if config.isEntryImmutable( i ): … … 76 78 77 79 78 appName = "kread config.py"80 appName = "kread-resource.py" 79 81 catalog = "" 80 programName = ki18n ("kread config.py")82 programName = ki18n ("kread-resource.py") 81 83 version = "$Rev$" 82 description = ki18n (" show KDEconfiguration files")84 description = ki18n ("dump KDE resource/configuration files") 83 85 license = KAboutData.License_GPL 84 copyright = ki18n ("(c) 20 09Jörg Steffens")86 copyright = ki18n ("(c) 2010 Jörg Steffens") 85 87 text = ki18n ("none") 86 88 homePage = "www.dass-it.de" … … 92 94 # command line argument handling 93 95 options = KCmdLineOptions() 94 options.add("+configfile", ki18n("KDE config file name")) 95 96 options.add("type <kde-res-type>", ki18n("common types are: apps, config, xdgconf-autostart, xdgdata-apps. Default is"), "config") 97 options.add("types", ki18n("list all available types")) 98 options.add("+resourcename", ki18n("KDE ressource name (file name)")) 99 96 100 KCmdLineArgs.init(sys.argv, aboutData) 97 101 # Register the supported options 98 102 KCmdLineArgs.addCmdLineOptions( options ) 99 103 100 app = KApplication 104 app = KApplication() 101 105 102 106 args = KCmdLineArgs.parsedArgs(); 107 108 if args.isSet("types"): 109 os.system( "kde4-config --types" ) 110 exit() 111 103 112 104 113 # TODO: why is this not detected automatically? … … 106 115 args.usage() 107 116 117 # TODO: check valid resource types (otherwise, this application starts a crash report 118 type = args.getOption("type"); 119 108 120 configfilename = args.arg(0) 109 121 #print configfilename 110 122 111 config = KConfig(configfilename, KConfig.NoGlobals) 123 #try: 124 config = KConfig(configfilename, KConfig.NoGlobals, type) 125 #except: 126 #print "Unexpected error:", sys.exc_info()[0] 127 #exit(1) 112 128 113 129
Note:
See TracChangeset
for help on using the changeset viewer.