[Cheetahtemplate-discuss] Escape character problem
Brought to you by:
rtyler,
tavis_rudd
From: Saranakom C. <sar...@th...> - 2011-01-18 01:22:52
|
Dear All, I use cheetahtemplate to generate file path. Its code look like this: ---Test 1--- Temp_FileName = "${COMM_BUS}\\Pass through\\${eDME}_max.pkg" t_FileName = Template(Temp_FileName,searchList = [dobj]) Output: A_CAN\Pass through${eDME}_max.pkg ----End--- Why not they replace for ${eDME}? I think coz backslash is an escape character so cheetah ignore ${eDME} replacement. Then I solve it by put more blackslash . ---Test2--- Temp_FileName = "${COMM_BUS}\\Pass through\\\${eDME}_max.pkg" t_FileName = Template(Temp_FileName,searchList = [dobj]) Output: A_CAN\Pass through\${eDME}_max.pkg ---End--- But it doesn't work. Just got only backslash output not ${eDME} replacement. ---Test3--- Temp_FileName = "${COMM_BUS}\\Pass through\\_${eDME}_max.pkg" t_FileName = Template(Temp_FileName,searchList = [dobj]) Output: A_CAN\Pass through\_AgeDegHvsto_min.pkg ---End--- For Test3, just to prove that if I put underscore before ${eDME}, it work (replacement) but underscore is not what I want. How I can solve this problem? Best regard, Saranakom Cheecharoen |