Cookie Cutter模板管理器
cctm的Python项目详细描述
cctm=Cookie Cutter模板管理器
cookiecutter的项目模板管理器
(仅限Python3号)
快速示例
$ cctm init $ cctm selfupdate $ cctm install audreyr/cookiecutter-pypackage $ cctm use audreyr/cookiecutter-pypackage # alias $ cctm management alias audreyr/cookiecutter-pypackage pypackage $ cctm use pypackage # extra_context configuration $ cctm config --name=full_name --value=podhmo.podhmo $ cctm use pypackage
设置
$ pip install cctm
cctm使用单独的配置文件(cctm.json)。
正在搜索cctm.json
搜索方法在这里。
首先,从当前工作目录中,重复搜索“cctm.json”文件。
例如,如果CWD是~/foo/bar/boo。在路径下搜索。
- ~/foo/bar/boo/cctm.json
- ~/foo/bar/cctm.json
- ~/foo/cctm.json
- ~/cctm.json
其次,如果在第一个进程上找不到cctm.json,则使用~/.cctm/cctm.json(默认路径)
生成配置文件
通过cctm init生成配置文件。
$ cctm init # if generating configuration file as current working directory $ cctm init --project=.
包装信息
通过cctm list列出软件包信息
$ cctm list | grep pypackage kragniz/cookiecutter-pypackage-minimal(12) -- A minimal template for python packages audreyr/cookiecutter-pypackage(555) -- Cookiecutter template for a Python package. pypackage -> audreyr/cookiecutter-pypackage # this is alias
通过cctm show显示细节
$ cctm show audreyr/cookiecutter-pypackage {"updated_at": "2016-01-08T22:53:23Z", "url": "https://github.com/audreyr/cookiecutter-pypackage", "name": "audreyr/cookiecutter-pypackage", "description": "Cookiecutter template for a Python package.", "star": 555, "created_at": "2013-07-14T18:52:05Z"}
您的自定义存储库
如果您将url存储在配置文件的存储库中,cctm会将其识别为包存储。
这里是默认的repostories。
"repositories": [ "https://raw.githubusercontent.com/podhmo/cctm/master/data/cookiecutter.index.json" ]
包格式示例
{ "name": "chrisdev/wagtail-cookiecutter-foundation", "url": "https://github.com/chrisdev/wagtail-cookiecutter-foundation", "description": "Cookiecutter template for Wagtail CMS using Zurb Foundation 5", "created_at": "2015-04-13T13:36:50Z", "updated_at": "2016-01-04T14:53:04Z", "star": 23 }
如果您知道,github url,可以通过cctm management fetch获取信息
$ cctm management fetch chrisdev/wagtail-cookiecutter-foundation {"name": "chrisdev/wagtail-cookiecutter-foundation", "url": "https://github.com/chrisdev/wagtail-cookiecutter-foundation", "description": "Cookiecutter template for Wagtail CMS using Zurb Foundation 5", "created_at": "2015-04-13T13:36:50Z", "updated_at": "2016-01-04T14:53:04Z", "star": 23}# store data at local.json $ cctm management fetch chrisdev/wagtail-cookiecutter-foundation --save --store=./local.json
请不要忘记致电cctm selfupdate。此命令同步本地数据和存储数据。
$ cctm selfupdate
0.2
- 生成错误修复。