あおだぐせんせいがaodag.scaffoldをつくってくれたのでためしてる

PasteScriptは依存モジュール多くて好きじゃないとか、ドットで始まるファイルが使えないとか、virtualenvと相性悪い、もっとシンプルなツールがほしい、などとワガママを言ってたら、 @aodag せんせいがサクっと作ってくれました。
aodag.scaffold 0.2.1 : Python Package Index
ヒャッホウ

何ができるの

  • ひな形(テンプレート)からディレクトリとファイルを作成できる

scaffoldコマンドのインストール

$ pip install aodag.scaffold

zipファイルのテンプレートを作る

とりあえずhelloworldをやるためテンプレートを作る。ファイル名の末尾が _tmpl になっているものは string.Template で処理される。

hello.py_tmpl
print 'hello, $name!'

このファイルをzipでアーカイブする。

$ zip hello.zip hello.py_tmpl

テンプレートをインストールする

hello.zipを tokibito.hello という名前でインストール

$ scaffold install hello.zip tokibito.hello

テンプレートの一覧を見る

$ scaffold list
tokibito.hello

テンプレートから作成する

$ scaffold create tokibito.hello
name: world
/home/tokibito/.scaffolds/tokibito.hello/hello.py_tmpl -> /home/tokibito/hello.py
(scaffold)tokibito@vm:~$ python hello.py
hello, world!

ありがたく使わせていただく。
aodag++