Also handle "Type" from .desktop files.
authorStefanos Harhalakis <v13@v13.gr>
Sun, 18 Jul 2010 22:42:42 +0000 (22:42 +0000)
committerStefanos Harhalakis <v13@v13.gr>
Sun, 18 Jul 2010 22:42:42 +0000 (22:42 +0000)
Ignore files with Type==Daemon.
Fallback in using the id as the name in case of entries without a name.

setup.py
src/apps.py
src/config.py

index 298b9ba..d19fcca 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -24,7 +24,7 @@ from distutils.core import setup
 
 setup(
     name='drlaunch',
 
 setup(
     name='drlaunch',
-    version="0.5",
+    version="0.6",
     description="DrLaunch",
     author="Stefanos Harhalakis",
     author_email="v13@v13.gr",
     description="DrLaunch",
     author="Stefanos Harhalakis",
     author_email="v13@v13.gr",
index ead13c5..f078b04 100755 (executable)
@@ -41,6 +41,7 @@ def readOneFn(fn):
        'icon':     None,
        'iconpath': None,
        'domain':   None,
        'icon':     None,
        'iconpath': None,
        'domain':   None,
+       'type':     None,
        }
 
     fn2=appdir + '/' + fn
        }
 
     fn2=appdir + '/' + fn
@@ -77,6 +78,9 @@ def readOneFn(fn):
        elif line.startswith('X-Text-Domain='):
            l=line[14:]
            ret['domain']=l
        elif line.startswith('X-Text-Domain='):
            l=line[14:]
            ret['domain']=l
+       elif line.startswith('Type='):
+           l=line[5:]
+           ret['type']=l
 
     if ret['domain']!=None:
        try:
 
     if ret['domain']!=None:
        try:
@@ -88,6 +92,9 @@ def readOneFn(fn):
            ret['name0']=ret['name']
            ret['name']=c.gettext(ret['name0'])
 
            ret['name0']=ret['name']
            ret['name']=c.gettext(ret['name0'])
 
+    if ret['name']==None:
+       ret['name']=ret['id']
+
     return(ret)
 
 def readOne(name):
     return(ret)
 
 def readOne(name):
@@ -109,7 +116,14 @@ def scan():
            continue
        if f.startswith('catorise-'):
            continue
            continue
        if f.startswith('catorise-'):
            continue
+
        dt=readOneFn(f)
        dt=readOneFn(f)
+
+       if dt==None:
+           continue
+       if dt['type']=='Daemon' or dt['type']=='daemon':
+           continue
+
        t=f[:-8]
        ret[t]=dt
 
        t=f[:-8]
        ret[t]=dt
 
index 3b70b2a..d1c9b67 100755 (executable)
@@ -25,7 +25,7 @@ __version__ = "$Id: 0.py 2265 2010-02-21 19:16:26Z v13 $"
 import os
 import pickle
 
 import os
 import pickle
 
-version = "0.5"
+version = "0.6"
 
 try:
     from glib import get_user_config_dir
 
 try:
     from glib import get_user_config_dir