diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-10-14 17:37:44 +0100 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-10-14 17:37:44 +0100 |
commit | ba512e4d56b67b173c5e554fa5a8c4fbcd26c93c (patch) | |
tree | 9563a1abc56a0823c07b9dc505f6520ffd6d7ccd | |
parent | b02f2e9e531246ac10db4938939e004a8c0374a9 (diff) | |
download | jt-ba512e4d56b67b173c5e554fa5a8c4fbcd26c93c.tar.gz |
Make ct layout have yearly subdirs
-rwxr-xr-x | jt | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -100,8 +100,9 @@ class JournalTool(cliapp.Application): def published_dir(self): subdirs = { 'liw': 'notes', - 'ct': 'log', + 'ct': 'log/%d' % time.localtime().tm_year, } + subdir = subdirs[self.settings['layout']] return os.path.join(self.settings['source'], subdir) @@ -196,7 +197,7 @@ class JournalTool(cliapp.Application): raise cliapp.AppException('%s already exists' % pub_mdwn) if not os.path.exists(self.published_dir()): - os.mkdir(self.published_dir()) + os.makedirs(self.published_dir()) os.rename(draft_mdwn, pub_mdwn) if os.path.exists(draft_attch): os.rename(draft_attch, pub_attch) |