From 7dd9e6b84354c12a3772db81dc5139665275d79b Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 10 May 2016 12:05:00 +0200 Subject: * pep8 compatibilty in Python scripts --- app/python/generate_cal_urls.py | 1 + app/python/import_cals.py | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/python/generate_cal_urls.py b/app/python/generate_cal_urls.py index 4546b5c..a79f9d0 100644 --- a/app/python/generate_cal_urls.py +++ b/app/python/generate_cal_urls.py @@ -3,6 +3,7 @@ from slugify import slugify from rcal.db import Session from rcal.model import Calendar + def main(): session = Session.create() for calendar in session.query(Calendar).all(): diff --git a/app/python/import_cals.py b/app/python/import_cals.py index ae33c84..f0b5262 100644 --- a/app/python/import_cals.py +++ b/app/python/import_cals.py @@ -65,10 +65,9 @@ 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'] + if 'category_mapping' in CONFIG and \ + cal['category'] in CONFIG['category_mapping']: + cal['category'] = CONFIG['category_mapping'][cal['category']] # informational only if db_cal.category.name != cal['category']: -- cgit v1.2.3