summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2016-05-09 12:38:26 +0200
committeremkael <emkael@tlen.pl>2016-05-09 12:38:26 +0200
commitbc1e5d69f62c4a1d29ae6ac28a1d7dcb4b9f1a87 (patch)
tree477180c46aee865478806f7d494053b3a70ce1a4 /app
parent6aa0798a84f164425def56d4bff3c8928895362b (diff)
* calendar category correction mapping for import script
Diffstat (limited to 'app')
-rw-r--r--app/python/import_cals.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/python/import_cals.py b/app/python/import_cals.py
index a08bfb2..f9e7fbd 100644
--- a/app/python/import_cals.py
+++ b/app/python/import_cals.py
@@ -65,10 +65,15 @@ def update_calendar(cal, session):
db_cal.website, cal['website'], db_cal.uid)
db_cal.website = cal['website']
+ cal['category'] = CONFIG['category_mapping'][cal['category']] \
+ if ('category_mapping' in CONFIG \
+ and cal['category'] in CONFIG['category_mapping']) \
+ else cal['category']
+
# informational only
if db_cal.category.name != cal['category']:
- print 'Calendar category changed: %s -> %s (%s)' % (
- db_cal.category.name, cal['category'], db_cal.uid)
+ print 'Calendar category changed: %s -> %s (%s, %s)' % (
+ db_cal.category.name, cal['category'], db_cal.name, db_cal.uid)
def get_imported_calendars(cells, ical_markdown):