Skip to content

Commit bc0e815

Browse files
committedMay 9, 2015
flake8, support quit/ignore_quit
1 parent 70103ad commit bc0e815

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed
 

Diff for: ‎nikola/nikola.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1356,7 +1356,7 @@ def flatten(task):
13561356
def scan_posts(self, really=False, ignore_quit=False, quiet=False):
13571357
"""Scan all the posts.
13581358
1359-
Ignoring ignore_quit and quiet right now because noone uses them?
1359+
Ignoring quiet.
13601360
"""
13611361
# FIXME this is temporary while moving things out to a plugin
13621362
if self._scanned and not really:
@@ -1380,6 +1380,7 @@ def scan_posts(self, really=False, ignore_quit=False, quiet=False):
13801380
self.timeline.extend(timeline)
13811381
self.global_data.update(global_data)
13821382

1383+
quit = False
13831384
# Classify posts per year/tag/month/whatever
13841385
slugged_tags = set([])
13851386
for post in self.timeline:
@@ -1426,7 +1427,8 @@ def scan_posts(self, really=False, ignore_quit=False, quiet=False):
14261427
self._scanned = True
14271428
if not self.quiet:
14281429
print("done!", file=sys.stderr)
1429-
1430+
if quit and not ignore_quit:
1431+
sys.exit(1)
14301432
signal('scanned').send(self)
14311433

14321434
def generic_page_renderer(self, lang, post, filters):

Diff for: ‎nikola/plugins/task/scan_posts.py

+1-11
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,10 @@
2525
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2626

2727
from __future__ import unicode_literals, print_function
28-
from collections import defaultdict
2928
import glob
3029
import os
3130
import sys
3231

33-
from blinker import signal
34-
3532
from nikola.plugin_categories import PostScanner
3633
from nikola import utils
3734
from nikola.post import Post
@@ -44,13 +41,6 @@ class ScanPosts(PostScanner):
4441

4542
def scan(self):
4643
"""Build final pages from metadata and HTML fragments."""
47-
kw = {
48-
"post_pages": self.site.config["post_pages"],
49-
"translations": self.site.config["TRANSLATIONS"],
50-
"filters": self.site.config["FILTERS"],
51-
"show_untranslated_posts": self.site.config['SHOW_UNTRANSLATED_POSTS'],
52-
"demote_headers": self.site.config['DEMOTE_HEADERS'],
53-
}
5444

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

0 commit comments

Comments
 (0)