rattail-demo/rattail_demo/commands.py
Lance Edgar 400133a98d Add support for new-style rattail-demo install command
also use upstream menus where possible
2023-01-18 14:59:26 -06:00

62 lines
1.4 KiB
Python

# -*- coding: utf-8; -*-
"""
Rattail Demo Commands
"""
import sys
from rattail import commands
from rattail_demo import __version__
def main(*args):
"""
Main entry point for Rattail Demo command system
"""
args = list(args or sys.argv[1:])
cmd = Command()
cmd.run(*args)
class Command(commands.Command):
"""
Main command for Rattail Demo
"""
name = 'rattail-demo'
version = __version__
description = "Rattail Demo (custom Rattail system)"
long_description = ""
class ExportShopfoo(commands.ExportFileSubcommand):
"""
Export data to the Shopfoo system
"""
name = 'export-shopfoo'
description = __doc__.strip()
handler_spec = 'rattail_demo.shopfoo.importing.rattail:FromRattailToShopfoo'
class ImportSelf(commands.ImportSubcommand):
"""
Update "cascading" Rattail data based on "core" Rattail data
"""
name = 'import-self'
description = __doc__.strip()
handler_spec = 'rattail_demo.importing.local:FromRattailDemoToSelf'
class Install(commands.InstallSubcommand):
"""
Install the Rattail Demo app
"""
name = 'install'
description = __doc__.strip()
# nb. these must be explicitly set b/c config is not available
# when running normally, e.g. `rattail-demo -n install`
app_title = "Rattail Demo"
app_package = 'rattail_demo'
app_eggname = 'rattail_demo'
app_pypiname = 'rattail-demo'