文本脚本包含管理器根据外壳指令从任何文本文件生成内容

tsincluder的Python项目详细描述


动机

我需要基于git内容生成一个变更日志我想控制 变更日志的结构,但我不想管理git 内容

### from 2016-01 to 2016-05

  We implements feature activation ...

  * 2016-04-13 : Fabien Arcellier : feat: activate ...
  * 2016-04-10 : Fabien Arcellier : feat: add index ...
  * 2016-04-10 : Fabien Arcellier : feat: add search ...
  * ...

我需要自己管理内容的格式和位置,让git 从文件生成一些内容CHANGELOG.md.in

### from 2016-01 to 2016-05

  We implements feature activation ...

  * @tsincluder git log --date=short --pretty=format:'%ad : %aN : %s'  --abbrev-commit --since="1/1/2016" --until="4/31/2016" | grep feat

要生成CHANGELOG.md,请运行

tsincluder CHANGELOG.md.in > CHANGELOG.md

概要

tsincluder表示文本脚本包含管理器。tsincluderclilibrary可以从python脚本调用 用hello world替换标记为@tsincluder echo hello world

它将标记前的内容保留为生成有效格式 如果Tscluder生成许多行,则在所有行上标记并添加它

最新版本

您可以找到最新版本…

git clone https://github.com/FabienArcellier/tsincluder.git

用法

运行tsincluder替换标记@tsinclude(包括文本脚本) 通过stdout上的命令生成的内容

python-mtsincluderfile.in

把它当作图书馆

fromtsincluderimportProcessorline=" * @tsincluder git log --date=short --pretty=format:'%ad : %aN : %s'  --abbrev-commit --since="1/1/2016" --until="4/31/2016" | grep feat"processor=Processor()content=processor.process(line)print(content)

当tsincluder执行子进程命令时,脚本可以配置 工作目录和标记

fromtsincluderimportProcessorprocessor=Processor(working_directory="/tmp",markup="@other_markup")

安装

使用PyPi安装t群集

pip install tsincluder

从源安装t群集

python setup.py install

测试

使用make执行单元测试

make tests

贡献者

  • 法比安·阿塞利尔

许可证

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
添加组件后,java JTable为空   java将json发送到php并插入mysql,但返回null   java Spring引导JNDI CommonJ资源   从不同PC创建和合并后的Java servlet问题   java如何在使用findelements时从xpath获取文本   java使用spring boot使用gmail smtp发送电子邮件   java在不使用pojo、bean或getter和setter的情况下获取Json标题的Json数组   Java中的OpenFile对话框将null作为响应   JavaBuilder模式。扩展接口   java中无需替换的数据结构选取   java如何评价Encog中的预测神经网络   java如何在安卓中使用实际的HttpURLConnection进行单元测试?   java使用XML配置禁用WebSocket中的CSRF保护   java如何通过hibernate从多表查询中获取数据?   mysql如何在java中获取更新的行Id   java AEM/CQ组件单一组件/有限组件   java FFmpeg Javacv延迟问题   显示整数数组的java不起作用