Show More
@@ -13,6 +13,11 b' cgitb.enable()' | |||
|
13 | 13 | import os, cgi, time, re, difflib, sys, zlib |
|
14 | 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 | 21 | def age(t): |
|
17 | 22 | def plural(t, c): |
|
18 | 23 | if c == 1: return t |
@@ -102,7 +107,9 b' class hgweb:' | |||
|
102 | 107 | maxchanges = 20 |
|
103 | 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 | 113 | self.reponame = name |
|
107 | 114 | self.repo = repository(ui(), path) |
|
108 | 115 | self.t = templater(templatemap) |
@@ -5,7 +5,15 b'' | |||
|
5 | 5 | # './setup.py install', or |
|
6 | 6 | # './setup.py --help' for more options |
|
7 | 7 | |
|
8 | import glob | |
|
8 | 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 | 18 | setup(name='mercurial', |
|
11 | 19 | version='0.4f', |
@@ -16,4 +24,7 b" setup(name='mercurial'," | |||
|
16 | 24 | license='GNU GPL', |
|
17 | 25 | packages=['mercurial'], |
|
18 | 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 | 30 | scripts=['hg']) |
General Comments 0
You need to be logged in to leave comments.
Login now