diff hgwebsite.py @ 401:4d4c4b73808e

Use absolute paths
author David Soria Parra <dsp@php.net>
date Sat, 08 Mar 2014 02:03:33 +0000
parents 20cfd68e9c49
children 4dfad479ee98
line wrap: on
line diff
--- a/hgwebsite.py	Fri Mar 07 16:08:01 2014 -0800
+++ b/hgwebsite.py	Sat Mar 08 02:03:33 2014 +0000
@@ -18,7 +18,8 @@
 def about(site=None):
     if not site:
         flask.abort(404)
-    tpath = os.path.join('templates', site, 'index.html')
+    root = os.path.dirname(os.path.abspath(__file__))
+    tpath = os.path.join(root, 'templates', site, 'index.html')
     if not os.path.exists(tpath):
         flask.abort(404)
     t = os.path.join(site, 'index.html')