Compare commits
No commits in common. "master" and "v0.1.0" have entirely different histories.
16 changed files with 55 additions and 87 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,2 @@
|
||||||
*.pyc
|
*.pyc
|
||||||
dist/
|
|
||||||
Wutta_Demo.egg-info/
|
Wutta_Demo.egg-info/
|
||||||
|
|
|
@ -2,5 +2,3 @@
|
||||||
# Wutta Demo
|
# Wutta Demo
|
||||||
|
|
||||||
This is a starter Python project.
|
This is a starter Python project.
|
||||||
|
|
||||||
[](https://github.com/psf/black)
|
|
||||||
|
|
|
@ -31,12 +31,11 @@ dependencies = [
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
wuttademo = "wuttademo.commands:wuttademo_typer"
|
wuttademo = "wuttademo.commands:wuttademo_typer"
|
||||||
|
|
||||||
[project.entry-points."fanstatic.libraries"]
|
|
||||||
wuttademo_libcache = "wuttademo.web.static:libcache"
|
|
||||||
|
|
||||||
[project.entry-points."wutta.config.extensions"]
|
[project.entry-points."wutta.config.extensions"]
|
||||||
"wuttademo" = "wuttademo.config:WuttaDemoConfig"
|
"wuttademo" = "wuttademo.config:WuttaDemoConfig"
|
||||||
|
|
||||||
|
|
||||||
[project.entry-points."paste.app_factory"]
|
[project.entry-points."paste.app_factory"]
|
||||||
"main" = "wuttademo.web.app:main"
|
"main" = "wuttademo.web.app:main"
|
||||||
|
|
||||||
|
|
|
@ -3,4 +3,4 @@
|
||||||
from importlib.metadata import version
|
from importlib.metadata import version
|
||||||
|
|
||||||
|
|
||||||
__version__ = version("Wutta-Demo")
|
__version__ = version('Wutta-Demo')
|
||||||
|
|
|
@ -8,7 +8,10 @@ import typer
|
||||||
from wuttjamaican.cli import make_typer
|
from wuttjamaican.cli import make_typer
|
||||||
|
|
||||||
|
|
||||||
wuttademo_typer = make_typer(name="wuttademo", help="Wutta Demo -- ")
|
wuttademo_typer = make_typer(
|
||||||
|
name='wuttademo',
|
||||||
|
help="Wutta Demo -- "
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@wuttademo_typer.command()
|
@wuttademo_typer.command()
|
||||||
|
@ -20,10 +23,8 @@ 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(
|
install = app.get_install_handler(pkg_name='wuttademo',
|
||||||
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,23 +10,20 @@ 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(
|
config.setdefault(f'{config.appname}.web.menus.handler_spec',
|
||||||
f"{config.appname}.web.menus.handler_spec",
|
'wuttademo.web.menus:WuttaDemoMenuHandler')
|
||||||
"wuttademo.web.menus:WuttaDemoMenuHandler",
|
|
||||||
)
|
|
||||||
|
|
||||||
# web app libcache
|
# web app libcache
|
||||||
config.setdefault("wuttaweb.static_libcache.module", "wuttademo.web.static")
|
#config.setdefault('tailbone.static_libcache.module', 'wuttademo.web.static')
|
||||||
|
|
|
@ -8,38 +8,21 @@ from wuttaweb import app as base
|
||||||
|
|
||||||
def main(global_config, **settings):
|
def main(global_config, **settings):
|
||||||
"""
|
"""
|
||||||
Make and return the WSGI application, per given settings.
|
This function returns a Pyramid WSGI application.
|
||||||
"""
|
"""
|
||||||
# prefer Wutta Demo templates over wuttaweb
|
# prefer Wutta Demo templates over wuttaweb
|
||||||
settings.setdefault(
|
settings.setdefault('mako.directories', [
|
||||||
"mako.directories",
|
'wuttademo.web:templates',
|
||||||
[
|
'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('wuttademo.web.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()
|
||||||
|
|
||||||
|
|
||||||
def make_wsgi_app():
|
|
||||||
"""
|
|
||||||
Make and return the WSGI app.
|
|
||||||
"""
|
|
||||||
return base.make_wsgi_app(main)
|
|
||||||
|
|
||||||
|
|
||||||
def make_asgi_app():
|
|
||||||
"""
|
|
||||||
Make and return the ASGI app.
|
|
||||||
"""
|
|
||||||
return base.make_asgi_app(main)
|
|
||||||
|
|
|
@ -3,16 +3,11 @@
|
||||||
Static assets
|
Static assets
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from fanstatic import Library, Resource
|
# from fanstatic import Library, Resource
|
||||||
|
|
||||||
|
|
||||||
# fanstatic libcache
|
# # libcache
|
||||||
libcache = Library("wuttademo_libcache", "libcache")
|
# libcache = Library('wuttademo_libcache', 'libcache')
|
||||||
vue_js = Resource(libcache, "vue-2.6.14.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_css = Resource(libcache, "buefy-0.9.25.min.css")
|
|
||||||
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')
|
||||||
|
@ -20,3 +15,8 @@ fontawesome_js = Resource(libcache, "fontawesome-5.3.1-all.min.js")
|
||||||
# bb_fontawesome_svg_core_js = Resource(libcache, 'fontawesome-svg-core-6.5.2.js')
|
# bb_fontawesome_svg_core_js = Resource(libcache, 'fontawesome-svg-core-6.5.2.js')
|
||||||
# bb_free_solid_svg_icons_js = Resource(libcache, 'free-solid-svg-icons-6.5.2.js')
|
# bb_free_solid_svg_icons_js = Resource(libcache, 'free-solid-svg-icons-6.5.2.js')
|
||||||
# bb_vue_fontawesome_js = Resource(libcache, 'vue-fontawesome-3.0.6.index.es.js')
|
# bb_vue_fontawesome_js = Resource(libcache, 'vue-fontawesome-3.0.6.index.es.js')
|
||||||
|
|
||||||
|
|
||||||
|
def includeme(config):
|
||||||
|
config.include('wuttaweb.static')
|
||||||
|
config.add_static_view('wuttademo', 'wuttademo.web:static', cache_max_age=3600)
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -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')
|
||||||
|
|
20
tasks.py
20
tasks.py
|
@ -9,13 +9,25 @@ import shutil
|
||||||
from invoke import task
|
from invoke import task
|
||||||
|
|
||||||
|
|
||||||
|
here = os.path.abspath(os.path.dirname(__file__))
|
||||||
|
exec(open(os.path.join(here, 'wuttademo', '_version.py')).read())
|
||||||
|
|
||||||
|
|
||||||
@task
|
@task
|
||||||
def release(c):
|
def release(c):
|
||||||
"""
|
"""
|
||||||
Release a new version of Wutta Demo
|
Release a new version of Wutta Demo
|
||||||
"""
|
"""
|
||||||
if os.path.exists("dist"):
|
# rebuild local tar.gz file for distribution
|
||||||
shutil.rmtree("dist")
|
if os.path.exists('Wutta_Demo.egg-info'):
|
||||||
|
shutil.rmtree('Wutta_Demo.egg-info')
|
||||||
|
c.run('python -m build --sdist')
|
||||||
|
|
||||||
c.run("python -m build --sdist")
|
# filename of built package
|
||||||
c.run("twine upload dist/*")
|
filename = 'Wutta-Demo-{}.tar.gz'.format(__version__)
|
||||||
|
|
||||||
|
# TODO: uncomment and update these details, to upload to private PyPI
|
||||||
|
#c.run('scp dist/{} rattail@pypi.example.com:/srv/pypi/wuttademo/'.format(filename))
|
||||||
|
|
||||||
|
# TODO: or, uncomment this to upload to *public* PyPI
|
||||||
|
#c.run('twine upload dist/{}'.format(filename))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue