diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-11-26 00:22:01 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-11-26 00:22:01 (GMT) |
commit | 9c6636a761d2bc627e744e6b0efc45cc7672c485 (patch) | |
tree | 9140286204564cc901ef645caeac3155e0fd2b19 /devbot/state.py | |
parent | 15980e294fcb70ce8e04efb198b26f66c4241ecb (diff) |
On run check the system only if something changed
Diffstat (limited to 'devbot/state.py')
-rw-r--r-- | devbot/state.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/devbot/state.py b/devbot/state.py index bc17761..1eaf3ac 100644 --- a/devbot/state.py +++ b/devbot/state.py @@ -25,16 +25,23 @@ def _get_state(): def _state_changed(): json.dump(_state, open(_get_state_path(), "w+")) -def add_built_module(name, commit_id): - _get_state()["built_modules"][name] = commit_id +def touch_built_commit_id(module): + _get_state()["built_modules"][module.name] = module.get_commit_id() _state_changed() -def remove_built_module(name): - del _get_state()["built_modules"][name] +def remove_built_commit_id(module): + del _get_state()["built_modules"][module.name] _state_changed() -def get_built_module(name): - return _get_state()["built_modules"].get(name, None) +def get_built_commit_id(module): + return _get_state()["built_modules"].get(module.name, None) + +def get_last_system_check(): + return _get_state().get("last_system_check", None) + +def touch_last_system_check(): + _get_state()["last_system_check"] = config.get_commit_id() + _state_changed() def clean(): _state = None |