from django.shortcuts import render_to_response from django.template import RequestContext from builder.base import BuildWriting, BuildWritingFeed, BuildMap, BuildPhotos, BuildProjects, BuildSitemap, BuildPages from src.build import builder as src_build from jrnl.build import BuildJrnl, build_arc, build_detail from resume.build import builder as resume_builder from books.build import builder as book_builder options = { 'writing': BuildWriting, 'photo_galleries': BuildPhotos, 'projects': BuildProjects, 'pages': BuildPages, 'map': BuildMap, 'feed': BuildWritingFeed, 'sitemap': BuildSitemap, } def do_build(request): section = request.GET.get('id', '') context = {} if section == 'builddetails': context = {'message': 'Writing Jrnl Permalinks to Disk'} build_detail() elif section == 'writingarchives': context = {'message': 'Writing Jrnl Archives to Disk'} build_arc() elif section == 'resume': context = {'message': 'Writing Resume to Disk'} resume_builder() elif section == 'buildrss': context = {'message': 'Writing RSS to Disk'} BuildJrnl().build_feed("jrnl:feed") elif section == 'homepage': context = {'message': 'Writing index to Disk'} BuildWriting().build_homepage() elif section == 'buildbooks': context = {'message': 'Writing Book Pages to Disk'} book_builder() elif section == 'src': context = {'message': 'Writing src section to Disk'} src_build() else: options[section]().build() context = {'message': 'Writing %s to Disk' % section} return render_to_response('admin/message.html', context, context_instance=RequestContext(request)) """ elif section == 'pages': p = PageGenerator(settings.PROJ_ROOT + '_pages') p.write_files() context = {'message': 'Building pages from flatfiles'} """