comparison mercurial/templater.py @ 1897:58b6784cf9f1

move hgweb.templatepath into templater
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Sun, 26 Feb 2006 13:09:26 -0800
parents f8f818a04f5b
children 888d298ddb91
comparison
equal deleted inserted replaced
1896:f8f818a04f5b 1897:58b6784cf9f1
103 "short": (lambda x: x[:12]), 103 "short": (lambda x: x[:12]),
104 "firstline": (lambda x: x.splitlines(1)[0]), 104 "firstline": (lambda x: x.splitlines(1)[0]),
105 "permissions": (lambda x: x and "-rwxr-xr-x" or "-rw-r--r--"), 105 "permissions": (lambda x: x and "-rwxr-xr-x" or "-rw-r--r--"),
106 "rfc822date": lambda x: util.datestr(x, "%a, %d %b %Y %H:%M:%S"), 106 "rfc822date": lambda x: util.datestr(x, "%a, %d %b %Y %H:%M:%S"),
107 } 107 }
108
109 def templatepath():
110 for f in "templates", "../templates":
111 p = os.path.join(os.path.dirname(__file__), f)
112 if os.path.isdir(p):
113 return os.path.normpath(p)