__init__.py
Go to the documentation of this file.00001 from parser import PropertiesParser as Parser
00002 from structure import PropertiesStructure as Structure
00003 from serializer import PropertiesSerializer as Serializer
00004
00005 class PropertiesFormatParser():
00006 name = 'properties'
00007 desc = "Java Properties reader/writer"
00008 extensions = ['properties']
00009 encoding = 'utf_8'
00010 fallback = None
00011
00012 @classmethod
00013 def dump_l10nobject (cls, l10nobject):
00014 text = Serializer.serialize(l10nobject)
00015 return text
00016
00017 @classmethod
00018 def dump_entitylist (cls, elist):
00019 text = Serializer.dump_entitylist(elist)
00020 return text
00021
00022 @classmethod
00023 def get_entitylist (cls, text, code='default'):
00024
00025 if text and (text[0] == unichr(65279)):
00026 text = text[1:]
00027 l10nobject = Parser.parse_to_entitylist(text, code=code)
00028 return l10nobject
00029
00030 @classmethod
00031 def get_l10nobject (cls, text, code='default'):
00032
00033 if text and (text[0] == unichr(65279)):
00034 text = text[1:]
00035 l10nobject = Parser.parse(text, code=code)
00036 return l10nobject
00037
00038
00039 def register(Manager):
00040 Manager.register(PropertiesFormatParser)