diff options
author | luxagraf <sng@luxagraf.net> | 2017-05-01 16:29:52 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2017-05-01 16:29:52 -0500 |
commit | c53aeceae4a9867f5f13ee99434138b5b8543a8c (patch) | |
tree | c0a92ed819fc8779510a4f569214d24de5251bf0 /app/builder | |
parent | 02f45fde364b4854b02b797cfcee0cb25543b58e (diff) |
fixed map builder
Diffstat (limited to 'app/builder')
-rw-r--r-- | app/builder/base.py | 6 | ||||
-rw-r--r-- | app/builder/views.py | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/app/builder/base.py b/app/builder/base.py index 67a259e..d9c2288 100644 --- a/app/builder/base.py +++ b/app/builder/base.py @@ -20,8 +20,6 @@ class _FileWriter(object): os.makedirs(self.path) fpath = '%s%s.%s' % (self.path, filename, ext) self.write(fpath, text_object) - if ext == 'js': - self.compress_js(filename, text_object) def write(self, fpath, text_object): f = open(fpath, 'wb') @@ -30,7 +28,7 @@ class _FileWriter(object): def compress_js(self, filename, text_object): path = '%s%s.min.js' % (self.path, filename) - compressed = jsmin(text_object.decode(encoding='UTF-8')) + compressed = jsmin(text_object.decode('utf-8')).encode('utf-8') self.write(path, compressed) @@ -49,7 +47,7 @@ class BuildNew(): def write_file(self, path, text_object, ext='html', filename='index'): self.writer = _FileWriter(path, text_object, ext=ext, filename=filename) - + def get_pages(self, qs, paginate_by): return int(ceil(Decimal(qs.count()) / Decimal(paginate_by))) diff --git a/app/builder/views.py b/app/builder/views.py index 1875a91..55a037c 100644 --- a/app/builder/views.py +++ b/app/builder/views.py @@ -2,7 +2,7 @@ from django.shortcuts import render_to_response from django.template import RequestContext from builder.base import BuildWriting, BuildWritingFeed, BuildMap, BuildPhotos, BuildProjects, BuildSitemap from src.build import builder as src_builder -from jrnl.build import archive_builder, detail_builder, home_builder, rss_builder, amp_builder +from jrnl.build import archive_builder, detail_builder, home_builder, rss_builder, amp_builder, map_builder from resume.build import builder as resume_builder from books.build import builder as book_builder from birds.build import builder as bird_builder @@ -15,7 +15,6 @@ options = { 'writing': BuildWriting, 'photo_galleries': BuildPhotos, 'projects': BuildProjects, - 'map': BuildMap, 'feed': BuildWritingFeed, 'sitemap': BuildSitemap, } @@ -60,6 +59,9 @@ def do_build(request): elif section == 'pages': context = {'message': 'Writing Pages to Disk'} page_builder() + elif section == 'map': + context = {'message': 'Writing Map to Disk'} + map_builder() else: options[section]().build() context = {'message': 'Writing %s to Disk' % section} |