Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/application_development/response.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ The following list of status codes are supported by PyRobusta:
| 200 | OK |
| 201 | Created |
| 204 | No Content |
| 301 | Moved Permanently |
| 302 | Found |
| 303 | See Other |
| 307 | Temporary Redirect |
| 308 | Permanent Redirect |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
Expand Down
1 change: 1 addition & 0 deletions docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ The server will skip Wi-Fi connection if the credentials are missing, allowing t

```python
# boot.py
import asyncio
import machine
from pyrobusta import application

Expand Down
10 changes: 10 additions & 0 deletions src/pyrobusta/protocol/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ class HttpEngine:
b"201 Created",
204,
b"204 No Content",
301,
b"301 Moved Permanently",
302,
b"302 Found",
303,
b"303 See Other",
307,
b"307 Temporary Redirect",
308,
b"308 Permanent Redirect",
400,
b"400 Bad Request",
401,
Expand Down
15 changes: 13 additions & 2 deletions src/pyrobusta/utils/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@
Helper functions to install assets.
"""

from os import mkdir, listdir, stat
from os import mkdir, stat

try:
from os import ilistdir
except ImportError:
from os import listdir

def ilistdir(path):
"""Fallback definition of ilistdir"""
for name in listdir(path):
yield (name,)


from pyrobusta import WORKING_DIR

Expand Down Expand Up @@ -37,7 +48,7 @@ def iterate_fs(root, iter_mode=FS_ITER_FILE, path_mode=FS_ITER_ABS):
dirs = [root]
while dirs:
current_directory = dirs.pop(0)
for name in listdir(current_directory):
for name, *_ in ilistdir(current_directory):
if current_directory == "/":
current_path = "/" + name
else:
Expand Down
Loading