Skip to content

Commit 12ddc58

Browse files
author
Django Keel Test
committed
Minor fix
1 parent be1e336 commit 12ddc58

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ ruff>=0.1.0
1111

1212
# Type checking
1313
mypy>=1.7.0
14+
types-PyYAML>=6.0.0

src/commands/watch.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ def on_modified(self, event: FileSystemEvent) -> None:
3030

3131
self.last_modified = current_time
3232

33-
click.echo(click.style(f"\n📝 File changed: {event.src_path}", fg="yellow"))
33+
src_path = event.src_path if isinstance(event.src_path, str) else event.src_path.decode()
34+
click.echo(click.style(f"\n📝 File changed: {src_path}", fg="yellow"))
3435
click.echo(click.style("🔄 Regenerating stubs...", fg="cyan"))
3536

3637
# Trigger regeneration

src/create_mock_endpoints.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ def slugify(value: str) -> str:
1515
def generate_code_for_single_mock_api_route(endpoint_data: dict[str, Any]) -> str:
1616
if not endpoint_data["endpoint"] or not endpoint_data["method"]:
1717
return ""
18-
output_data = "@app.route('" + endpoint_data["endpoint"] + "'"
19-
output_data += ", methods=['" + endpoint_data["method"] + "'])\n"
20-
output_data += "def " + slugify(endpoint_data["description"]) + "():\n"
18+
output_data = "@app.route('" + str(endpoint_data["endpoint"]) + "'"
19+
output_data += ", methods=['" + str(endpoint_data["method"]) + "'])\n"
20+
output_data += "def " + slugify(str(endpoint_data["description"])) + "():\n"
2121
output_data += (
2222
" return Response(json.dumps(" + str(json.dumps(endpoint_data["response_body"], sort_keys=True)) + "), "
2323
)

0 commit comments

Comments
 (0)