gnome.utilities.save_updater

Module Contents

Functions

remember_cwd(new_wd)

update_savefile(save_directory)

v0tov1(messages, errors)

Takes a zipfile containing no version.txt and up-converts it to 'version 1'.

v1tov2(messages, errors)

Takes a zipfile containing version 1 and up-converts it

v2tov3(messages, errors)

Takes a zipfile containing version 2 and up-converts it

v3tov4(messages, errors)

Takes a zipfile containing version 3 and up-converts it

v4tov5(messages, errors)

Takes a zipfile containing version 4 and up-converts it

extract_zipfile(zip_file[, to_folder])

sanitize_filename(fname)

make filename legal on all systems (windows is pickier)

Attributes

log

errortypes

NON_WEATHERING_DICT

all_update_steps

gnome.utilities.save_updater.log
gnome.utilities.save_updater.errortypes = ['Save file version not compatible with this updater. Version: {0} Updater: {1}', 'Save file...
gnome.utilities.save_updater.NON_WEATHERING_DICT
gnome.utilities.save_updater.remember_cwd(new_wd)
gnome.utilities.save_updater.update_savefile(save_directory)
gnome.utilities.save_updater.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.

gnome.utilities.save_updater.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

gnome.utilities.save_updater.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]

gnome.utilities.save_updater.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

gnome.utilities.save_updater.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

gnome.utilities.save_updater.extract_zipfile(zip_file, to_folder='.')
gnome.utilities.save_updater.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 …

gnome.utilities.save_updater.all_update_steps