##// END OF EJS Templates
Install the templates where they can be found by hgweb.py...
mpm@selenic.com -
r157:2653740d default
parent child Browse files
Show More
@@ -13,6 +13,11 b' cgitb.enable()'
13 import os, cgi, time, re, difflib, sys, zlib
13 import os, cgi, time, re, difflib, sys, zlib
14 from mercurial.hg import *
14 from mercurial.hg import *
15
15
16 def templatepath():
17 for f in "templates/map", "../templates/map":
18 p = os.path.join(os.path.dirname(__file__), f)
19 if os.path.isfile(p): return p
20
16 def age(t):
21 def age(t):
17 def plural(t, c):
22 def plural(t, c):
18 if c == 1: return t
23 if c == 1: return t
@@ -102,7 +107,9 b' class hgweb:'
102 maxchanges = 20
107 maxchanges = 20
103 maxfiles = 10
108 maxfiles = 10
104
109
105 def __init__(self, path, name, templatemap):
110 def __init__(self, path, name, templatemap = ""):
111 templatemap = templatemap or templatepath()
112
106 self.reponame = name
113 self.reponame = name
107 self.repo = repository(ui(), path)
114 self.repo = repository(ui(), path)
108 self.t = templater(templatemap)
115 self.t = templater(templatemap)
@@ -5,7 +5,15 b''
5 # './setup.py install', or
5 # './setup.py install', or
6 # './setup.py --help' for more options
6 # './setup.py --help' for more options
7
7
8 import glob
8 from distutils.core import setup, Extension
9 from distutils.core import setup, Extension
10 from distutils.command.install_data import install_data
11
12 class install_package_data(install_data):
13 def finalize_options(self):
14 self.set_undefined_options('install',
15 ('install_lib', 'install_dir'))
16 install_data.finalize_options(self)
9
17
10 setup(name='mercurial',
18 setup(name='mercurial',
11 version='0.4f',
19 version='0.4f',
@@ -16,4 +24,7 b" setup(name='mercurial',"
16 license='GNU GPL',
24 license='GNU GPL',
17 packages=['mercurial'],
25 packages=['mercurial'],
18 ext_modules=[Extension('mercurial.mpatch', ['mercurial/mpatch.c'])],
26 ext_modules=[Extension('mercurial.mpatch', ['mercurial/mpatch.c'])],
27 data_files=[('mercurial/templates',
28 ['templates/map'] + glob.glob('templates/*.tmpl'))],
29 cmdclass = { 'install_data' : install_package_data },
19 scripts=['hg'])
30 scripts=['hg'])
General Comments 0
You need to be logged in to leave comments. Login now