rattail-demo/rattail_demo/commands.py
Lance Edgar 852f9d4902 Add initial Shopfoo pattern feature
data models, import/export, web views etc.
2020-08-19 22:21:00 -05:00

47 lines
1 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'