web/texpand.py~
changeset 2 52d12eb31c30
parent 1 672eaaab9204
child 3 6cee07c589cb
--- a/web/texpand.py~	Fri Feb 05 23:42:24 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-#!/usr/bin/env python
-#
-# Use Django's template machinery to expand static web pages.  First
-# tries the default template path for a particular installation, then
-# looks for templates in the filesystem.
-
-import sys
-sys.path.append('/home/amit/hgbook-alqua/web/hgbook')
-from django.template import Context, TemplateDoesNotExist
-from django.template.loader import get_template, get_template_from_string
-from django.core.management import setup_environ
-import hgbook.settings as settings
-
-
-setup_environ(settings)
-c = Context()
-
-if len(sys.argv) == 2:
-    in_name = sys.argv[1]
-    out_name = 'stdout'
-    out_fp = sys.stdout
-elif len(sys.argv) == 3:
-    in_name = sys.argv[1]
-    out_name = sys.argv[2]
-    out_fp = None
-else:
-    print >> sys.stderr, 'Usage: %s template-file [output-file]'
-    sys.exit(1)
-    
-try:
-    t = get_template(in_name)
-except TemplateDoesNotExist:
-    t = get_template_from_string(open(in_name).read(), name=in_name)
-if out_fp is None:
-    out_fp = open(out_name, 'w')
-out_fp.write(t.render(c))
-out_fp.close()