mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Removed plugin_demo.py
This commit is contained in:
parent
db02933f1e
commit
d75e57060d
2 changed files with 0 additions and 19 deletions
|
|
@ -53,8 +53,6 @@ ureg = pint.UnitRegistry()
|
|||
|
||||
pm = pluggy.PluginManager('datasette')
|
||||
pm.add_hookspecs(hookspecs)
|
||||
import datasette.plugin_demo
|
||||
pm.register(datasette.plugin_demo)
|
||||
pm.load_setuptools_entrypoints('datasette')
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
from datasette import hookimpl
|
||||
import pint
|
||||
|
||||
ureg = pint.UnitRegistry()
|
||||
|
||||
|
||||
@hookimpl
|
||||
def prepare_jinja2_environment(env):
|
||||
env.filters['uppercase'] = lambda u: u.upper()
|
||||
|
||||
|
||||
@hookimpl
|
||||
def prepare_connection(conn):
|
||||
def convert_units(amount, from_, to_):
|
||||
"select convert_units(100, 'm', 'ft');"
|
||||
return (amount * ureg(from_)).to(to_).to_tuple()[0]
|
||||
conn.create_function('convert_units', 3, convert_units)
|
||||
Loading…
Add table
Add a link
Reference in a new issue