Mercurial > hg > TextShaper
comparison 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 |
comparison
equal
deleted
inserted
replaced
32:929a5e97af3e | 33:de3148412191 |
---|---|
1 #!/usr/bin/env python | |
2 # -*- coding: utf-8 -*- | |
3 | |
4 """ | |
5 CLI commands for textshaper | |
6 """ | |
7 | |
8 class Shaper(object): | |
9 """individual text shaper component""" | |
10 | |
11 def __init__(self, function): | |
12 self.function = function | |
13 | |
14 class Commands(object): | |
15 | |
16 def __init__(self): | |
17 self.shapers = [] | |
18 self.keys = {} | |
19 | |
20 def add(self, function, key=None): | |
21 self.shapers.append(Shaper(function)) | |
22 if key: | |
23 self.keys[key] = self.shapers[-1] |