added logic to account for starting without the pickled settings

This commit is contained in:
Dan
2021-05-29 14:20:24 -04:00
parent b163d1a9bf
commit 3e3be5c6a3

19
main.py
View File

@@ -19,13 +19,16 @@ class MangaReader:
master.title("Manga Reader")
#Load settings
settingLoad = pickle.load(open('manga.p', 'rb'))
self.dir = settingLoad['directory']
self.nextKey = settingLoad['nextKey']
self.backKey = settingLoad['backKey']
self.quitKey = settingLoad['quitKey']
self.openKey = settingLoad['openKey']
#Load settings
try:
settingLoad = pickle.load(open('manga.p', 'rb'))
self.dir = settingLoad['directory']
self.nextKey = settingLoad['nextKey']
self.backKey = settingLoad['backKey']
self.quitKey = settingLoad['quitKey']
self.openKey = settingLoad['openKey']
except:
pass
# tk window size and allow resize
master.geometry("700x900")
@@ -54,7 +57,7 @@ class MangaReader:
# page counter
self.pgcount = Label(self.buttonFrame, text= str(self.page) + " of " + str(self.total))
self.pgcount.grid(row=1, columns=1, columnspan=2)
self.pgcount.grid(row=1, column=1, columnspan=2, pady=(20,20))
self.mangaTitle = Label(self.buttonFrame, text=os.path.basename(self.file))
self.mangaTitle.grid(row=0, column=1)