Move template_dir inside config.
authorFabien Ninoles <fabien@tzone.org>
Sun, 28 Dec 2008 15:19:40 -0500
changeset 63 8f246bc7059d
parent 62 56193b37f666
child 64 f1b93ddec9e0
Move template_dir inside config.
lib/config.py
lib/templates.py
--- a/lib/config.py	Sun Dec 28 13:45:59 2008 -0500
+++ b/lib/config.py	Sun Dec 28 15:19:40 2008 -0500
@@ -5,3 +5,4 @@
 passwd = 'crow'
 database = 'bookmarker3'
 port = 10021
+template_dir = 'templates'
--- a/lib/templates.py	Sun Dec 28 13:45:59 2008 -0500
+++ b/lib/templates.py	Sun Dec 28 15:19:40 2008 -0500
@@ -1,8 +1,8 @@
 from htmltmpl import TemplateManager, TemplateProcessor
 from urlparse import urljoin
 from os import environ, path
+from config import template_dir
 
-TEMPLATE_DIR = "templates"
 def get_curl():
 	url = "http"
 	if environ["HTTPS"] == 'on':
@@ -15,7 +15,7 @@
 class Template:
 	def __init__(self, template, prefs, status = "msg", status_msg = ""):
 		self.tproc = TemplateProcessor()
-		self.tmpl = TemplateManager().prepare(path.join(TEMPLATE_DIR, template))
+		self.tmpl = TemplateManager().prepare(path.join(template_dir, template))
     		self.set("remote_user", prefs["fullname"])
     		self.set("kw_size", prefs['keywords_box'])
     		self.set("kw_sort", prefs['keywords_sort'])