equal
deleted
inserted
replaced
16 short, |
16 short, |
17 ) |
17 ) |
18 |
18 |
19 from . import ( |
19 from . import ( |
20 encoding, |
20 encoding, |
|
21 error, |
21 templater, |
22 templater, |
22 util, |
|
23 ) |
23 ) |
24 |
24 |
25 class baseformatter(object): |
25 class baseformatter(object): |
26 def __init__(self, ui, topic, opts): |
26 def __init__(self, ui, topic, opts): |
27 self._ui = ui |
27 self._ui = ui |
177 tmpl = t |
177 tmpl = t |
178 return tmpl, None |
178 return tmpl, None |
179 |
179 |
180 if tmpl == 'list': |
180 if tmpl == 'list': |
181 ui.write(_("available styles: %s\n") % templater.stylelist()) |
181 ui.write(_("available styles: %s\n") % templater.stylelist()) |
182 raise util.Abort(_("specify a template")) |
182 raise error.Abort(_("specify a template")) |
183 |
183 |
184 # perhaps it's a path to a map or a template |
184 # perhaps it's a path to a map or a template |
185 if ('/' in tmpl or '\\' in tmpl) and os.path.isfile(tmpl): |
185 if ('/' in tmpl or '\\' in tmpl) and os.path.isfile(tmpl): |
186 # is it a mapfile for a style? |
186 # is it a mapfile for a style? |
187 if os.path.basename(tmpl).startswith("map-"): |
187 if os.path.basename(tmpl).startswith("map-"): |