예제 #1
0
파일: misc.py 프로젝트: uhack0730/pak-tools
 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)
예제 #2
0
 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)