diff options
author | Joris | 2024-05-20 20:09:01 +0200 |
---|---|---|
committer | Joris | 2024-06-02 14:20:50 +0200 |
commit | e8da9790dc6d55cd2e8883322cdf9a7bf5b4f5b7 (patch) | |
tree | c960e1036e3d93c1f91b58dfe9e3c8e6038ed363 /src/utils.py | |
parent | d2f33d8e854b7fda6bae389d983025e6c8609842 (diff) |
Migrate to sanic
Diffstat (limited to 'src/utils.py')
-rw-r--r-- | src/utils.py | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/src/utils.py b/src/utils.py index ccf92c0..151217f 100644 --- a/src/utils.py +++ b/src/utils.py @@ -1,16 +1,5 @@ import io -def transfer(reader, writer, content_length = None, buffer_size = io.DEFAULT_BUFFER_SIZE): - if content_length is None: - while (data := reader.read(buffer_size)): - writer.write(data) - else: - remaining = content_length - while remaining > 0: - size = min(buffer_size, remaining) - writer.write(reader.read(size)) - remaining -= size - def sanitize_filename(s: str) -> str: return '.'.join([sanitize_filename_part(p) for p in s.split('.')]) |