使用csv文件填充构建模板

ageliaco.recipe.csvconfig的Python项目详细描述


-代码库:https://github.com/renferers/ageliaco.recipe.csvconfig
-关于serge.renferer的问题和评论,请登录gmail.com


>
=============ageliaco.recipe.csvconfig.csvconfig
================


这个方法的思想是,只有一个信息源,可以用于你的构建变量设置。
当一个人遇到几个非常相似的部署时,然后将变量元素收集到csv文件中(就像几个列的平面表示一样)。

rvisor和一个带有varnish的缓存,加上运行在服务器上的nginx的配置。



instance,port,domain,subdomain,plone,emailadmin
albert cair,15004,albertcair.ch,base.albertcair.ch,/,albert.cair@gmail.com
albertcair,15004,albertcair.ch,albertcair.ch,/alberto,albert.cair@gmail。com
albert cair,15004,albertcair.ch,www.albertcair.ch,/alberto,albert.cair@gmail.com
albertcair,15004,albertcair.ch,histoire.albertcair.ch,/bestie,albert.cair@gmail.com
albertcair,15004,albertcair.ch,images.albertcair.ch,/images,albert.cair@gmail.com
albertcair,15004,albertcair.ch,意大利人,albertcair.ch,/意大利人,alibert.cair@gmail.com
bopip,15005,bopip.ch,base.bopip.ch,/,jm.del@gmail.com
bopip,15005,bopip.ch,bopip.ch,/bopip,jm.del@gmail.com
bopip,15005,bopip.ch,www.bopip.ch,/bopip,jm.del@gmail.com
bopip,15005,bopip.ch,jaun.bopip.ch,/jaun,jm.del@gmail.com
bopip,15005,bopip.ch,java.bopip.ch,/java,jm.del@gmail.com
bopip,15005年,bopip.ch,math.bopip.ch,/math,jm.del@gmail.com
bopip,15005年,bopip.ch,ecole en sauvygnon.ch,/ensauvygnon,jm.del@gmail.com
bopip,15005年,bopip.ch,www.ecole-en-sauvygnon.ch,/ensauvygnon,jm.del@gmail.com


>在你的构建过程中,你将能够在不同层次上传播这些信息,
>这意味着在不同的温度下我们把第一个模板放入instance s.cfg.in::




instances.cfg.in::


[$${subdomain}-subdomain}-parameters]
port=$${port}
host=127.0.0.1
plone=$${plone}


plone=$$${plone}










>varsetting.cfg.in::



>[变量设置]
vh targets=
$${subdomain}:$${subdomain}-参数

$${instance}:$${instance}-参数


backup targets=
backup-$${instance}:$${instance}-参数

cron targets=
cron-${instance}:${instance}-参数

20$${{instance}{instance}{instance}{instance}{instance}[console]true${users:zope}


eventlistener=
$${instance}-httpok tick{60${buildout:bin directory}/httpok[-m$${emailadmin}-p${{instance}-httpok tick{60${buildout:bin directory}/httpok[-m$${emailadmin}-emailadmin}-p$${{instance{instance}instance}http://localhost:11011]

<.

在构建文件中,您将拥有一个具有以下格式的部分:


[buildout]
parts=main



[main]
recipe=ageliaco.recipe.csvconfig:default
csv file=main.csv
templates=templates/varsetting.cfg.in
templates/instances.cfg.in


se.albertcair.ch-参数
albertcair.ch:albertcair.ch-参数
www.albertcair.ch:www.albertcair.ch-参数
histoire.albertcair.ch:histoire.albertcair.ch-parameters
images.albertcair.ch:images.albertcair.ch-parameters
意大利人。阿尔伯特凯尔.ch:意大利人。阿尔伯特凯尔.ch-parameters
base.bopip.ch:base.bopip.ch-parameters
bopip.ch:bopip.ch-parameters
www. bopIP.CH:Boop.Cuun.Cop.Cop.BopIP.CH-Prime:Bop/C.BopIP.CH:Java. BopIP.CH-Prime:BopIP.CH:Ma.BopIP.CH-Posits < Br/> ECOL EN SouvyGnon。CH:EnEL En- SouvyGnon。CH-参数
www. eCule-En- SouvyGnGn.ch:www.ecole-en-sauvygnon.ch参数
实例目标=
阿尔伯特凯尔:阿尔伯特凯尔参数
bopip:bopip参数
备份目标=
备份阿尔伯特凯尔:阿尔伯特凯尔参数
备份bopip:bopip参数
cron目标=
cron albertcair:albertcair参数
cron bopip:bopip参数
supervisor=
20 albertcair${buildout:directory}/bin/albertcair[console]true${users:zope}
20 bopip${buildout:directory}/bin/bopip[console]true${users:zope}
eventlistener=
albert cair httpok tick\u 60${buildout:bin directory}/httpok[-m albert.cair@gmail.com-p albertcair http://localhost:11011]
bopip httpok tick\u 60${buildout:bin directory}/httpok[-m jm.del@gmail.com-p bopip http://localhost:11011]




instances.cfg::

[base.albertcair.ch参数]
port=15004
host=127.0.0.1
plone=/
name=albertcair

[albertcair.ch参数]
port=15004
host=127.0.0.1
plone=/alberto
name=albertcair

[www.albertcair.ch参数]
port=15004
host=127.0.0.1
plone=/alberto
name=albertcair

[histoire.albertcair.ch参数]
port=15004
host=127.0.0.1
plone=/bestie
name=albertcair

[images.albertcair.ch参数]
port=15004
host=127.0.0.1
plone=/images
name=albertcair

[意大利语.albertcair.ch参数]
port=15004
host=127.0.0.1
plone=/意大利语
name=albertcair

[base.bopip.ch参数]
port=15005
host=127.0.0.1
plone=/
name=bopip

[bopip.ch参数]
port=15005
host=127.0.0.1
plone=/bopip
name=bopip

[www.bopip.ch参数]
port=15005
主机=127.0.0.1BROP= BBOP/BoIP.BR/> > [BUPIP.CH参数]
主机= 127.0.0.1Br/> PrON/JAUN < BR/> Name=BOPIP
< BRP> > [BopIP.CH参数]
端口=15005<BR/>主机=127.0.0.1
PrON/BRIP/> Name=BopIP
[BRP/CH参数] < BR/>主机= 127.0.0.1BrO/>数学= BR/> Name=Bopip
< BR>>BR/>端口=15005<Br/>主机=127.0.0.1Br/> PLONE=/EnSAVVYGNON
name=bopip

[www.ecole-en-sauvygnon.ch parameters]
port=15005
host=127.0.0.1
plone=/ensauvygnon
name=bopip

varsetting.cfg.in公开了一种变量替换,当变量存在于选项值中时;选项值根据在csv文件配置中
得到的不同结果的数量重复,例如,我的csv文件中的"instance"列有
两个不同的值,然后基于"eventlistner"选项以两行值展开。


instances.cfg.in将公开另一种变量替换,其中变量存在于节identifier=>;中Section with the"subdomain"variable will epxand in a s
many section s a s there are different values for this variable in the CSV file.
>
csv a s Flat database:
-----------------------------------
let see another example to show you the CSV file can be just brepresa Relational Database.
The CSV file,testmultikey.csv:

name,name,出生,职业
Bob,Wut,1961,Br/>Brob,Brob,Wut,1961,Doc
Marie,Wut,1962,Maitresse
Serge,Ren,1960,Profer
Cocococo,Ren,1961,MaitresseTemps[联系]
$$$${name}-${name}-${name}-$${name}-$$$${name}-$$${name}-$${出生}$$${br/>${br/$$$$$$${br/$$$$${出生}-$$$$$$$$$$$${br/$$$$$$$$$-${name}=${职业}


[$$${职业}]

>>
and now the buildout,Buildout.cfg:

br/>

>
>
>>>>
>>>>>>>>
>>>$${${name从专业翻译人员、公司、网页及可自由查看的翻译库中学习。(b)>csvfile=testmultikey.csv
csvfile=testmultikey.csv
br/>csvfile=testmultikey.csv
br/>br/>br/>br/>br/>br/>br/>br/>br/>bb-wu/>br/>br/>br/>br/>br/>br/>br/>br/>br/>br/>Bob-wu 1962年=主人Serge-Ren-1960=教授



cococo-born=1961
serge-born=1960
coco coco-profession=matrise
br/>serge-professionBob-Profession=Br/>Br/>>Bob-Wut=Doc
Br/>Bob-Wut=Br/>Br/>Coco-Ren
Br/>Br/>Br/>Br/>Br/>Marie-Wut=Mastresse

br/>name=Marie-Wut-1962
cococo-ren-1961
br/>br/>br/>br/>br/>name=Bob-Wut-1961
br/>br/>br/>br/
name=Serge-Ren-1960

br/>br/>detailed support
br/>br/>br/>br/br/>============================
The recipe support the following options:


注释退回权威!
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This is a path(relative or absolute)to CSV file that will be used by the recipe

templates
one(or more)path to a template file=> by default,it is expected a name with
supplex and a file with the same name name without"will be Geneve"。建设目录中的速率如果你想使用另一个足够的或命名的公约,你必须
使用另一种格式:"
将温度路径与目标路径分开,
this alternate format with":"Is also interesting if you want to generate a file in
a different directory超越大楼目录!
for instance:
templates=templates/instances.cfg.in

that will generate a./instances.cfg file(in the buildout directory)or

templates=templates/init-cache.cfg:production/cache.cfg/>br/>will/cache that file/generate production.Notice that in this example it is a relative path,
but it can also be a full path






br/>
br/>br/>br/>
br/>
br/>*******************************************************页:1>—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————---——

-将变量调用从${}更改为$$${},以便轻松替换嵌入构建变量中的变量
-将"+"添加到生成的文件模式("WB+"而不是"WB")
["renfers"]


>0.5(2012-12-28)
——

-更新了文档
["renfe"rs"]



0.4(2012-12-26)
———————————————————————————————————————————————————————————————————————————例如,如果零件名称上有
一个或多个变量,则可以将此集合视为键,如果选项中有
变量,则我们只考虑键值与零件匹配的值。当一个选项的左边部分有一个或多个变量时,同样的情况也会发生
,那么右边部分的变量只能应用于具有相同键值的值
(左边部分的变量)。
["renfers"]






0.3(2012-12-19)
--

-docume代表更新了
["renfers"]

<0.2(2012-12-19)
----


-更改了"update"以在更新时重新安装
["renfers"]


>0.1(2012-12-18)
----

-使用zopeskel创建了配方
["renfers"]




********

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

推荐PyPI第三方库


热门话题
java Android同步不同页面上的按钮   java评测每个类收集的垃圾对象实例数   java(Spring MVC+Hibernate 4+Test 4)自动连线DAO返回NULL   java Android编辑文本和虚拟键盘   java Selenium与BrowserMobProxy   JAVAlang.NoClassDefFoundError:com/sun/jersey/spi/inject/Errors$关闭原因?   java为什么在我成功登录后仍然会出现“不正确的帐户或密码或用户类型”   安卓应用程序在重新启动java时崩溃。网UnknownHostException:无法解析主机   多线程在Java中同步共享静态对象的正确方法是什么?   未调用自定义注释的java类验证(约束类)   java如何将指定目录的存档文件放入所需位置?   java如何识别Selenium中的每个编辑文本字段,如果它们的Xpath都相同   使用gwtmockito/mockito的java简单单选按钮单元测试?