diff options
author | Lars Wirzenius <liw@liw.fi> | 2014-11-22 19:23:36 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2014-11-22 19:23:36 +0200 |
commit | 3f49554a438bc153852d1dacc1db54e78a303c12 (patch) | |
tree | 6af62472943d6ca55dc90e6bc2f1267bc2bb6e9b /jt | |
parent | 7910e7d7cdeae077c7c80f7618b8afb0b2f7c046 (diff) | |
download | jt-3f49554a438bc153852d1dacc1db54e78a303c12.tar.gz |
Make helper methods private
Diffstat (limited to 'jt')
-rwxr-xr-x | jt | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -162,14 +162,14 @@ class FinishCommand(Command): draft_attch = drafts_dir.get_draft_attachments_dirname(draft_id) pub_attch = os.path.join( - self.published_dir(), self.published_basename(draft_mdwn)) + self._published_dir(), self._published_basename(draft_mdwn)) pub_mdwn = pub_attch + '.mdwn' if os.path.exists(pub_mdwn): raise cliapp.AppException('%s already exists' % pub_mdwn) - if not os.path.exists(self.published_dir()): - os.makedirs(self.published_dir()) + if not os.path.exists(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) @@ -182,7 +182,7 @@ class FinishCommand(Command): if self._app.settings['push']: self.push_git() - def published_dir(self): + def _published_dir(self): subdirs = { 'liw': 'notes', 'ct': 'log/%d' % time.localtime().tm_year, @@ -192,7 +192,7 @@ class FinishCommand(Command): subdir = subdirs[self._app.settings['layout']] return os.path.join(self._app.settings['source'], subdir) - def published_basename(self, draft_mdwn): + def _published_basename(self, draft_mdwn): if self._app.settings['layout'] in ('liw', 'ct'): basename = time.strftime('%Y-%m-%d-%H:%M:%S') elif self._app.settings['layout'] == 'pkb': @@ -206,7 +206,7 @@ class FinishCommand(Command): return basename - def commit_to_git(self, pathnames): + def _commit_to_git(self, pathnames): cliapp.runcmd( ['git', 'add'] + pathname, cwd=self._app.settings['source']) @@ -215,7 +215,7 @@ class FinishCommand(Command): ['git', 'commit', '-m', 'Publish log entry'], cwd=self._app.settings['source']) - def push_git(self): + def _push_git(self): cliapp.runcmd( ['git', 'push', 'origin', 'HEAD'], cwd=self._app.settings['source']) |