[totem/gnome-3-8] opensubtitles: Stop using PyXDG



commit 6c58743ccfa3708aa8141dd2172b772c5e3bb774
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Jan 27 09:35:01 2014 +0100

    opensubtitles: Stop using PyXDG
    
    We can achieve the same thing through GLib and Gio.

 src/plugins/opensubtitles/opensubtitles.py |   12 ++----------
 1 files changed, 2 insertions(+), 10 deletions(-)
---
diff --git a/src/plugins/opensubtitles/opensubtitles.py b/src/plugins/opensubtitles/opensubtitles.py
index 5f53034..92e252f 100644
--- a/src/plugins/opensubtitles/opensubtitles.py
+++ b/src/plugins/opensubtitles/opensubtitles.py
@@ -5,7 +5,6 @@ from gi.repository import Gio, Pango, Totem # pylint: disable-msg=E0611
 
 import xmlrpclib
 import threading
-import xdg.BaseDirectory
 from os import sep, path, mkdir
 import gettext
 
@@ -618,19 +617,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]


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]