Better support for individual configs

This commit is contained in:
Manuel Ebert 2012-07-16 13:37:08 +02:00
parent 0de1af654d
commit c26ed24389
2 changed files with 5 additions and 4 deletions

View file

@ -267,7 +267,3 @@ class Journal:
self.entries.append(Entry(self, date, title, body)) self.entries.append(Entry(self, date, title, body))
self.sort() self.sort()
def save_config(self, config_path):
with open(config_path, 'w') as f:
json.dump(self.config, f, indent=2)

View file

@ -45,6 +45,11 @@ def update_config(config, config_path=os.path.expanduser("~/.jrnl_conf")):
print("[.jrnl_conf updated to newest version]") print("[.jrnl_conf updated to newest version]")
def save_config(config=default_config, config_path=os.path.expanduser("~/.jrnl_conf")):
with open(config_path, 'w') as f:
json.dump(config, f, indent=2)
def install_jrnl(config_path='~/.jrnl_config'): def install_jrnl(config_path='~/.jrnl_config'):
def autocomplete(text, state): def autocomplete(text, state):
expansions = glob.glob(os.path.expanduser(text)+'*') expansions = glob.glob(os.path.expanduser(text)+'*')