fix: format all code with black
and from now on should not deviate from that...
This commit is contained in:
parent
0c4fa7ad06
commit
c0ff89fec3
8 changed files with 44 additions and 39 deletions
|
@ -3,4 +3,4 @@
|
||||||
from importlib.metadata import version
|
from importlib.metadata import version
|
||||||
|
|
||||||
|
|
||||||
__version__ = version('Wutta-Demo')
|
__version__ = version("Wutta-Demo")
|
||||||
|
|
|
@ -8,10 +8,7 @@ import typer
|
||||||
from wuttjamaican.cli import make_typer
|
from wuttjamaican.cli import make_typer
|
||||||
|
|
||||||
|
|
||||||
wuttademo_typer = make_typer(
|
wuttademo_typer = make_typer(name="wuttademo", help="Wutta Demo -- ")
|
||||||
name='wuttademo',
|
|
||||||
help="Wutta Demo -- "
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@wuttademo_typer.command()
|
@wuttademo_typer.command()
|
||||||
|
@ -23,8 +20,10 @@ def install(
|
||||||
"""
|
"""
|
||||||
config = ctx.parent.wutta_config
|
config = ctx.parent.wutta_config
|
||||||
app = config.get_app()
|
app = config.get_app()
|
||||||
install = app.get_install_handler(pkg_name='wuttademo',
|
install = app.get_install_handler(
|
||||||
|
pkg_name="wuttademo",
|
||||||
app_title="Wutta Demo",
|
app_title="Wutta Demo",
|
||||||
pypi_name='Wutta-Demo',
|
pypi_name="Wutta-Demo",
|
||||||
egg_name='Wutta_Demo')
|
egg_name="Wutta_Demo",
|
||||||
|
)
|
||||||
install.run()
|
install.run()
|
||||||
|
|
|
@ -10,20 +10,23 @@ class WuttaDemoConfig(WuttaConfigExtension):
|
||||||
"""
|
"""
|
||||||
Config extension for Wutta Demo
|
Config extension for Wutta Demo
|
||||||
"""
|
"""
|
||||||
key = 'wuttademo'
|
|
||||||
|
key = "wuttademo"
|
||||||
|
|
||||||
def configure(self, config):
|
def configure(self, config):
|
||||||
|
|
||||||
# app info
|
# app info
|
||||||
config.setdefault(f'{config.appname}.app_title', "Wutta Demo")
|
config.setdefault(f"{config.appname}.app_title", "Wutta Demo")
|
||||||
config.setdefault(f'{config.appname}.app_dist', "Wutta-Demo")
|
config.setdefault(f"{config.appname}.app_dist", "Wutta-Demo")
|
||||||
|
|
||||||
# app model
|
# app model
|
||||||
config.setdefault(f'{config.appname}.model_spec', 'wuttademo.db.model')
|
config.setdefault(f"{config.appname}.model_spec", "wuttademo.db.model")
|
||||||
|
|
||||||
# web app menu
|
# web app menu
|
||||||
config.setdefault(f'{config.appname}.web.menus.handler_spec',
|
config.setdefault(
|
||||||
'wuttademo.web.menus:WuttaDemoMenuHandler')
|
f"{config.appname}.web.menus.handler_spec",
|
||||||
|
"wuttademo.web.menus:WuttaDemoMenuHandler",
|
||||||
|
)
|
||||||
|
|
||||||
# web app libcache
|
# web app libcache
|
||||||
config.setdefault('wuttaweb.static_libcache.module', 'wuttademo.web.static')
|
config.setdefault("wuttaweb.static_libcache.module", "wuttademo.web.static")
|
||||||
|
|
|
@ -11,19 +11,22 @@ def main(global_config, **settings):
|
||||||
Make and return the WSGI application, per given settings.
|
Make and return the WSGI application, per given settings.
|
||||||
"""
|
"""
|
||||||
# prefer Wutta Demo templates over wuttaweb
|
# prefer Wutta Demo templates over wuttaweb
|
||||||
settings.setdefault('mako.directories', [
|
settings.setdefault(
|
||||||
'wuttademo.web:templates',
|
"mako.directories",
|
||||||
'wuttaweb:templates',
|
[
|
||||||
])
|
"wuttademo.web:templates",
|
||||||
|
"wuttaweb:templates",
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
# make config objects
|
# make config objects
|
||||||
wutta_config = base.make_wutta_config(settings)
|
wutta_config = base.make_wutta_config(settings)
|
||||||
pyramid_config = base.make_pyramid_config(settings)
|
pyramid_config = base.make_pyramid_config(settings)
|
||||||
|
|
||||||
# bring in the rest of Wutta Demo
|
# bring in the rest of Wutta Demo
|
||||||
pyramid_config.include('wuttaweb.static')
|
pyramid_config.include("wuttaweb.static")
|
||||||
pyramid_config.include('wuttademo.web.subscribers')
|
pyramid_config.include("wuttademo.web.subscribers")
|
||||||
pyramid_config.include('wuttademo.web.views')
|
pyramid_config.include("wuttademo.web.views")
|
||||||
|
|
||||||
return pyramid_config.make_wsgi_app()
|
return pyramid_config.make_wsgi_app()
|
||||||
|
|
||||||
|
|
|
@ -7,12 +7,12 @@ from fanstatic import Library, Resource
|
||||||
|
|
||||||
|
|
||||||
# fanstatic libcache
|
# fanstatic libcache
|
||||||
libcache = Library('wuttademo_libcache', 'libcache')
|
libcache = Library("wuttademo_libcache", "libcache")
|
||||||
vue_js = Resource(libcache, 'vue-2.6.14.min.js')
|
vue_js = Resource(libcache, "vue-2.6.14.min.js")
|
||||||
vue_resource_js = Resource(libcache, 'vue-resource-1.5.3.min.js')
|
vue_resource_js = Resource(libcache, "vue-resource-1.5.3.min.js")
|
||||||
buefy_js = Resource(libcache, 'buefy-0.9.25.min.js')
|
buefy_js = Resource(libcache, "buefy-0.9.25.min.js")
|
||||||
buefy_css = Resource(libcache, 'buefy-0.9.25.min.css')
|
buefy_css = Resource(libcache, "buefy-0.9.25.min.css")
|
||||||
fontawesome_js = Resource(libcache, 'fontawesome-5.3.1-all.min.js')
|
fontawesome_js = Resource(libcache, "fontawesome-5.3.1-all.min.js")
|
||||||
# bb_vue_js = Resource(libcache, 'vue.esm-browser-3.3.11.prod.js')
|
# bb_vue_js = Resource(libcache, 'vue.esm-browser-3.3.11.prod.js')
|
||||||
# bb_oruga_js = Resource(libcache, 'oruga-0.8.10.js')
|
# bb_oruga_js = Resource(libcache, 'oruga-0.8.10.js')
|
||||||
# bb_oruga_bulma_js = Resource(libcache, 'oruga-bulma-0.3.0.js')
|
# bb_oruga_bulma_js = Resource(libcache, 'oruga-bulma-0.3.0.js')
|
||||||
|
|
|
@ -8,9 +8,9 @@ import wuttademo
|
||||||
|
|
||||||
def add_wuttademo_to_context(event):
|
def add_wuttademo_to_context(event):
|
||||||
renderer_globals = event
|
renderer_globals = event
|
||||||
renderer_globals['wuttademo'] = wuttademo
|
renderer_globals["wuttademo"] = wuttademo
|
||||||
|
|
||||||
|
|
||||||
def includeme(config):
|
def includeme(config):
|
||||||
config.include('wuttaweb.subscribers')
|
config.include("wuttaweb.subscribers")
|
||||||
config.add_subscriber(add_wuttademo_to_context, 'pyramid.events.BeforeRender')
|
config.add_subscriber(add_wuttademo_to_context, "pyramid.events.BeforeRender")
|
||||||
|
|
|
@ -7,7 +7,7 @@ Wutta Demo Views
|
||||||
def includeme(config):
|
def includeme(config):
|
||||||
|
|
||||||
# core views for wuttaweb
|
# core views for wuttaweb
|
||||||
config.include('wuttaweb.views.essential')
|
config.include("wuttaweb.views.essential")
|
||||||
|
|
||||||
# TODO: include your own views here
|
# TODO: include your own views here
|
||||||
# config.include('wuttademo.web.views.widgets')
|
# config.include('wuttademo.web.views.widgets')
|
||||||
|
|
8
tasks.py
8
tasks.py
|
@ -14,8 +14,8 @@ def release(c):
|
||||||
"""
|
"""
|
||||||
Release a new version of Wutta Demo
|
Release a new version of Wutta Demo
|
||||||
"""
|
"""
|
||||||
if os.path.exists('dist'):
|
if os.path.exists("dist"):
|
||||||
shutil.rmtree('dist')
|
shutil.rmtree("dist")
|
||||||
|
|
||||||
c.run('python -m build --sdist')
|
c.run("python -m build --sdist")
|
||||||
c.run('twine upload dist/*')
|
c.run("twine upload dist/*")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue