equal
deleted
inserted
replaced
80 2. templatepath/map-style |
80 2. templatepath/map-style |
81 3. templatepath/map |
81 3. templatepath/map |
82 """ |
82 """ |
83 locations = style and [os.path.join(style, "map"), "map-"+style] or [] |
83 locations = style and [os.path.join(style, "map"), "map-"+style] or [] |
84 locations.append("map") |
84 locations.append("map") |
85 for location in locations: |
85 if isinstance(templatepath, str): |
86 mapfile = os.path.join(templatepath, location) |
86 templatepath = [templatepath] |
87 if os.path.isfile(mapfile): |
87 for path in templatepath: |
88 return mapfile |
88 for location in locations: |
|
89 mapfile = os.path.join(path, location) |
|
90 if os.path.isfile(mapfile): |
|
91 return mapfile |
89 raise RuntimeError("No hgweb templates found in %r" % templatepath) |
92 raise RuntimeError("No hgweb templates found in %r" % templatepath) |
90 |
93 |
91 def paritygen(stripecount, offset=0): |
94 def paritygen(stripecount, offset=0): |
92 """count parity of horizontal stripes for easier reading""" |
95 """count parity of horizontal stripes for easier reading""" |
93 if stripecount and offset: |
96 if stripecount and offset: |