return where possible instead of breaking

This commit is contained in:
Andreas Preikschat 2011-04-19 13:46:25 +02:00
parent 3b98cbe0fd
commit d45f93b594

View File

@ -128,14 +128,15 @@ class OpenSongImport(SongImport):
self.import_wizard.progressBar.setMaximum(numfiles) self.import_wizard.progressBar.setMaximum(numfiles)
for filename in self.import_source: for filename in self.import_source:
if self.stop_import_flag: if self.stop_import_flag:
break return
ext = os.path.splitext(filename)[1] ext = os.path.splitext(filename)[1]
if ext.lower() == u'.zip': if ext.lower() == u'.zip':
log.debug(u'Zipfile found %s', filename) log.debug(u'Zipfile found %s', filename)
z = ZipFile(filename, u'r') z = ZipFile(filename, u'r')
for song in z.infolist(): for song in z.infolist():
if self.stop_import_flag: if self.stop_import_flag:
break z.close()
return
parts = os.path.split(song.filename) parts = os.path.split(song.filename)
if parts[-1] == u'': if parts[-1] == u'':
# No final part => directory # No final part => directory