charms.reactive.helpers¶
Summary
any_file_changed |
Check if any of the given files have changed since the last time this was called. |
any_hook |
Assert that the currently executing hook matches one of the given patterns. |
data_changed |
Check if the given set of data has changed since the previous call. |
is_data_changed |
Check if the given set of data has changed since the last time data_changed was called. |
mark_invoked |
Mark the given ID as having been invoked, for use with was_invoked() . |
was_invoked |
Returns whether the given ID has been invoked before, as per mark_invoked() . |
Reference
-
charms.reactive.helpers.
data_changed
(data_id, data, hash_type='md5')¶ Check if the given set of data has changed since the previous call.
This works by hashing the JSON-serialization of the data. Note that, while the data will be serialized using
sort_keys=True
, some types of data structures, such as sets, may lead to false positivies.Parameters:
-
charms.reactive.helpers.
is_data_changed
(data_id, data, hash_type='md5')¶ Check if the given set of data has changed since the last time data_changed was called.
That is, this is a non-destructive way to check if the data has changed.
Parameters:
-
charms.reactive.helpers.
any_file_changed
(filenames, hash_type='md5')¶ Check if any of the given files have changed since the last time this was called.
Parameters: