Skip to content
Permalink
Browse files

flake8, support quit/ignore_quit

  • Loading branch information
ralsina committed May 9, 2015
1 parent 70103ad commit bc0e8152de70b43bddcb72581cb1152bfc1d8d7b
Showing with 5 additions and 13 deletions.
  1. +4 −2 nikola/nikola.py
  2. +1 −11 nikola/plugins/task/scan_posts.py
@@ -1356,7 +1356,7 @@ def flatten(task):
def scan_posts(self, really=False, ignore_quit=False, quiet=False):
"""Scan all the posts.
Ignoring ignore_quit and quiet right now because noone uses them?
Ignoring quiet.
"""
# FIXME this is temporary while moving things out to a plugin
if self._scanned and not really:
@@ -1380,6 +1380,7 @@ def scan_posts(self, really=False, ignore_quit=False, quiet=False):
self.timeline.extend(timeline)
self.global_data.update(global_data)

quit = False
# Classify posts per year/tag/month/whatever
slugged_tags = set([])
for post in self.timeline:
@@ -1426,7 +1427,8 @@ def scan_posts(self, really=False, ignore_quit=False, quiet=False):
self._scanned = True
if not self.quiet:
print("done!", file=sys.stderr)

if quit and not ignore_quit:
sys.exit(1)
signal('scanned').send(self)

def generic_page_renderer(self, lang, post, filters):
@@ -25,13 +25,10 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

from __future__ import unicode_literals, print_function
from collections import defaultdict
import glob
import os
import sys

from blinker import signal

from nikola.plugin_categories import PostScanner
from nikola import utils
from nikola.post import Post
@@ -44,13 +41,6 @@ class ScanPosts(PostScanner):

def scan(self):
"""Build final pages from metadata and HTML fragments."""
kw = {
"post_pages": self.site.config["post_pages"],
"translations": self.site.config["TRANSLATIONS"],
"filters": self.site.config["FILTERS"],
"show_untranslated_posts": self.site.config['SHOW_UNTRANSLATED_POSTS'],
"demote_headers": self.site.config['DEMOTE_HEADERS'],
}

seen = set([])
if not self.site.quiet:
@@ -64,7 +54,7 @@ def scan(self):
if not self.site.quiet:
print(".", end='', file=sys.stderr)
dirname = os.path.dirname(wildcard)
for dirpath, _, _ in os.walk(dirname, followlinks=True ):
for dirpath, _, _ in os.walk(dirname, followlinks=True):
dest_dir = os.path.normpath(os.path.join(destination,
os.path.relpath(dirpath, dirname))) # output/destination/foo/
# Get all the untranslated paths

0 comments on commit bc0e815

Please sign in to comment.
You can’t perform that action at this time.