Minimize differences needed to run under OpenLP 2.4.6

This commit is contained in:
John Lines 2019-07-12 11:49:00 +01:00
parent d52d5bb0e2
commit bc70eea7b9

View File

@ -58,8 +58,13 @@ class SingingTheFaithImport(SongImport):
for file_path in self.import_source: for file_path in self.import_source:
if self.stop_import_flag: if self.stop_import_flag:
return return
with file_path.open('rt', encoding='cp1251') as song_file: if isinstance(file_path, str):
song_file = open(file_path, 'rt', encoding='cp1251')
self.do_import_file(song_file) self.do_import_file(song_file)
song_file.close()
else:
with file_path.open('rt', encoding='cp1251') as song_file:
self.do_import_file(song_file)
def do_import_file(self, file): def do_import_file(self, file):
""" """