Skip to content

Commit

Permalink
fixes #8
Browse files Browse the repository at this point in the history
  • Loading branch information
Sayandeep Purkayasth committed Apr 16, 2014
1 parent 563241e commit fdd13de
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lastfmplaycountconfig.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import gconf
try:
from gi.repository import GConf
except ImportError:
import gconf

from ConfigParser import RawConfigParser, NoSectionError
from os import path
Expand All @@ -19,9 +22,12 @@ def __init__(self):
self._run_update_all = False #Ugly hack because I can't seem to be able to access the main class here

self._parse_username()

self._gconf_client = gconf.client_get_default()
self._gconf_client.add_dir(GCONF_DIR, gconf.CLIENT_PRELOAD_RECURSIVE)
try:
self._gconf_client = GConf.Client.get_default()
self._gconf_client.add_dir(GCONF_DIR, GConf.ClientPreloadType.PRELOAD_RECURSIVE)
except Exception as e:
self._gconf_client = gconf.client_get_default()
self._gconf_client.add_dir(GCONF_DIR, gconf.CLIENT_PRELOAD_RECURSIVE)

self._init_config()

Expand Down

0 comments on commit fdd13de

Please sign in to comment.