summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2016-05-10 12:05:00 +0200
committeremkael <emkael@tlen.pl>2016-05-10 12:05:24 +0200
commit7dd9e6b84354c12a3772db81dc5139665275d79b (patch)
tree42d51b71244bdd15145eeeb0e8f90480a5db70c4
parenta9726eec11d092583242259aea8b88f1085ad922 (diff)
* pep8 compatibilty in Python scripts
-rw-r--r--app/python/generate_cal_urls.py1
-rw-r--r--app/python/import_cals.py7
2 files changed, 4 insertions, 4 deletions
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']: