rattail-demo/rattail_demo/commands.py

47 lines
1 KiB
Python
Raw Normal View History

# -*- 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'