From 88f89f839ea652e9521606828312692da3fec2fe Mon Sep 17 00:00:00 2001 From: David Gay Date: Sun, 14 Jul 2013 16:35:19 -0400 Subject: [PATCH] PEP 8. --- tahrir_api/dbapi.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/tahrir_api/dbapi.py b/tahrir_api/dbapi.py index 7725d31..c88529d 100644 --- a/tahrir_api/dbapi.py +++ b/tahrir_api/dbapi.py @@ -51,7 +51,8 @@ def badge_exists(self, badge_id): :param badge_id: The ID of a Badge """ - return self.session.query(Badge).filter(func.lower(Badge.id) == func.lower(badge_id)).count() != 0 + return self.session.query(Badge).filter( + func.lower(Badge.id) == func.lower(badge_id)).count() != 0 def get_badge(self, badge_id): """ @@ -62,7 +63,8 @@ def get_badge(self, badge_id): """ if self.badge_exists(badge_id): - return self.session.query(Badge).filter(func.lower(Badge.id) == func.lower(badge_id)).one() + return self.session.query(Badge).filter( + func.lower(Badge.id) == func.lower(badge_id)).one() return None def get_all_badges(self): @@ -140,11 +142,14 @@ def person_exists(self, email=None, id=None, nickname=None): query = self.session.query(Person) if email: - return query.filter(func.lower(Person.email) == func.lower(email)).count() != 0 + return query.filter( + func.lower(Person.email) == func.lower(email)).count() != 0 elif id: return query.filter_by(id=id).count() != 0 elif nickname: - return query.filter(func.lower(Person.nickname) == func.lower(nickname)).count() != 0 + return query.filter( + func.lower(Person.nickname) == func.lower( + nickname)).count() != 0 else: return False @@ -196,11 +201,15 @@ def get_person(self, person_email=None, id=None, nickname=None): query = self.session.query(Person) if person_email and self.person_exists(email=person_email): - return query.filter(func.lower(Person.email) == func.lower(person_email)).one() + return query.filter( + func.lower(Person.email) == \ + func.lower(person_email)).one() elif id and self.person_exists(id=id): return query.filter_by(id=id).one() elif nickname and self.person_exists(nickname=nickname): - return query.filter(func.lower(Person.nickname) == func.lower(nickname)).one() + return query.filter( + func.lower(Person.nickname) == \ + func.lower(nickname)).one() else: return None