From 4dc9cb36b7d0f11821dfc9aa18878ea664c71675 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 13 Jan 2025 13:05:53 -0600 Subject: [PATCH] fix: register entry points for sideshow customization --- docs/api/sideshow_corepos.config.rst | 6 ++++ docs/index.rst | 1 + pyproject.toml | 9 ++++++ src/sideshow_corepos/config.py | 47 ++++++++++++++++++++++++++++ 4 files changed, 63 insertions(+) create mode 100644 docs/api/sideshow_corepos.config.rst create mode 100644 src/sideshow_corepos/config.py diff --git a/docs/api/sideshow_corepos.config.rst b/docs/api/sideshow_corepos.config.rst new file mode 100644 index 0000000..c79a222 --- /dev/null +++ b/docs/api/sideshow_corepos.config.rst @@ -0,0 +1,6 @@ + +``sideshow_corepos.config`` +=========================== + +.. automodule:: sideshow_corepos.config + :members: diff --git a/docs/index.rst b/docs/index.rst index 072a982..c802f04 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -16,6 +16,7 @@ This is `Sideshow`_ with integration for `CORE-POS`_. api/sideshow_corepos api/sideshow_corepos.batch api/sideshow_corepos.batch.neworder + api/sideshow_corepos.config api/sideshow_corepos.web api/sideshow_corepos.web.app api/sideshow_corepos.web.menus diff --git a/pyproject.toml b/pyproject.toml index 5058bef..64fbddf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,6 +43,15 @@ tests = ["pytest-cov", "tox"] [project.entry-points."paste.app_factory"] "main" = "sideshow_corepos.web.app:main" +[project.entry-points."wutta.batch.neworder"] +"sideshow_corepos" = "sideshow_corepos.batch.neworder:NewOrderBatchHandler" + +[project.entry-points."wutta.config.extensions"] +"sideshow_corepos" = "sideshow_corepos.config:SideshowCoreposConfig" + +[project.entry-points."wutta.web.menus"] +"sideshow_corepos" = "sideshow_corepos.web.menus:SideshowMenuHandler" + [project.urls] Homepage = "https://wuttaproject.org/" diff --git a/src/sideshow_corepos/config.py b/src/sideshow_corepos/config.py new file mode 100644 index 0000000..5c87ee1 --- /dev/null +++ b/src/sideshow_corepos/config.py @@ -0,0 +1,47 @@ +# -*- 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 . +# +################################################################################ +""" +Sideshow-COREPOS config extension +""" + +from wuttjamaican.conf import WuttaConfigExtension + + +class SideshowCoreposConfig(WuttaConfigExtension): + """ + Config extension for Sideshow-COREPOS. + + This establishes some config defaults specific to Sideshow-COREPOS. + """ + key = 'sideshow_corepos' + + def configure(self, config): + """ """ + + # batch handlers + config.setdefault(f'{config.appname}.batch.neworder.handler.spec', + 'sideshow_corepos.batch.neworder:NewOrderBatchHandler') + + # web app menu + config.setdefault(f'{config.appname}.web.menus.handler.spec', + 'sideshow_corepos.web.menus:SideshowMenuHandler')