Commit c8feb9f2 authored by Brady James Garvin's avatar Brady James Garvin
Browse files

Fixed code style.

parent 153f7c83
...@@ -13,24 +13,25 @@ class NoteApp(App): ...@@ -13,24 +13,25 @@ class NoteApp(App):
super(NoteApp, self).__init__(**kwargs) super(NoteApp, self).__init__(**kwargs)
self.store = JsonStore('note.json') self.store = JsonStore('note.json')
def load_state(self): def _load_state(self):
try: try:
self.root.text = self.store['note']['text'] self.root.text = self.store['note']['text']
except KeyError: except KeyError:
pass pass
def save_state(self): def _save_state(self):
self.store['note'] = {'text': self.root.text} self.store['note'] = {'text': self.root.text}
def on_start(self): def on_start(self):
self.load_state() self._load_state()
def on_pause(self): def on_pause(self):
self.save_state() self._save_state()
return True return True
def on_stop(self): def on_stop(self):
self.save_state() self._save_state()
if __name__ == '__main__': if __name__ == '__main__':
app = NoteApp() app = NoteApp()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment