2025-01-12 22:08:29 -06:00
|
|
|
# -*- coding: utf-8; -*-
|
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# Sideshow-COREPOS -- Case/Special Order Tracker for CORE-POS
|
|
|
|
# Copyright © 2025 Lance Edgar
|
|
|
|
#
|
|
|
|
# This file is part of Sideshow.
|
|
|
|
#
|
|
|
|
# Sideshow is free software: you can redistribute it and/or modify it
|
|
|
|
# under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# Sideshow is distributed in the hope that it will be useful, but
|
|
|
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
# General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with Sideshow. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
"""
|
|
|
|
Sideshow-COREPOS web app
|
|
|
|
"""
|
|
|
|
|
|
|
|
from wuttaweb import app as base
|
|
|
|
|
|
|
|
from wutta_corepos.web.db import CoreOpSession
|
|
|
|
|
|
|
|
|
|
|
|
def main(global_config, **settings):
|
|
|
|
"""
|
|
|
|
Make and return the WSGI app (Paste entry point).
|
|
|
|
"""
|
|
|
|
# prefer Sideshow templates over wuttaweb
|
2025-08-31 13:02:02 -05:00
|
|
|
settings.setdefault(
|
|
|
|
"mako.directories",
|
|
|
|
[
|
|
|
|
"sideshow.web:templates",
|
|
|
|
"wuttaweb:templates",
|
|
|
|
],
|
|
|
|
)
|
2025-01-12 22:08:29 -06:00
|
|
|
|
|
|
|
# make config objects
|
|
|
|
wutta_config = base.make_wutta_config(settings)
|
|
|
|
pyramid_config = base.make_pyramid_config(settings)
|
|
|
|
|
|
|
|
# configure DB sessions
|
2025-08-31 13:02:02 -05:00
|
|
|
if hasattr(wutta_config, "core_office_op_engine"):
|
2025-07-06 14:09:11 -05:00
|
|
|
CoreOpSession.configure(bind=wutta_config.core_office_op_engine)
|
2025-01-12 22:08:29 -06:00
|
|
|
|
|
|
|
# bring in the rest of Sideshow
|
2025-08-31 13:02:02 -05:00
|
|
|
pyramid_config.include("sideshow.web")
|
|
|
|
pyramid_config.include("sideshow_corepos.web")
|
2025-01-12 22:08:29 -06:00
|
|
|
|
|
|
|
return pyramid_config.make_wsgi_app()
|
|
|
|
|
|
|
|
|
2025-07-06 14:09:11 -05:00
|
|
|
def make_wsgi_app(config=None):
|
2025-01-12 22:08:29 -06:00
|
|
|
"""
|
|
|
|
Make and return the WSGI app (generic entry point).
|
|
|
|
"""
|
2025-07-06 14:09:11 -05:00
|
|
|
return base.make_wsgi_app(main, config=config)
|
2025-01-12 22:08:29 -06:00
|
|
|
|
|
|
|
|
2025-07-06 14:09:11 -05:00
|
|
|
def make_asgi_app(config=None):
|
2025-01-12 22:08:29 -06:00
|
|
|
"""
|
2025-01-13 09:19:03 -06:00
|
|
|
Make and return the ASGI app (generic entry point).
|
2025-01-12 22:08:29 -06:00
|
|
|
"""
|
2025-07-06 14:09:11 -05:00
|
|
|
return base.make_asgi_app(main, config=config)
|