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 May 29, 2024
2 parents 9bbf446 + 0b2bc64 commit 7730d8c
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Emmett](https://deneb.spaces.amira.io/emmett/artwork/logo-bwb-xb-xl.png)
![Emmett](https://emmett.sh/static/img/logo-bwb-xb-xl.png)

Emmett is a full-stack Python web framework designed with simplicity in mind.

Expand Down
6 changes: 3 additions & 3 deletions docs/debug_and_logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Debugger

When you run your application with the built-in development server or set your `App.debug` attribute to `True`, Emmett will use its internal debugger when an exception occurs to show you some useful information. What does that look like?

![debugger](https://deneb.spaces.amira.io/emmett/docs/debug.png)
![debugger](https://emmett.sh/static/screens/debug.png)

The debug page contains three sections:

Expand All @@ -24,14 +24,14 @@ The difference between the two tracebacks is straightforward: the first is filte

The third section of the debugger page is called *frames* and inspecting it can tell you a lot about what happened during an exception.

![debugger](https://deneb.spaces.amira.io/emmett/docs/debug_frames.png)
![debugger](https://emmett.sh/static/screens/debug_frames.png)

As you can see, for every step of the full traceback, Emmett collects – when is possible – all the variables' contents and reports them as shown in the above screen.

> – OK, dude. What happens when I have an error in a template?
> *the debugger catches them too.*
![debugger](https://deneb.spaces.amira.io/emmett/docs/debug_template.png)
![debugger](https://emmett.sh/static/screens/debug_template.png)

The debugger will also try to display the line that generated the exception in templates, complete with the error type. Still, when you forget a `pass` in a template file, it can be impossible to show you the statement that was not *passed*.

Expand Down
2 changes: 1 addition & 1 deletion emmett/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.5.10"
__version__ = "2.5.11"
2 changes: 2 additions & 0 deletions emmett/_reloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ def run_with_reloader(
port,
loop='auto',
log_level=None,
log_access=False,
threads=1,
threading_mode="workers",
ssl_certfile: Optional[str] = None,
Expand All @@ -177,6 +178,7 @@ def run_with_reloader(
kwargs={
"loop": loop,
"log_level": log_level,
"log_access": log_access,
"threads": threads,
"threading_mode": threading_mode,
"ssl_certfile": ssl_certfile,
Expand Down
11 changes: 10 additions & 1 deletion emmett/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ def develop_command(
port,
loop=loop,
log_level='debug',
log_access=True,
threads=1,
threading_mode="workers",
ssl_certfile=ssl_certfile,
Expand Down Expand Up @@ -326,17 +327,23 @@ def develop_command(
@click.option(
'--log-level', type=click.Choice(LOG_LEVELS.keys()), default='info',
help='Logging level.')
@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')
@pass_script_info
def serve_command(
info, host, port, workers, threads, threading_mode, interface, ws, loop, opt,
log_level, backlog, ssl_certfile, ssl_keyfile
log_level, access_log, backlog, backpressure, ssl_certfile, ssl_keyfile
):
app_target = info._get_import_name()
sgi_run(
Expand All @@ -347,10 +354,12 @@ def serve_command(
loop=loop,
loop_opt=opt,
log_level=log_level,
log_access=access_log,
workers=workers,
threads=threads,
threading_mode=threading_mode,
backlog=backlog,
backpressure=backpressure,
enable_websockets=ws,
ssl_certfile=ssl_certfile,
ssl_keyfile=ssl_keyfile,
Expand Down
5 changes: 4 additions & 1 deletion emmett/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ def run(
loop='auto',
loop_opt=False,
log_level=None,
log_access=False,
workers=1,
threads=1,
threading_mode='workers',
backlog=1024,
backpressure=None,
enable_websockets=True,
ssl_certfile: Optional[str] = None,
ssl_keyfile: Optional[str] = None
Expand All @@ -38,13 +40,14 @@ def run(
interface=interface,
workers=workers,
threads=threads,
pthreads=threads,
threading_mode=threading_mode,
loop=loop,
loop_opt=loop_opt,
websockets=enable_websockets,
backlog=backlog,
backpressure=backpressure,
log_level=log_level,
log_access=log_access,
ssl_cert=ssl_certfile,
ssl_key=ssl_keyfile
)
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "emmett"

[tool.poetry]
name = "emmett"
version = "2.5.10"
version = "2.5.11"
description = "The web framework for inventors"
authors = ["Giovanni Barillari <[email protected]>"]
license = "BSD-3-Clause"
Expand Down Expand Up @@ -47,7 +47,7 @@ emmett = "emmett.cli:main"
[tool.poetry.dependencies]
python = "^3.8"
click = ">=6.0"
granian = "~1.3.1"
granian = "~1.4.1"
emmett-crypto = "^0.6"
pendulum = "~3.0.0"
pyDAL = "17.3"
Expand Down

0 comments on commit 7730d8c

Please sign in to comment.