__init__.py

Go to the documentation of this file.
00001 from parser import L20nParser as Parser
00002 from structure import LOL as Structure
00003 
00004 class L20nFormatParser ():
00005     name = 'l20n'
00006     desc = "L20n reader/writer"
00007     extensions = ['lol']
00008     encoding = 'utf_8' # allowed encoding
00009     fallback = None
00010 
00011     @classmethod
00012     def dump_l10nobject (cls, l10nobject):
00013         #text = Serializer.serialize(l10nObject)
00014         text = ""
00015         return text
00016 
00017     @classmethod
00018     def get_entitylist (cls, text, code='default'):
00019         l10nobject = cls.get_l10nobject(text, code=code)
00020         entitylist = EntityList()
00021         for i in l10nobject.structure:
00022             if isinstance(i, Entity):
00023                 entitylist.add_entity(silme.core.entity.Entity(i.id, i.get_value()))
00024         return entitylist
00025 
00026     @classmethod
00027     def get_l10nobject (cls, text, code='default'):
00028         l10nobject = Parser().parse(text)
00029         return l10nobject
00030 
00031 def register(Manager):
00032     Manager.register(L20nFormatParser)

Generated on Tue May 12 17:37:27 2009 for silme by  doxygen 1.5.8