rhythmbox r6217 - in trunk: . plugins/jamendo/jamendo plugins/magnatune/magnatune



Author: jmatthew
Date: Wed Mar 18 02:30:31 2009
New Revision: 6217
URL: http://svn.gnome.org/viewvc/rhythmbox?rev=6217&view=rev

Log:
2009-03-18  Jonathan Matthew  <jonathan d14n org>

	* plugins/jamendo/jamendo/JamendoSource.py:
	* plugins/magnatune/magnatune/MagnatuneSource.py:
	Handle old directories not existing, create new ones as required.


Modified:
   trunk/ChangeLog
   trunk/plugins/jamendo/jamendo/JamendoSource.py
   trunk/plugins/magnatune/magnatune/MagnatuneSource.py

Modified: trunk/plugins/jamendo/jamendo/JamendoSource.py
==============================================================================
--- trunk/plugins/jamendo/jamendo/JamendoSource.py	(original)
+++ trunk/plugins/jamendo/jamendo/JamendoSource.py	Wed Mar 18 02:30:31 2009
@@ -25,7 +25,7 @@
 from JamendoSaxHandler import JamendoSaxHandler
 import JamendoConfigureDialog
 
-import os.path
+import os
 import gobject
 import gtk.glade
 import gnome, gconf
@@ -80,6 +80,8 @@
 		self.__catalogue_check = None
 
 		self.__jamendo_dir = rb.find_user_cache_file("jamendo")
+		if os.path.exists(self.__jamendo_dir) is False:
+			os.makedirs(self.__jamendo_dir, 0700)
 
 		self.__local_catalogue_path = os.path.join(self.__jamendo_dir, "dbdump.xml")
 		self.__local_catalogue_temp = os.path.join(self.__jamendo_dir, "dbdump.xml.tmp")

Modified: trunk/plugins/magnatune/magnatune/MagnatuneSource.py
==============================================================================
--- trunk/plugins/magnatune/magnatune/MagnatuneSource.py	(original)
+++ trunk/plugins/magnatune/magnatune/MagnatuneSource.py	Wed Mar 18 02:30:31 2009
@@ -623,11 +623,15 @@
 	def __move_data_files (self):
 		# create cache and data directories
 		# (we know they don't already exist, and we know the parent dirs do)
-		os.mkdir(magnatune_cache_dir, 0700)
 		os.mkdir(magnatune_in_progress_dir, 0700)
+		if os.path.exists(magnatune_cache_dir) is False:
+			os.mkdir(magnatune_cache_dir, 0700)
 
 		# move song info to cache dir
 		old_magnatune_dir = os.path.join(rb.dot_dir(), 'magnatune')
+		if os.path.exists(old_magnatune_dir) is False:
+			print "old magnatune directory does not exist"
+			return
 
 		old_song_info = os.path.join(old_magnatune_dir, 'song_info.xml')
 		if os.path.exists(old_song_info):



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