Fixed import/coding issues with build_safe.

This commit is contained in:
Ahmet Bakan 2015-09-14 18:56:28 -07:00
parent 605540efcb
commit 94de463fc7
2 changed files with 3 additions and 4 deletions

View file

@ -24,7 +24,7 @@ def build_safe(builder):
HTML builders, excluding `PickleHTMLBuilder` and `JSONHTMLBuilder` HTML builders, excluding `PickleHTMLBuilder` and `JSONHTMLBuilder`
which run into issues when trying to serialize blog objects.""" which run into issues when trying to serialize blog objects."""
if hasattr(builder, 'builder'); if hasattr(builder, 'builder'):
builder = builder.builder builder = builder.builder
return builder.format == 'html' and not builder.name in {'json', 'pickle'} return builder.format == 'html' and not builder.name in {'json', 'pickle'}

View file

@ -18,7 +18,6 @@ from docutils.parsers.rst import directives
from docutils.utils import relative_path from docutils.utils import relative_path
import ablog import ablog
from . import build_safe
from .blog import Blog, slugify, os_path_join, revise_pending_xrefs from .blog import Blog, slugify, os_path_join, revise_pending_xrefs
if sys.version_info >= (3, 0): if sys.version_info >= (3, 0):
@ -481,7 +480,7 @@ def generate_archive_pages(app):
"""Generate archive pages for all posts, categories, tags, authors, and """Generate archive pages for all posts, categories, tags, authors, and
drafts.""" drafts."""
if not build_safe(app): if not ablog.build_safe(app):
return return
blog = Blog(app) blog = Blog(app)
@ -563,7 +562,7 @@ def generate_atom_feeds(app):
"""Generate archive pages for all posts, categories, tags, authors, and """Generate archive pages for all posts, categories, tags, authors, and
drafts.""" drafts."""
if not build_safe(app): if not ablog.build_safe(app):
return return
blog = Blog(app) blog = Blog(app)