:py:mod:`gnome.utilities.save_updater` ====================================== .. py:module:: gnome.utilities.save_updater Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: gnome.utilities.save_updater.remember_cwd gnome.utilities.save_updater.update_savefile gnome.utilities.save_updater.v0tov1 gnome.utilities.save_updater.v1tov2 gnome.utilities.save_updater.v2tov3 gnome.utilities.save_updater.v3tov4 gnome.utilities.save_updater.v4tov5 gnome.utilities.save_updater.extract_zipfile gnome.utilities.save_updater.sanitize_filename Attributes ~~~~~~~~~~ .. autoapisummary:: gnome.utilities.save_updater.log gnome.utilities.save_updater.errortypes gnome.utilities.save_updater.NON_WEATHERING_DICT gnome.utilities.save_updater.all_update_steps .. py:data:: log .. py:data:: errortypes :value: ['Save file version not compatible with this updater. Version: {0} Updater: {1}', 'Save file... .. py:data:: NON_WEATHERING_DICT .. py:function:: remember_cwd(new_wd) .. py:function:: update_savefile(save_directory) .. py:function:: v0tov1(messages, errors) Takes a zipfile containing no version.txt and up-converts it to 'version 1'. This functions purpose is to upgrade save files to maintain compatibility after the SpillRefactor upgrades. .. py:function:: v1tov2(messages, errors) Takes a zipfile containing version 1 and up-converts it to 'version 2'. This function's purpose is to upgrade save files to maintain compatibility after changes to the GnomeOil -- i.e. can the json file still be used to create an oil - if not, replace with non-weathering substance so save file can be loaded. Also removes InitWindages .. py:function:: v2tov3(messages, errors) Takes a zipfile containing version 2 and up-converts it to 'version 3'. This function's purpose is to upgrade save files to maintain compatibility after the grand renaming: [link to commit here] .. py:function:: v3tov4(messages, errors) Takes a zipfile containing version 3 and up-converts it to 'version 4'. This function's purpose is to upgrade save files that have the old ``WeatheringData`` object in them .. py:function:: v4tov5(messages, errors) Takes a zipfile containing version 4 and up-converts it to 'version 5'. This function's purpose is for compatiblity with savefiles after renaming: PyCurrentMover --> CurrentMover PyWindMover --> WindMover .. py:function:: extract_zipfile(zip_file, to_folder='.') .. py:function:: sanitize_filename(fname) make filename legal on all systems (windows is pickier) NOTE: this looks a lot like html sanitization do we need to remove "<" and ">" from filenames? and/or should we replace with a placeholder, rather than simply remove? Also -- maybe replace spaces with underscores ... .. py:data:: all_update_steps