download dir fallback, commented out "eject" at end of ipod sync

git-svn-id: svn://svn.berlios.de/gpodder@103 b0d088ad-0a06-0410-aad2-9ed5178a7e87
This commit is contained in:
Thomas Perl 2006-04-14 12:56:16 +00:00
parent 9d0b499941
commit 13212b25d3
4 changed files with 26 additions and 4 deletions

View File

@ -1,3 +1,7 @@
Fri, 14 Apr 2006 14:40:47 +0200 <thp@perli.net>
* Commented-out the "eject" call on end of iPod sync for now
* Fallback to default download dir if not able to create it
Thu, 13 Apr 2006 12:06:50 +0200 <thp@perli.net>
* Added support for DESTDIR= in Makefile (thanks to Steve for
pointing this out..)

View File

@ -113,7 +113,15 @@ class gPodderLibClass( object):
def createIfNecessary( self, path):
if not exists( path):
makedirs( path)
try:
makedirs( path)
return True
except:
if isDebugging():
print 'createIfNecessary: could not create: %s' % ( path )
return False
return True
def getConfigFilename( self):
return self.gpodderdir + "gpodder.conf"

View File

@ -118,7 +118,8 @@ class gPodder_iPodSync(object):
gobject.idle_add( self.callback_done)
if self.ipod_mgr != None:
if self.ipod_mgr.ipod != None:
os.system( 'sudo eject %s' % ( self.ipod_mgr.ipod.device ))
# there has to be a better way.. ;)
# os.system( 'sudo eject %s' % ( self.ipod_mgr.ipod.device ))
return True
def remove_from_ipod( self, track, playlists):

View File

@ -227,7 +227,9 @@ class podcastChannel(ListType):
def get_save_dir(self):
savedir = self.download_dir + self.filename + "/"
libgpodder.gPodderLib().createIfNecessary( savedir)
if libgpodder.gPodderLib().createIfNecessary( savedir) == False:
self.reset_download_dir()
savedir = self.download_dir + self.filename + "/"
return savedir
save_dir = property(fget=get_save_dir)
@ -238,9 +240,16 @@ class podcastChannel(ListType):
else:
return self.__download_dir
def reset_download_dir( self):
self.__download_dir = libgpodder.gPodderLib().downloaddir
def set_download_dir(self, value):
self.__download_dir = value
libgpodder.gPodderLib().createIfNecessary(self.__download_dir)
if libgpodder.gPodderLib().createIfNecessary(self.__download_dir) == False:
# fallback to hopefully sane download dir
self.reset_download_dir()
return False
return True
# the following disabled at the moment..
#if libgpodder.isDebugging():
# print "set_download_dir: ", self, self.__download_dir