胡子+基于yaml的配置模板。

whizkers的Python项目详细描述


whizkers

胡子+基于yaml的配置模板。

Sample usage

安装

pip install whizkers

或者把whizkers.py移到$PATH中的某个位置。

依赖关系

  • Python(2或3)

下面是应该通过pip安装的python库。 或者,如果你做了pip install whizkers, 这些应该是自动安装的。

  • argcomplete
  • 彩色日志
  • 皮斯塔希
  • 皮亚姆
  • 术语颜色
  • 看门狗

自动完成

sudo activate-global-python-argcomplete

如果通过PIP安装,则在自动完成之前,可能需要运行以下命令:

grep 'PYTHON_ARGCOMPLETE_OK' "$(which whizkers)" &>/dev/null || sudo sed -i "1a # PYTHON_ARGCOMPLETE_OK" "$(which whizkers)"

用法

usage: whizkers [-h] [-l] [-t TEMPLATE_DIR] [-d DEST_DIR] [-s VAR_SET_DIR]
                [-i IGNORES_FILE] [-e] [-w] [--watch-command WATCH_COMMAND]
                [--diff] [--dry]
                [variable_files [variable_files ...]]

A pystache + YAML based config templater.

Searches for an optional yaml file with a variable mapping in
~/.config/whizkers/variables.yaml,

an optional yaml file with an ignore scalar of regexes in (by default)
~/.config/whizkers/ignores.yaml,

and uses the mustache templates in (by default)
~/.config/whizkers/templates/

to render into your home directory (by default).

Additional variable files can be applied
by supplying them as arguments, in order of application.

They can either be paths or, if located in (by default)
~/.config/whizkers/variable_sets/,
extension-less filenames.

Environment variable support is available;
simply put the name of the variable in mustache brackets.

Order of precedence is:
last YAML variable defined >
first YAML variable defined >
environment variables.

Variables are shallowly resolved once, then anything in
{`...`} is eval'd in Python.

Autocomplete support available, but only for the default
variable set directory.

A file watcher is available via the -w flag.
Whenever a variable file in use, the ignores file,
or a template file changes, the templates are rendered
if there are any differences.

Diffs between the current destination files and
template renderings are available via the --diff flag.

positional arguments:
  variable_files        additional variable files

optional arguments:
  -h, --help            show this help message and exit
  -l                    list variable sets.
  -t TEMPLATE_DIR       template directory. Default:
                        /home/echan/.config/whizkers/templates
  -d DEST_DIR           destination directory. Default: /home/echan
  -s VAR_SET_DIR        variable set directory. Default:
                        /home/echan/.config/whizkers/variable_sets
  -i IGNORES_FILE       ignores file. Default:
                        /home/echan/.config/whizkers/ignores.yaml
  -e                    whether or not to use environment variables. Default:
                        don't use environment variables
  -w                    start file watcher.
  --watch-command WATCH_COMMAND
                        what to execute when a change occurs. Default: Nothing
  --diff                show diff between template renderings and current
                        destination files
  --dry                 do a dry run

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

推荐PyPI第三方库


热门话题
在java中将字符串转换为音频输入   java如何使用Spring Boot RestTemplate解组json列表   计算机上C++ OpenCV项目转换为OpenCV Android的java步骤   Java Spring Telegraf数据表不工作   openurlconnection与connect之间的java差异?   java Solr字段搜索、通配符和转义字符   java如何使用DLFolderLocalServiceUtil类的getFolders()方法?   尝试用Java编写文件   java连续双缓冲解决方案不起作用   两个数组的Java乘积   java Jackson,如何正确编写自定义反序列化程序   java将布尔标志按一定顺序排列以获得更好的性能是否有意义   java Vaadin无缓冲网格无法关闭   java在MySQL中以同一用户身份同时从不同客户端登录安全吗?   java如何使用安卓asynchttp库   java无法在Android中使用AlarmManager停止服务   java在Hibernate的XML配置文件中指定默认值   Spring启动应用程序中的java内存SQLITE不工作   Java代码无法写入文本文件,