mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Cosmetic tweaks after blacken-docs, refs #1718
This commit is contained in:
parent
289e4cf80a
commit
7463b051cf
1 changed files with 4 additions and 5 deletions
|
|
@ -162,9 +162,8 @@ And here's an example which adds a ``sql_first(sql_query)`` function which execu
|
||||||
or database
|
or database
|
||||||
or next(iter(datasette.databases.keys()))
|
or next(iter(datasette.databases.keys()))
|
||||||
)
|
)
|
||||||
return (await datasette.execute(dbname, sql)).rows[
|
result = await datasette.execute(dbname, sql)
|
||||||
0
|
return result.rows[0][0]
|
||||||
][0]
|
|
||||||
|
|
||||||
return {"sql_first": sql_first}
|
return {"sql_first": sql_first}
|
||||||
|
|
||||||
|
|
@ -422,8 +421,8 @@ If the value matches that pattern, the plugin returns an HTML link element:
|
||||||
if not isinstance(value, str):
|
if not isinstance(value, str):
|
||||||
return None
|
return None
|
||||||
stripped = value.strip()
|
stripped = value.strip()
|
||||||
if not stripped.startswith("{") and stripped.endswith(
|
if not (
|
||||||
"}"
|
stripped.startswith("{") and stripped.endswith("}")
|
||||||
):
|
):
|
||||||
return None
|
return None
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue