From b5fa97bf63a4160f20eb6e946f7132236ee63b72 Mon Sep 17 00:00:00 2001 From: Stefanos Harhalakis Date: Sun, 18 Jul 2010 22:42:42 +0000 Subject: [PATCH] Also handle "Type" from .desktop files. Ignore files with Type==Daemon. Fallback in using the id as the name in case of entries without a name. --- setup.py | 2 +- src/apps.py | 14 ++++++++++++++ src/config.py | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 298b9ba..d19fcca 100755 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ from distutils.core import setup setup( name='drlaunch', - version="0.5", + version="0.6", description="DrLaunch", author="Stefanos Harhalakis", author_email="v13@v13.gr", diff --git a/src/apps.py b/src/apps.py index ead13c5..f078b04 100755 --- a/src/apps.py +++ b/src/apps.py @@ -41,6 +41,7 @@ def readOneFn(fn): 'icon': None, 'iconpath': None, 'domain': None, + 'type': None, } 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('Type='): + l=line[5:] + ret['type']=l if ret['domain']!=None: try: @@ -88,6 +92,9 @@ def readOneFn(fn): ret['name0']=ret['name'] ret['name']=c.gettext(ret['name0']) + if ret['name']==None: + ret['name']=ret['id'] + return(ret) def readOne(name): @@ -109,7 +116,14 @@ def scan(): continue if f.startswith('catorise-'): continue + dt=readOneFn(f) + + if dt==None: + continue + if dt['type']=='Daemon' or dt['type']=='daemon': + continue + t=f[:-8] ret[t]=dt diff --git a/src/config.py b/src/config.py index 3b70b2a..d1c9b67 100755 --- a/src/config.py +++ b/src/config.py @@ -25,7 +25,7 @@ __version__ = "$Id: 0.py 2265 2010-02-21 19:16:26Z v13 $" import os import pickle -version = "0.5" +version = "0.6" try: from glib import get_user_config_dir -- 1.7.9.5