From d8535bf3544ae0b7dd483bafe190f51eb62a55ab Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Mon, 27 Jan 2014 09:35:01 +0100 Subject: opensubtitles: Stop using PyXDG We can achieve the same thing through GLib and Gio. --- src/plugins/opensubtitles/opensubtitles.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/plugins/opensubtitles/opensubtitles.py b/src/plugins/opensubtitles/opensubtitles.py index d9293623c..b239e3067 100644 --- a/src/plugins/opensubtitles/opensubtitles.py +++ b/src/plugins/opensubtitles/opensubtitles.py @@ -6,7 +6,6 @@ from gi.repository import Gio, Pango, Totem # pylint: disable-msg=E0611 import xmlrpc.client import threading -import xdg.BaseDirectory from os import sep, path, mkdir import gettext @@ -592,19 +591,12 @@ class OpenSubtitles (GObject.Object, # pylint: disable-msg=R0902 subtitle_format = model.get_value (subtitle_iter, 1) if not filename: - bpath = xdg.BaseDirectory.xdg_cache_home + sep + bpath = GLib.get_user_cache_dir() + sep bpath += 'totem' + sep directory = Gio.file_new_for_path (bpath + 'subtitles' + sep) - if not directory.query_exists (None): - if not path.exists (bpath): - mkdir (bpath) - if not path.exists (bpath + 'subtitles' + sep): - mkdir (bpath + 'subtitles' + sep) - # FIXME: We can't use this function until we depend on - # GLib (PyGObject) 2.18 - # directory.make_directory_with_parents () + directory.make_directory_with_parents (None); subtitle_file = Gio.file_new_for_path (self._filename) movie_name = subtitle_file.get_basename ().rpartition ('.')[0] -- cgit v1.2.1