PEP8 cleanups

This commit is contained in:
Erik Johnston 2014-08-15 16:17:36 +01:00
parent 8fa3cc37f9
commit d260a42ca2
7 changed files with 29 additions and 16 deletions

View file

@ -87,19 +87,26 @@ class RoomStore(SQLBaseStore):
"""
topic_subquery = (
"SELECT topics.event_id as event_id, topics.room_id as room_id, topic FROM topics "
"SELECT topics.event_id as event_id, "
"topics.room_id as room_id, topic "
"FROM topics "
"INNER JOIN current_state_events as c "
"ON c.event_id = topics.event_id "
)
name_subquery = (
"SELECT room_names.event_id as event_id, room_names.room_id as room_id, name FROM room_names "
"SELECT room_names.event_id as event_id, "
"room_names.room_id as room_id, name "
"FROM room_names "
"INNER JOIN current_state_events as c "
"ON c.event_id = room_names.event_id "
)
# We use non printing ascii character US () as a seperator
sql = (
"SELECT r.room_id, n.name, t.topic, group_concat(a.room_alias) FROM rooms AS r "
"SELECT r.room_id, n.name, t.topic, "
"group_concat(a.room_alias, '') "
"FROM rooms AS r "
"LEFT JOIN (%(topic)s) AS t ON t.room_id = r.room_id "
"LEFT JOIN (%(name)s) AS n ON n.room_id = r.room_id "
"INNER JOIN room_aliases AS a ON a.room_id = r.room_id "
@ -117,7 +124,7 @@ class RoomStore(SQLBaseStore):
"room_id": r[0],
"name": r[1],
"topic": r[2],
"aliases": r[3].split(","),
"aliases": r[3].split(""),
}
for r in rows
]