summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xconcerto_2_chrono_format.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/concerto_2_chrono_format.py b/concerto_2_chrono_format.py
index 82c3b9e..126ae98 100755
--- a/concerto_2_chrono_format.py
+++ b/concerto_2_chrono_format.py
@@ -113,13 +113,17 @@ def extract_zip_to_tmp(filename):
zipf.extractall(tempfile.gettempdir())
+def decode_iso8859(value):
+ return value.decode('iso-8859-1').encode('utf8')
+
+
class ConcertoFormatter(object):
name = 'concerto'
fieldnames = [
'ID_LIE', 'DAT_JOUR_TMP', 'HEU_DEBUT_TMP', 'HEU_FIN_TMP',
'NB_PLACESPOSS_TMP', 'NB_PLACESOCC_TMP', 'NB_PLACESRESFUT_TMP',
'NB_PLACESRES_TMP', 'NB_PLACESLIBRES_TMP', 'NB_DUREE_TMP',
- 'LIB_NOM_LIE', 'NB_PLACESRESFUTPOND_TMP']
+ 'LIB_NOM_LIE', 'LIB_GROUPE', 'NB_PLACESRESFUTPOND_TMP']
def __init__(self, filename, **kwargs):
self.filename = filename
@@ -140,7 +144,8 @@ class ConcertoFormatter(object):
agenda_id = event['ID_LIE']
if not agenda_id in agendas:
nursery_slug = agenda_id
- nursery = event['LIB_NOM_LIE'].decode('iso-8859-1').encode('utf8')
+ nursery = '%s - %s' % (
+ decode_iso8859(event['LIB_NOM_LIE']), decode_iso8859(event['LIB_GROUPE']))
agenda = {'slug': nursery_slug, 'label': nursery,
'events': [], 'kind': 'events', 'minimal_booking_delay': 0, 'maximal_booking_delay': 30}
agenda['permissions'] = {'edit': None, 'view': None}