Fix simple format parser to accept l10n contexts with a space

This commit is contained in:
Vincent Untz 2010-04-17 17:59:30 -04:00
parent 15c28d90fb
commit d020617c2a

View File

@ -483,7 +483,7 @@ class SimpleSchemaParser:
def _parse_l10n(self):
line = self.unparsed_line
items = [ item.strip() for item in line.split(' ') if item.strip() ]
items = [ item.strip() for item in line.split(' ', 1) if item.strip() ]
if not items:
self.unparsed_line = ''
return (None, None)
@ -494,7 +494,7 @@ class SimpleSchemaParser:
self.unparsed_line = ''
return (items[0], items[1])
raise GSettingsSchemaConvertException('Localization \'%s\' cannot be parsed.' % line)
raise GSettingsSchemaConvertException('Internal error: more items than expected for localization \'%s\'.' % line)
def _parse_choices(self, object):
if object.type not in TYPES_FOR_CHOICES: