ExportCSV: allow lowercase matching of place type

This commit is contained in:
Doug Blank 2015-08-04 08:38:15 -04:00
parent 2c6a5a2abf
commit d42fa602ed

View File

@ -139,11 +139,13 @@ class CSVParser(object):
# Build reverse dictionary, name to type number # Build reverse dictionary, name to type number
for items in PlaceType().get_map().items(): # (0, 'Custom') for items in PlaceType().get_map().items(): # (0, 'Custom')
self.place_types[items[1]] = items[0] self.place_types[items[1]] = items[0]
self.place_types[items[1].lower()] = items[0]
if _(items[1]) != items[1]: if _(items[1]) != items[1]:
self.place_types[_(items[1])] = items[0] self.place_types[_(items[1])] = items[0]
# Add custom types: # Add custom types:
for custom_type in self.db.get_place_types(): for custom_type in self.db.get_place_types():
self.place_types[custom_type] = 0 self.place_types[custom_type] = 0
self.place_types[custom_type.lower()] = 0
column2label = { column2label = {
"surname": ("Lastname", "Surname", _("Surname"), "lastname", "surname": ("Lastname", "Surname", _("Surname"), "lastname",
"last_name", "surname", _("surname")), "last_name", "surname", _("surname")),