Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
flake8, support quit/ignore_quit
  • Loading branch information
ralsina committed May 9, 2015
1 parent 70103ad commit bc0e815
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
6 changes: 4 additions & 2 deletions nikola/nikola.py
Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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):
Expand Down
12 changes: 1 addition & 11 deletions nikola/plugins/task/scan_posts.py
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit bc0e815

Please sign in to comment.