Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
gi0baro committed Nov 15, 2024
2 parents bbd4865 + 64f0c8b commit ff7f56b
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 10 deletions.
2 changes: 1 addition & 1 deletion emmett/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.6.1"
__version__ = "2.6.2"
29 changes: 25 additions & 4 deletions emmett/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import code
import os
import pathlib
import re
import sys
import types
Expand Down Expand Up @@ -232,8 +233,18 @@ def main(self, *args, **kwargs):
@click.option(
"--loop", type=click.Choice(["auto", "asyncio", "uvloop"]), default="auto", help="Event loop implementation."
)
@click.option("--ssl-certfile", type=str, default=None, help="SSL certificate file")
@click.option("--ssl-keyfile", type=str, default=None, help="SSL key file")
@click.option(
"--ssl-certfile",
type=click.Path(exists=True, file_okay=True, dir_okay=False, readable=True, path_type=pathlib.Path),
default=None,
help="SSL certificate file",
)
@click.option(
"--ssl-keyfile",
type=click.Path(exists=True, file_okay=True, dir_okay=False, readable=True, path_type=pathlib.Path),
default=None,
help="SSL key file",
)
@click.option("--reloader/--no-reloader", is_flag=True, default=True, help="Runs with reloader.")
@pass_script_info
def develop_command(info, host, port, interface, loop, ssl_certfile, ssl_keyfile, reloader):
Expand Down Expand Up @@ -296,8 +307,18 @@ def develop_command(info, host, port, interface, loop, ssl_certfile, ssl_keyfile
@click.option("--access-log/--no-access-log", is_flag=True, default=False, help="Enable access log.")
@click.option("--backlog", type=int, default=2048, help="Maximum number of connections to hold in backlog")
@click.option("--backpressure", type=int, help="Maximum number of requests to process concurrently (per worker)")
@click.option("--ssl-certfile", type=str, default=None, help="SSL certificate file")
@click.option("--ssl-keyfile", type=str, default=None, help="SSL key file")
@click.option(
"--ssl-certfile",
type=click.Path(exists=True, file_okay=True, dir_okay=False, readable=True, path_type=pathlib.Path),
default=None,
help="SSL certificate file",
)
@click.option(
"--ssl-keyfile",
type=click.Path(exists=True, file_okay=True, dir_okay=False, readable=True, path_type=pathlib.Path),
default=None,
help="SSL key file",
)
@pass_script_info
def serve_command(
info,
Expand Down
4 changes: 2 additions & 2 deletions emmett/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@ async def _process(self, **kwargs):
#: handle uploads
for field in filter(lambda f: f.type == "upload", self.writable_fields):
upload = self.files[field.name]
del_field = field.name + "__del"
if not upload.filename:
if not upload:
del_field = field.name + "__del"
if self.input_params.get(del_field, False):
self.params[field.name] = self.table[field.name].default or ""
# TODO: do we want to physically delete file?
Expand Down
2 changes: 1 addition & 1 deletion emmett/routing/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from typing import Any, Dict, Tuple, Union

from emmett_core.http.response import HTTPResponse, HTTPStringResponse
from emmett_core.http.response import HTTPStringResponse
from emmett_core.routing.response import ResponseProcessor
from renoir.errors import TemplateMissingError

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "emmett"
version = "2.6.1"
version = "2.6.2"
description = "The web framework for inventors"
readme = "README.md"
license = "BSD-3-Clause"
Expand Down Expand Up @@ -35,7 +35,7 @@ classifiers = [

dependencies = [
"click>=6.0",
"emmett-core[granian,rapidjson]~=1.0.2",
"emmett-core[granian,rapidjson]~=1.0.4",
"emmett-pydal==17.3.1",
"pendulum~=3.0.0",
"pyyaml~=6.0",
Expand Down

0 comments on commit ff7f56b

Please sign in to comment.