view textshaper/commands.py @ 33:de3148412191

STUB: textshaper/commands.py
author Jeff Hammel <k0scist@gmail.com>
date Sun, 23 Feb 2014 16:48:09 -0800
parents
children 88a69d587326
line wrap: on
line source

#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
CLI commands for textshaper
"""

class Shaper(object):
    """individual text shaper component"""

    def __init__(self, function):
        self.function = function

class Commands(object):

    def __init__(self):
        self.shapers = []
        self.keys = {}

    def add(self, function, key=None):
        self.shapers.append(Shaper(function))
        if key:
            self.keys[key] = self.shapers[-1]