Exaile-Soundmenu-Indicator icon indicating copy to clipboard operation
Exaile-Soundmenu-Indicator copied to clipboard

Do not use hardcoded paths

Open mathbr opened this issue 12 years ago • 1 comments

The plugin currently uses hardcoded paths in two places in the __init__.py:

def _clean_tmp(type, exaile, data):
    tmpdir = os.path.expanduser('~/.cache/exaile/')
    for tmp in os.listdir(tmpdir):
        if fnmatch.fnmatch(tmp, 'exaile-soundmenu*'):
            os.remove(os.path.join(tmpdir, tmp))

Here xl.xdg.get_cache_dir() should be used.

def init_indicate():
    ## for Maverick registration
    try:
        server = indicate.indicate_server_ref_default()
        server.set_type('music.exaile')
        server.set_desktop_file('/usr/share/applications/exaile.desktop')
        server.show()
    except:
        pass

Here xl.xdg.get_data_dirs() could be used to find the most appropriate directory.

mathbr avatar Aug 06 '12 23:08 mathbr

Cool. I will fix this when I get time.

sunng87 avatar Aug 07 '12 02:08 sunng87