(libhooke.py) fixed crash when saving playlist with wrong path
authordevicerandom <devnull@localhost>
Tue, 24 Feb 2009 10:53:51 +0000 (10:53 +0000)
committerdevicerandom <devnull@localhost>
Tue, 24 Feb 2009 10:53:51 +0000 (10:53 +0000)
libhooke.py

index f26b89a420b13a9cf490ce2ce498d60cc68d97b6..25ee935ab3652f44c585906fed491344aabbaff0 100755 (executable)
@@ -124,8 +124,13 @@ class PlaylistXML:
         def save(self,output_filename):
             '''
             saves the playlist in a XML file.
-            '''    
-            outfile=file(output_filename,'w')
+            '''
+            try:
+                outfile=file(output_filename,'w')
+            except IOError:
+                print 'libhooke.py : Cannot save playlist. Wrong path or filename'
+                return
+            
             self.playlist.writexml(outfile,indent='\n')
             outfile.close()