diff options
author | Lars Wirzenius <liw@liw.fi> | 2016-04-01 15:00:08 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2016-04-01 15:00:08 +0300 |
commit | ebcf20a177bb3d43e5fd858d0e343c586c47c493 (patch) | |
tree | abc1eb7f2b44b2c7827acc2a5ad304563de0cc48 /jtlib | |
parent | 76f3b78b1bbdb4e382d6e1f684c9387ad7a4351c (diff) | |
download | jt-ebcf20a177bb3d43e5fd858d0e343c586c47c493.tar.gz |
Make notes subdir name configurableliw/notesdir
Diffstat (limited to 'jtlib')
-rw-r--r-- | jtlib/app.py | 6 | ||||
-rw-r--r-- | jtlib/plugins/finish_plugin.py | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/jtlib/app.py b/jtlib/app.py index ddbb94a..6ea2e74 100644 --- a/jtlib/app.py +++ b/jtlib/app.py @@ -68,6 +68,12 @@ class JournalTool(cliapp.Application): metavar='FILE') self.settings.string( + ['notes-dir'], + 'put new notes in subdirectory DIR', + metavar='DIR', + default='notes') + + self.settings.string( ['pretend-time'], 'pretend that the time is NOW (form: YYYY-MM-DD HH:MM:DD form)', metavar='NOW') diff --git a/jtlib/plugins/finish_plugin.py b/jtlib/plugins/finish_plugin.py index b443a9f..f634231 100644 --- a/jtlib/plugins/finish_plugin.py +++ b/jtlib/plugins/finish_plugin.py @@ -59,8 +59,11 @@ class FinishCommand(cliapp.Plugin): self._push_git() def _published_dir(self): - subdir = time.strftime('notes/%Y/%m/%d', self.app.now_tuple) - return os.path.join(self.app.settings['source'], subdir) + subdir = time.strftime('%Y/%m/%d', self.app.now_tuple) + return os.path.join( + self.app.settings['source'], + self.app.settings['notes-dir'], + subdir) def _summarise_title(self, title): basename = '' |