Source code for slackminion.plugins.state.file
import os
try:
from slackminion.plugins.core import commit
except ImportError:
commit = "HEAD"
from . import BaseStateHandler
[docs]class FileStateHandler(BaseStateHandler):
[docs] def load_state(self):
with open(os.path.join(self.config["data_dir"], "state.json"), "rb") as f:
state = f.read()
return state
[docs] def save_state(self, state):
with open(os.path.join(self.config["data_dir"], "state.json"), "wb") as f:
f.write(state)