Skip to content

Commit dd0eee9

Browse files
committed
Un-DRY query parameter docstrings
f-strings are not valid Python doc strings.
1 parent 0f31141 commit dd0eee9

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

sogs/routes/messages.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,10 @@
99
messages = Blueprint('messages', __name__)
1010

1111

12-
_query_limit_doc = """# Query Parameters
13-
14-
The request takes an optional `limit` query parameter indicating the number of messages to
15-
return (up to 256). If omitted, 100 messages are returned."""
16-
17-
1812
@messages.get("/room/<Room:room>/messages/since/<int:seqno>")
1913
@auth.read_required
2014
def messages_since(room, seqno):
21-
f"""
15+
"""
2216
Retrieves message *updates* from a room. This is the main message polling endpoint in SOGS.
2317
2418
This endpoint retrieves new, edited, and deleted messages posted to this room since the given
@@ -34,7 +28,10 @@ def messages_since(room, seqno):
3428
retrieve from the beginning of the room's message history use a value of 0 (the first room
3529
post will always be >= 1).
3630
37-
{_query_limit_doc}
31+
# Query Parameters
32+
33+
The request takes an optional `limit` query parameter indicating the number of messages to
34+
return (up to 256). If omitted, 100 messages are returned.
3835
3936
# Return value
4037
@@ -63,7 +60,7 @@ def messages_since(room, seqno):
6360
@messages.get("/room/<Room:room>/messages/before/<int:msg_id>")
6461
@auth.read_required
6562
def messages_before(room, msg_id):
66-
f"""
63+
"""
6764
Retrieves messages from the room preceding a given id.
6865
6966
This endpoint is intended to be used with `.../recent` to allow a client to retrieve the most
@@ -77,7 +74,10 @@ def messages_before(room, msg_id):
7774
7875
- `msg_id` a numeric integer ID; the messages immediately *before* this ID are returned.
7976
80-
{_query_limit_doc}
77+
# Query Parameters
78+
79+
The request takes an optional `limit` query parameter indicating the number of messages to
80+
return (up to 256). If omitted, 100 messages are returned.
8181
8282
# Return value
8383
@@ -100,7 +100,7 @@ def messages_before(room, msg_id):
100100
@messages.get("/room/<Room:room>/messages/recent")
101101
@auth.read_required
102102
def messages_recent(room):
103-
f"""
103+
"""
104104
Retrieves recent messages posted to this room.
105105
106106
Returns the most recent `limit` messages (100 if no limit is given). This only returns extant
@@ -110,7 +110,10 @@ def messages_recent(room):
110110
111111
# URL Parameters
112112
113-
{_query_limit_doc}
113+
# Query Parameters
114+
115+
The request takes an optional `limit` query parameter indicating the number of messages to
116+
return (up to 256). If omitted, 100 messages are returned.
114117
115118
# Return value
116119

0 commit comments

Comments
 (0)