diff options
-rwxr-xr-x | jt | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -199,13 +199,23 @@ class FinishCommand(Command): title = self._app.get_draft_title(draft_mdwn) if not title: raise Exception("%s has no title" % draft_mdwn) - basename = self._app.summarise_title(title) + basename = self._summarise_title(title) else: raise Exception( 'Setting --layout=%s is unknown' % self._app.settings['layout']) return basename + def _summarise_title(self, title): + basename = '' + acceptable = set(string.ascii_letters + string.digits + '-_') + for c in title.lower(): + if c in acceptable: + basename += c + elif not basename.endswith('_'): + basename += '_' + return basename + def _commit_to_git(self, pathnames): cliapp.runcmd( ['git', 'add'] + pathname, @@ -360,16 +370,6 @@ class JournalTool(cliapp.Application): '''Publish a draft journal entry.''' FinishCommand(self).run(args) - def summarise_title(self, title): - basename = '' - acceptable = set(string.ascii_letters + string.digits + '-_') - for c in title.lower(): - if c in acceptable: - basename += c - elif not basename.endswith('_'): - basename += '_' - return basename - def cmd_new_person(self, args): '''Create a page to list all notes referring to a person. |