Amarok-search: os.environ['KDEHOME'] issue

Carlos Gonçalves vixiado at zmail.pt
Thu Aug 31 09:22:03 MDT 2006


Em Terça, 29 de Agosto de 2006 14:55, o Robby Stephenson escreveu:
> On Sunday 27 August 2006 4:34, Carlos Gonçalves wrote:
> > Hey.
> >
> > Just to report a bug in Amarok-search data source...
> >
> > - coverdir = os.environ['KDEHOME'] +
> > "/share/apps/amarok/albumcovers/large/" + coverdir = os.environ['HOME'] +
> > "/.kde/share/apps/amarok/albumcovers/large/"
>
> Thanks, I thought KDEHOME was defined somewhere in the startkde script, but
> it's probably better to check and not depend on it.
>
> Robby

OK you released amarok-search 0.3 but it still with the same problem.
I hacked it. Diffs:


*** tellico-search-amarok       2006-08-31 16:08:05.000000000 +0100
--- tellico-search-amarok-new   2006-08-31 16:09:05.000000000 +0100
***************
*** 340,349 ****
                usage()
                sys.exit(2)

!       coverdir = os.environ['KDEHOME'];
!         if len(coverdir) == 0:
!                 coverdir = os.environ['HOME'];
!         coverdir += "/share/apps/amarok/albumcovers/large/"
        xml = generate_xml()
        lang, enc = locale.getdefaultlocale()
        if not options.has_key('quiet'):
--- 340,350 ----
                usage()
                sys.exit(2)

!       try:
!               coverdir = os.environ['KDEHOME'];
!       except KeyError:
!               coverdir = os.environ['HOME'] + '/.kde';
!       coverdir += "/share/apps/amarok/albumcovers/large/"
        xml = generate_xml()
        lang, enc = locale.getdefaultlocale()
        if not options.has_key('quiet'):


This way if KDEHOME wasn't found, the script define "coverdir" as HOME/.kde 
instead of break the whole script.



Carlos




More information about the tellico-users mailing list