[kupfer] learn: Migrate mnemonics to config
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [kupfer] learn: Migrate mnemonics to config
- Date: Wed, 9 Sep 2009 19:15:59 +0000 (UTC)
commit e97f2e737610712b4e024b2f55294bd4ffeeeac0
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Wed Sep 9 02:08:41 2009 +0200
learn: Migrate mnemonics to config
Mnemonics, learned user data is more config than it is user data. It
is not, IMO, invaluable, and should thus stay in ~/.config rather than
in the data directories.
Migrate by reading in config first then data, but always saving to
config.
kupfer/learn.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/kupfer/learn.py b/kupfer/learn.py
index 2d2a0a9..202c6e2 100644
--- a/kupfer/learn.py
+++ b/kupfer/learn.py
@@ -87,7 +87,8 @@ def load():
"""
global _register
- filepath = config.get_data_file(mnemonics_filename)
+ filepath = config.get_config_file(mnemonics_filename) or \
+ config.get_data_file(mnemonics_filename)
if filepath:
_register = Learning._unpickle_register(filepath)
@@ -101,5 +102,5 @@ def finish():
if not _register:
pretty.print_debug(__name__, "Not writing empty register")
return
- filepath = config.save_data_file(mnemonics_filename)
+ filepath = config.save_config_file(mnemonics_filename)
Learning._pickle_register(_register, filepath)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]