Skip to content

Instantly share code, notes, and snippets.

@Psycojoker
Created October 11, 2016 10:54
Show Gist options
  • Select an option

  • Save Psycojoker/a9d14a57dfb88b7f5d70afc6446ca42f to your computer and use it in GitHub Desktop.

Select an option

Save Psycojoker/a9d14a57dfb88b7f5d70afc6446ca42f to your computer and use it in GitHub Desktop.
# condition originelle
(new_app_dict['lastUpdate'] > current_app_dict['lastUpdate']) \
or ('update_time' not in current_app_dict['settings'] \
and (new_app_dict['lastUpdate'] > current_app_dict['settings']['install_time'])) \
or ('update_time' in current_app_dict['settings'] \
and (new_app_dict['lastUpdate'] > current_app_dict['settings']['update_time']))
# hypothèse que new_app_dict == current_app_dict d'après
# https://github.com/YunoHost/yunohost/blob/unstable/src/yunohost/app.py#L366-L367
('update_time' not in current_app_dict['settings'] \
and (new_app_dict['lastUpdate'] > current_app_dict['settings']['install_time'])) \
or ('update_time' in current_app_dict['settings'] \
and (new_app_dict['lastUpdate'] > current_app_dict['settings']['update_time']))
# réécriture
last_app_update_time = current_app_dict["settings"].get("update_time" current_app_dict["settings"]["install_time"])
new_app_dict['lastUpdate'] > last_app_update_time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment