- Timestamp:
- Feb 1, 2010, 4:20:49 PM (15 years ago)
- Location:
- kde/kreadconfig
- Files:
-
- 4 added
- 2 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
kde/kreadconfig/kread-desktopfile-test.sh
r816 r817 11 11 12 12 #echo $KDEDIRS 13 kde4-config --path config 13 #kde4-config --path config 14 kde4-config --path apps 14 15 15 16 echo 16 17 17 ./kreadconfig.py testconfig18 #./kreadconfig.py testconfig 18 19 20 # OK 21 #./kread-desktopfile.py /usr/share/applications/xmag.desktop 22 23 # NOK 24 #./kread-desktopfile.py test.desktop 25 26 # OK 27 #./kread-desktopfile.py testdir/test.desktop 28 29 # OK 30 #./kread-desktopfile.py test2.desktop 31 32 #./kread-desktopfile.py /usr/share/applications/xmag.desktop 33 34 FILE=testdir/test.desktop 35 36 ./kread-desktopfile.py $FILE -
kde/kreadconfig/kread-desktopfile.py
r816 r817 19 19 20 20 import sys 21 from PyKDE4.kdecore import ki18n, KAboutData, KCmdLineArgs, KCmdLineOptions, KConfig 21 from PyKDE4.kdecore import ki18n, KAboutData, KCmdLineArgs, KCmdLineOptions, KConfig, KDesktopFile 22 22 from PyKDE4.kdeui import KApplication 23 23 … … 49 49 print getFullName( config ) 50 50 #print dir(config) 51 for i in config.entryMap(): 51 #for i in config.entryMap(): 52 for i in config.keyList(): 52 53 immutaleString = '' 53 54 if config.isEntryImmutable( i ): … … 109 110 #print configfilename 110 111 111 config = KConfig(configfilename, KConfig.NoGlobals) 112 if not KDesktopFile.isDesktopFile(configfilename): 113 print "failed: no desktop file '", configfilename, "' found" 114 exit(1) 112 115 116 #config = KConfig(configfilename, KConfig.NoGlobals) 117 config = KDesktopFile(configfilename) 118 119 120 print "filename: ", config.fileName() 121 print "name: ", config.readName() 122 print "icon: ", config.readIcon() 123 print "nodisplay: ", config.noDisplay() 124 125 print 126 print "dump:" 113 127 114 128 # only show the sub-groups. -
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 -
kde/kreadconfig/kreadconfig-test.sh
r796 r817 12 12 #echo $KDEDIRS 13 13 kde4-config --path config 14 kde4-config --path apps 14 15 15 16 echo -
kde/kreadconfig/kreadconfig.py
r796 r817 49 49 print getFullName( config ) 50 50 #print dir(config) 51 for i in config.entryMap(): 51 #for i in config.entryMap(): 52 for i in config.keyList(): 52 53 immutaleString = '' 53 54 if config.isEntryImmutable( i ):
Note:
See TracChangeset
for help on using the changeset viewer.