Skip to content

Commit

Permalink
fix: add type annotations and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
ch-iv committed Jul 11, 2024
1 parent 2aa2c3c commit 71d1312
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions examples/chat_application/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class JoinMessage(NamedTuple):
username: str
message_type: str = "user_join"

def __str__(self):
def __str__(self) -> str:
return json.dumps(
{
"message_type": self.message_type,
Expand All @@ -28,7 +28,7 @@ class LeaveMessage(NamedTuple):
username: str
message_type: str = "user_leave"

def __str__(self):
def __str__(self) -> str:
return json.dumps(
{
"message_type": self.message_type,
Expand All @@ -42,7 +42,7 @@ class SendMessage(NamedTuple):
content: str
message_type: str = "send"

def __str__(self):
def __str__(self) -> str:
return json.dumps({"message_type": self.message_type, "sender": self.sender, "content": self.content})


Expand Down Expand Up @@ -70,7 +70,7 @@ def chat(ws: WebSocket) -> None:


@app.route("/")
def index():
def index() -> str:
session["username"] = generate_username()
return render_template("index.html")

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "flask-websockets"
version = "0.1.0"
version = "0.1.1"
description = "A WebSockets and channels implementation for Flask"
authors = [
{name = "ch-iv", email = "[email protected]"},
Expand Down

0 comments on commit 71d1312

Please sign in to comment.