Skip to content
Permalink
Browse files
Fix minor style issues, warn about deletions
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jul 27, 2016
1 parent 40b2cfe commit f6024dbf7c1ba53353f0495a4c5a5b61fe8f4493
Showing with 11 additions and 4 deletions.
  1. +2 −2 nikola/conf.py.in
  2. +5 −1 nikola/plugins/command/deploy.py
  3. +3 −1 nikola/plugins/command/github_deploy.py
  4. +1 −0 nikola/utils.py
@@ -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
@@ -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
@@ -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'])
@@ -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'.

0 comments on commit f6024db

Please sign in to comment.