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 | ||||
| 
 | ||||
| 
 | ||||
| __version__ = version('Wutta-Demo') | ||||
| __version__ = version("Wutta-Demo") | ||||
|  |  | |||
|  | @ -8,23 +8,22 @@ import 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() | ||||
| def install( | ||||
|         ctx: typer.Context, | ||||
|     ctx: typer.Context, | ||||
| ): | ||||
|     """ | ||||
|     Install the Wutta Demo app | ||||
|     """ | ||||
|     config = ctx.parent.wutta_config | ||||
|     app = config.get_app() | ||||
|     install = app.get_install_handler(pkg_name='wuttademo', | ||||
|                                       app_title="Wutta Demo", | ||||
|                                       pypi_name='Wutta-Demo', | ||||
|                                       egg_name='Wutta_Demo') | ||||
|     install = app.get_install_handler( | ||||
|         pkg_name="wuttademo", | ||||
|         app_title="Wutta Demo", | ||||
|         pypi_name="Wutta-Demo", | ||||
|         egg_name="Wutta_Demo", | ||||
|     ) | ||||
|     install.run() | ||||
|  |  | |||
|  | @ -10,20 +10,23 @@ class WuttaDemoConfig(WuttaConfigExtension): | |||
|     """ | ||||
|     Config extension for Wutta Demo | ||||
|     """ | ||||
|     key = 'wuttademo' | ||||
| 
 | ||||
|     key = "wuttademo" | ||||
| 
 | ||||
|     def configure(self, config): | ||||
| 
 | ||||
|         # app info | ||||
|         config.setdefault(f'{config.appname}.app_title', "Wutta Demo") | ||||
|         config.setdefault(f'{config.appname}.app_dist', "Wutta-Demo") | ||||
|         config.setdefault(f"{config.appname}.app_title", "Wutta Demo") | ||||
|         config.setdefault(f"{config.appname}.app_dist", "Wutta-Demo") | ||||
| 
 | ||||
|         # 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 | ||||
|         config.setdefault(f'{config.appname}.web.menus.handler_spec', | ||||
|                           'wuttademo.web.menus:WuttaDemoMenuHandler') | ||||
|         config.setdefault( | ||||
|             f"{config.appname}.web.menus.handler_spec", | ||||
|             "wuttademo.web.menus:WuttaDemoMenuHandler", | ||||
|         ) | ||||
| 
 | ||||
|         # 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. | ||||
|     """ | ||||
|     # prefer Wutta Demo templates over wuttaweb | ||||
|     settings.setdefault('mako.directories', [ | ||||
|         'wuttademo.web:templates', | ||||
|         'wuttaweb:templates', | ||||
|     ]) | ||||
|     settings.setdefault( | ||||
|         "mako.directories", | ||||
|         [ | ||||
|             "wuttademo.web:templates", | ||||
|             "wuttaweb:templates", | ||||
|         ], | ||||
|     ) | ||||
| 
 | ||||
|     # make config objects | ||||
|     wutta_config = base.make_wutta_config(settings) | ||||
|     pyramid_config = base.make_pyramid_config(settings) | ||||
| 
 | ||||
|     # bring in the rest of Wutta Demo | ||||
|     pyramid_config.include('wuttaweb.static') | ||||
|     pyramid_config.include('wuttademo.web.subscribers') | ||||
|     pyramid_config.include('wuttademo.web.views') | ||||
|     pyramid_config.include("wuttaweb.static") | ||||
|     pyramid_config.include("wuttademo.web.subscribers") | ||||
|     pyramid_config.include("wuttademo.web.views") | ||||
| 
 | ||||
|     return pyramid_config.make_wsgi_app() | ||||
| 
 | ||||
|  |  | |||
|  | @ -7,12 +7,12 @@ from fanstatic import Library, Resource | |||
| 
 | ||||
| 
 | ||||
| # fanstatic 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') | ||||
| 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_oruga_js = Resource(libcache, 'oruga-0.8.10.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): | ||||
|     renderer_globals = event | ||||
|     renderer_globals['wuttademo'] = wuttademo | ||||
|     renderer_globals["wuttademo"] = wuttademo | ||||
| 
 | ||||
| 
 | ||||
| def includeme(config): | ||||
|     config.include('wuttaweb.subscribers') | ||||
|     config.add_subscriber(add_wuttademo_to_context, 'pyramid.events.BeforeRender') | ||||
|     config.include("wuttaweb.subscribers") | ||||
|     config.add_subscriber(add_wuttademo_to_context, "pyramid.events.BeforeRender") | ||||
|  |  | |||
|  | @ -7,7 +7,7 @@ Wutta Demo Views | |||
| def includeme(config): | ||||
| 
 | ||||
|     # core views for wuttaweb | ||||
|     config.include('wuttaweb.views.essential') | ||||
|     config.include("wuttaweb.views.essential") | ||||
| 
 | ||||
|     # 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 | ||||
|     """ | ||||
|     if os.path.exists('dist'): | ||||
|         shutil.rmtree('dist') | ||||
|     if os.path.exists("dist"): | ||||
|         shutil.rmtree("dist") | ||||
| 
 | ||||
|     c.run('python -m build --sdist') | ||||
|     c.run('twine upload dist/*') | ||||
|     c.run("python -m build --sdist") | ||||
|     c.run("twine upload dist/*") | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue