diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-11-22 15:16:50 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-11-22 15:16:50 +0200 |
commit | db3e6834c6c01b00a6ef7cbfc03c25edc732b695 (patch) | |
tree | 44c6ad8b6620c652568f1b9d159ec97719ead693 /jtlib/plugins | |
parent | 339049495dd8a82cc2d5058e805144e244bc7d72 (diff) | |
download | jt-db3e6834c6c01b00a6ef7cbfc03c25edc732b695.tar.gz |
Refactor: move layout specific parts to their own classes
Diffstat (limited to 'jtlib/plugins')
-rw-r--r-- | jtlib/plugins/finish_plugin.py | 6 | ||||
-rw-r--r-- | jtlib/plugins/new_plugin.py | 1 |
2 files changed, 2 insertions, 5 deletions
diff --git a/jtlib/plugins/finish_plugin.py b/jtlib/plugins/finish_plugin.py index c05f88e..1336ea0 100644 --- a/jtlib/plugins/finish_plugin.py +++ b/jtlib/plugins/finish_plugin.py @@ -40,10 +40,8 @@ class FinishCommand(cliapp.Plugin): if not title: raise Exception("%s has no title" % draft_mdwn) - pub_attch = os.path.join( - self._published_dir(), - self._published_basename(title, draft_mdwn),) - pub_mdwn = pub_attch + '.mdwn' + pub_attch = self.app.layout.get_filename(title) + pub_mdwn = self.app.layout.get_filename(title) + '.mdwn' if os.path.exists(pub_mdwn): raise cliapp.AppException('%s already exists' % pub_mdwn) diff --git a/jtlib/plugins/new_plugin.py b/jtlib/plugins/new_plugin.py index d704242..25facf8 100644 --- a/jtlib/plugins/new_plugin.py +++ b/jtlib/plugins/new_plugin.py @@ -52,7 +52,6 @@ class NewCommand(cliapp.Plugin): raise cliapp.AppException('Usage: journal-note new TITLE') self.app.settings.require('source') - self.app.settings.require('layout') topic = self.app.settings['topic'] if topic and not self._topic_page_exists(topic): raise cliapp.AppException('Topic %s does not exist yet' % topic) |