Skip to content

Commit

Permalink
Fix minor style issues, warn about deletions
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jul 27, 2016
1 parent 40b2cfe commit f6024db
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions nikola/conf.py.in
Expand Up @@ -277,12 +277,12 @@ POSTS_SECTIONS = True
# output / TRANSLATION[lang] / TAG_PATH / index.html (list of tags)
# output / TRANSLATION[lang] / TAG_PATH / tag.html (list of posts for a tag)
# output / TRANSLATION[lang] / TAG_PATH / tag.xml (RSS feed for a tag)
# (translatable)
# (translatable)
# TAG_PATH = "categories"

# See TAG_PATH's "list of tags" for the default setting value. Can be overwritten
# here any path relative to the output directory.
# (translatable)
# (translatable)
# TAGS_INDEX_PATH = "tags.html"

# If TAG_PAGES_ARE_INDEXES is set to True, each tag's page will contain
Expand Down
6 changes: 5 additions & 1 deletion nikola/plugins/command/deploy.py
Expand Up @@ -84,10 +84,14 @@ def _execute(self, command, args):
"You are deploying using the nikolademo Disqus account.\n"
"That means you will not be able to moderate the comments in your own site.\n"
"And is probably not what you want to do.\n"
"Think about it for 5 seconds, I'll wait :-)\n\n")
"Think about it for 5 seconds, I'll wait :-)\n"
"(press Ctrl+C to abort)\n")
time.sleep(5)

# Remove drafts and future posts if requested
undeployed_posts = clean_before_deployment(self.site)
if undeployed_posts:
self.logger.notice("Deleted {0} posts due to DEPLOY_* settings".format(len(undeployed_posts)))

if args:
presets = args
Expand Down
4 changes: 3 additions & 1 deletion nikola/plugins/command/github_deploy.py
Expand Up @@ -101,7 +101,9 @@ def _execute(self, options, args):
os.unlink(f)

# Remove drafts and future posts if requested (Issue #2406)
clean_before_deployment(self.site)
undeployed_posts = clean_before_deployment(self.site)
if undeployed_posts:
self.logger.notice("Deleted {0} posts due to DEPLOY_* settings".format(len(undeployed_posts)))

# Commit and push
self._commit_and_push(options['commit_message'])
Expand Down
1 change: 1 addition & 0 deletions nikola/utils.py
Expand Up @@ -1885,6 +1885,7 @@ def clean_before_deployment(site):
undeployed_posts.append(post)
return undeployed_posts


# Stolen from textwrap in Python 3.4.3.
def indent(text, prefix, predicate=None):
"""Add 'prefix' to the beginning of selected lines in 'text'.
Expand Down

0 comments on commit f6024db

Please sign in to comment.