43 lines
835 B
Python
43 lines
835 B
Python
|
# -*- coding: utf-8; mode: python -*-
|
||
|
"""
|
||
|
Rattail Tutorial commands
|
||
|
"""
|
||
|
|
||
|
from __future__ import unicode_literals, absolute_import
|
||
|
|
||
|
import sys
|
||
|
|
||
|
from rattail import commands
|
||
|
|
||
|
from rattail_tutorial import __version__
|
||
|
|
||
|
|
||
|
def main(*args):
|
||
|
"""
|
||
|
Main entry point for Rattail Tutorial command system
|
||
|
"""
|
||
|
args = list(args or sys.argv[1:])
|
||
|
cmd = Command()
|
||
|
cmd.run(*args)
|
||
|
|
||
|
|
||
|
class Command(commands.Command):
|
||
|
"""
|
||
|
Main command for Rattail Tutorial
|
||
|
"""
|
||
|
name = 'rattail_tutorial'
|
||
|
version = __version__
|
||
|
description = "Rattail Tutorial (custom Rattail system)"
|
||
|
long_description = ''
|
||
|
|
||
|
|
||
|
class HelloWorld(commands.Subcommand):
|
||
|
"""
|
||
|
The requisite 'hello world' example
|
||
|
"""
|
||
|
name = 'hello'
|
||
|
description = __doc__.strip()
|
||
|
|
||
|
def run(self, args):
|
||
|
self.stdout.write("hello world!\n")
|