2020-08-19 22:21:00 -05:00
|
|
|
# -*- 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'
|
2023-01-18 14:59:26 -06:00
|
|
|
|
|
|
|
|
|
|
|
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'
|