Skip to content

Commit 7730d8c

Browse files
committed
Merge branch 'master' into release
2 parents 9bbf446 + 0b2bc64 commit 7730d8c

File tree

7 files changed

+23
-9
lines changed

7 files changed

+23
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![Emmett](https://deneb.spaces.amira.io/emmett/artwork/logo-bwb-xb-xl.png)
1+
![Emmett](https://emmett.sh/static/img/logo-bwb-xb-xl.png)
22

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

docs/debug_and_logging.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Debugger
1212

1313
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?
1414

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

1717
The debug page contains three sections:
1818

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

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

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

2929
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.
3030

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

3636
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*.
3737

emmett/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.5.10"
1+
__version__ = "2.5.11"

emmett/_reloader.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ def run_with_reloader(
155155
port,
156156
loop='auto',
157157
log_level=None,
158+
log_access=False,
158159
threads=1,
159160
threading_mode="workers",
160161
ssl_certfile: Optional[str] = None,
@@ -177,6 +178,7 @@ def run_with_reloader(
177178
kwargs={
178179
"loop": loop,
179180
"log_level": log_level,
181+
"log_access": log_access,
180182
"threads": threads,
181183
"threading_mode": threading_mode,
182184
"ssl_certfile": ssl_certfile,

emmett/cli.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ def develop_command(
291291
port,
292292
loop=loop,
293293
log_level='debug',
294+
log_access=True,
294295
threads=1,
295296
threading_mode="workers",
296297
ssl_certfile=ssl_certfile,
@@ -326,17 +327,23 @@ def develop_command(
326327
@click.option(
327328
'--log-level', type=click.Choice(LOG_LEVELS.keys()), default='info',
328329
help='Logging level.')
330+
@click.option(
331+
'--access-log/--no-access-log', is_flag=True, default=False,
332+
help='Enable access log.')
329333
@click.option(
330334
'--backlog', type=int, default=2048,
331335
help='Maximum number of connections to hold in backlog')
336+
@click.option(
337+
'--backpressure', type=int,
338+
help='Maximum number of requests to process concurrently (per worker)')
332339
@click.option(
333340
'--ssl-certfile', type=str, default=None, help='SSL certificate file')
334341
@click.option(
335342
'--ssl-keyfile', type=str, default=None, help='SSL key file')
336343
@pass_script_info
337344
def serve_command(
338345
info, host, port, workers, threads, threading_mode, interface, ws, loop, opt,
339-
log_level, backlog, ssl_certfile, ssl_keyfile
346+
log_level, access_log, backlog, backpressure, ssl_certfile, ssl_keyfile
340347
):
341348
app_target = info._get_import_name()
342349
sgi_run(
@@ -347,10 +354,12 @@ def serve_command(
347354
loop=loop,
348355
loop_opt=opt,
349356
log_level=log_level,
357+
log_access=access_log,
350358
workers=workers,
351359
threads=threads,
352360
threading_mode=threading_mode,
353361
backlog=backlog,
362+
backpressure=backpressure,
354363
enable_websockets=ws,
355364
ssl_certfile=ssl_certfile,
356365
ssl_keyfile=ssl_keyfile,

emmett/server.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ def run(
2222
loop='auto',
2323
loop_opt=False,
2424
log_level=None,
25+
log_access=False,
2526
workers=1,
2627
threads=1,
2728
threading_mode='workers',
2829
backlog=1024,
30+
backpressure=None,
2931
enable_websockets=True,
3032
ssl_certfile: Optional[str] = None,
3133
ssl_keyfile: Optional[str] = None
@@ -38,13 +40,14 @@ def run(
3840
interface=interface,
3941
workers=workers,
4042
threads=threads,
41-
pthreads=threads,
4243
threading_mode=threading_mode,
4344
loop=loop,
4445
loop_opt=loop_opt,
4546
websockets=enable_websockets,
4647
backlog=backlog,
48+
backpressure=backpressure,
4749
log_level=log_level,
50+
log_access=log_access,
4851
ssl_cert=ssl_certfile,
4952
ssl_key=ssl_keyfile
5053
)

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "emmett"
33

44
[tool.poetry]
55
name = "emmett"
6-
version = "2.5.10"
6+
version = "2.5.11"
77
description = "The web framework for inventors"
88
authors = ["Giovanni Barillari <gi0baro@d4net.org>"]
99
license = "BSD-3-Clause"
@@ -47,7 +47,7 @@ emmett = "emmett.cli:main"
4747
[tool.poetry.dependencies]
4848
python = "^3.8"
4949
click = ">=6.0"
50-
granian = "~1.3.1"
50+
granian = "~1.4.1"
5151
emmett-crypto = "^0.6"
5252
pendulum = "~3.0.0"
5353
pyDAL = "17.3"

0 commit comments

Comments
 (0)