Fix all the bugs added with the last commit

This commit is contained in:
Florian Bach 2022-10-08 18:32:29 +02:00
parent 6c94e7237d
commit 81da7bd6f9
3 changed files with 5 additions and 4 deletions

View File

@ -134,7 +134,8 @@ class ACSMInput(FileTypePlugin):
# If the old DeACSM plugin still exists, rename it to BAK or something so it doesn't load. # If the old DeACSM plugin still exists, rename it to BAK or something so it doesn't load.
os.rename(os.path.join(self.pluginsdir, "DeACSM.zip"), os.path.join(self.pluginsdir, "DeACSM.BAK")) if os.path.exists(os.path.join(self.pluginsdir, "DeACSM.zip")):
os.rename(os.path.join(self.pluginsdir, "DeACSM.zip"), os.path.join(self.pluginsdir, "DeACSM.BAK"))
# Make sure the GUI extension is loaded: # Make sure the GUI extension is loaded:
self.init_embedded_plugins() self.init_embedded_plugins()

View File

@ -152,7 +152,7 @@ class ConfigWidget(QWidget):
# First remove all overdue books from the loan list, # First remove all overdue books from the loan list,
# to determine if we should enable the button. # to determine if we should enable the button.
self.delete_overdue_books_from_loan_list() RentedBooksDialog.remove_overdue_books_from_list()
if (len(self.tempdeacsmprefs["list_of_rented_books"]) == 0): if (len(self.tempdeacsmprefs["list_of_rented_books"]) == 0):
self.button_rented_books.setText(_("No loaned books available")) self.button_rented_books.setText(_("No loaned books available"))

View File

@ -17,7 +17,7 @@ class ACSMInput_Prefs():
JSON_PATH_OLD = os.path.join("plugins", "deacsm.json") JSON_PATH_OLD = os.path.join("plugins", "deacsm.json")
JSON_PATH = os.path.join("plugins", "ACSMInput", "ACSMInput.json") JSON_PATH = os.path.join("plugins", "ACSMInput", "ACSMInput.json")
if os.path.exists(JSON_PATH_OLD) and not os.path.exists(JSON_PATH): if os.path.exists(os.path.join(config_dir, JSON_PATH_OLD)):
# If the file exists in the old location, use that. # If the file exists in the old location, use that.
JSON_PATH = JSON_PATH_OLD JSON_PATH = JSON_PATH_OLD
@ -39,7 +39,7 @@ class ACSMInput_Prefs():
self.__pluginsdir = os.path.join(config_dir,"plugins") self.__pluginsdir = os.path.join(config_dir,"plugins")
success = False success = False
for f in ["ACSMInput", "DeACSM"]: for f in ["DeACSM", "ACSMInput"]:
self.__maindir = os.path.join(self.__pluginsdir, f) self.__maindir = os.path.join(self.__pluginsdir, f)
self.__accountdir = os.path.join(self.__maindir,"account") self.__accountdir = os.path.join(self.__maindir,"account")
if os.path.exists(self.__accountdir): if os.path.exists(self.__accountdir):