summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2014-01-27 09:35:01 +0100
committerBastien Nocera <hadess@hadess.net>2014-01-27 09:35:01 +0100
commitd8535bf3544ae0b7dd483bafe190f51eb62a55ab (patch)
tree13a16cee3f543cddb22b051b97117aaafb7f715b /src
parent37b5cc9905e4d298034b8fb636c6a2548fb7a4d0 (diff)
downloadtotem-d8535bf3544ae0b7dd483bafe190f51eb62a55ab.tar.gz
opensubtitles: Stop using PyXDG
We can achieve the same thing through GLib and Gio.
Diffstat (limited to 'src')
-rw-r--r--src/plugins/opensubtitles/opensubtitles.py12
1 files 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]