diff options
author | luxagraf <sng@luxagraf.net> | 2020-11-15 16:17:50 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2020-11-15 16:17:50 -0500 |
commit | 50a253bbd77fc2803a0fcb12316a781407f3867d (patch) | |
tree | b98bffeee2cd9abf820945148669425b430704db /app/builder/base.py | |
parent | 18b2fbfb06d0848b51b047a10cf10839853c3cf9 (diff) |
added discursive page builder and button
Diffstat (limited to 'app/builder/base.py')
-rw-r--r-- | app/builder/base.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/builder/base.py b/app/builder/base.py index 04a92ce..7b99c58 100644 --- a/app/builder/base.py +++ b/app/builder/base.py @@ -15,7 +15,9 @@ class _FileWriter(object): """ Given a path and text object; write the page to disc """ - def __init__(self, path, text_object, ext='html', filename='index', base_path=settings.FLATFILES_ROOT): + def __init__(self, path, text_object, ext='html', filename='index', site='luxagraf.net'): + site = Site.objects.get(domain=site) + base_path = os.path.join(settings.PROJ_ROOT, site.domain) self.path = '%s%s' % (base_path, path) if not os.path.isdir(self.path): os.makedirs(self.path) @@ -49,7 +51,7 @@ class BuildNew(): return self.model.objects.filter(status__exact=1) def write_file(self, path, text_object, ext='html', filename='index'): - self.writer = _FileWriter(path, text_object, ext=ext, filename=filename) + self.writer = _FileWriter(path, text_object, ext=ext, filename=filename, site=self.site) def get_pages(self, qs, paginate_by): return int(ceil(Decimal(qs.count()) / Decimal(paginate_by))) |