Fixes issues with persistent mode

- adds mode to the persistent file
- adds filenames for share and website mode in persistent file
This commit is contained in:
Saptak S 2021-02-23 02:23:31 +05:30
parent 754c4e9c10
commit 8a412fed85
No known key found for this signature in database
GPG Key ID: 2D9B32E54C68A3FB

View File

@ -267,6 +267,7 @@ def main(cwd=None):
if persistent_filename: if persistent_filename:
mode_settings = ModeSettings(common, persistent_filename) mode_settings = ModeSettings(common, persistent_filename)
mode_settings.set("persistent", "enabled", True) mode_settings.set("persistent", "enabled", True)
mode_settings.set("persistent", "mode", mode)
else: else:
mode_settings = ModeSettings(common) mode_settings = ModeSettings(common)
@ -292,7 +293,7 @@ def main(cwd=None):
if mode == "share" or mode == "website": if mode == "share" or mode == "website":
# Unless you passed in a persistent filename, in which case get the filenames from # Unless you passed in a persistent filename, in which case get the filenames from
# the mode settings # the mode settings
if persistent_filename and not mode_settings.just_created: if persistent_filename and not mode_settings.just_created and len(filenames) != 0:
filenames = mode_settings.get(mode, "filenames") filenames = mode_settings.get(mode, "filenames")
else: else:
@ -316,6 +317,11 @@ def main(cwd=None):
if not valid: if not valid:
sys.exit() sys.exit()
# Save the filenames in persistent file
if persistent_filename:
mode_settings.set(mode, "filenames", filenames)
# Create the Web object # Create the Web object
web = Web(common, False, mode_settings, mode) web = Web(common, False, mode_settings, mode)