def ItemFormatter(self, t): if t == 'rc_header': from grit.format import rc_header # import here to avoid circular dep return rc_header.TopLevel() elif t in ['rc_all', 'rc_translateable', 'rc_nontranslateable']: from grit.format import rc # avoid circular dep return rc.TopLevel() elif t == 'c_format': from grit.format import c_format return c_format.TopLevel() elif t == 'resource_map_header': from grit.format import resource_map return resource_map.HeaderTopLevel() elif t in ('resource_map_source', 'resource_file_map_source'): from grit.format import resource_map return resource_map.SourceTopLevel() elif t == 'js_map_format': from grit.format import js_map_format return js_map_format.TopLevel() elif t in ('adm', 'plist', 'plist_strings', 'admx', 'adml', 'doc', 'json', 'reg'): from grit.format.policy_templates import template_formatter return template_formatter.TemplateFormatter(t) else: return super(type(self), self).ItemFormatter(t)
def ItemFormatter(self, t): if t == 'rc_header': from grit.format import rc_header # import here to avoid circular dep return rc_header.TopLevel() elif t in ['rc_all', 'rc_translateable', 'rc_nontranslateable']: from grit.format import rc # avoid circular dep return rc.TopLevel() elif t == 'resource_map_header': from grit.format import resource_map return resource_map.HeaderTopLevel() elif t == 'resource_map_source': from grit.format import resource_map return resource_map.SourceTopLevel() elif t == 'js_map_format': from grit.format import js_map_format return js_map_format.TopLevel() else: return super(type(self), self).ItemFormatter(t)