diff options
Diffstat (limited to 'chimere/utils.py')
| -rw-r--r-- | chimere/utils.py | 13 | 
1 files changed, 12 insertions, 1 deletions
| diff --git a/chimere/utils.py b/chimere/utils.py index 8066255..96c41b4 100644 --- a/chimere/utils.py +++ b/chimere/utils.py @@ -53,7 +53,7 @@ def unicode_normalize(string):          string = unicode(string.decode('utf-8'))      return ''.join(          (c for c in unicodedata.normalize('NFD', string) -         if unicodedata.category(c) != 'Mn')) +         if unicodedata.category(c) not in ('Mn', 'Sm', 'Sc')))  class ImportManager(object): @@ -718,6 +718,8 @@ class JsonManager(ImportManager):          for item in values:              dct = default_dct.copy()              for k in filtr: +                if k.startswith('prefix_') or k.startswith('suffix_'): +                    continue                  if k in item and item[k]:                      if filtr[k] not in dct:                          dct[filtr[k]] = "" @@ -740,6 +742,15 @@ class JsonManager(ImportManager):                                                             item['y'])              if not dct['point']:                  continue +            for k in filtr: +                if k.startswith('prefix_') or k.startswith('suffix_'): +                    pos = k.split('_')[0] +                    key = '_'.join(k.split('_')[1:]) +                    if key in dct: +                        if pos == 'prefix': +                            dct[key] = filtr[k] + dct[key] +                        else: +                            dct[key] += filtr[k]              cls = Marker              pl_id = (dct.pop('id') if 'id' in dct else dct['name']) \                  + "-" + unicode(self.importer_instance.pk) | 
