Escape character problem
"Saranakom Cheecharoen" <[email protected]> Tue, 18 Jan 2011 08:22:30 +0700
| Newsgroups | gmane.comp.python.cheetah |
|---|---|
| Message-ID | <[email protected]> |
This is a multipart message in MIME format.
--===============6390707553572718950==
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_000A_01CBB6E8.DB6E7BF0"
Content-Language: en-us
This is a multipart message in MIME format.
------=_NextPart_000_000A_01CBB6E8.DB6E7BF0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
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
------=_NextPart_000_000A_01CBB6E8.DB6E7BF0
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40"><head><META =
HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii"><meta name=3DGenerator content=3D"Microsoft Word 14 =
(filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]--></head><body lang=3DEN-US link=3Dblue =
vlink=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal>Dear =
All,<o:p></o:p></p><p class=3DMsoNormal><o:p> </o:p></p><p =
class=3DMsoNormal>I use cheetahtemplate to generate file path. Its code =
look like this:<o:p></o:p></p><p class=3DMsoNormal>---Test =
1---<o:p></o:p></p><p class=3DMsoNormal><i><span =
style=3D'color:#0070C0'>Temp_FileName =3D “${COMM_BUS}\\Pass =
through\\${eDME}_max.pkg”<o:p></o:p></span></i></p><p =
class=3DMsoNormal><i><span style=3D'color:#0070C0'>t_FileName =3D =
Template(Temp_FileName,searchList =3D =
[dobj])<o:p></o:p></span></i></p><p =
class=3DMsoNormal><o:p> </o:p></p><p =
class=3DMsoNormal>Output:<o:p></o:p></p><p =
class=3DMsoNormal><o:p> </o:p></p><p class=3DMsoNormal><i><span =
style=3D'color:#0070C0'>A_CAN\Pass through${eDME}_max.pkg =
<o:p></o:p></span></i></p><p =
class=3DMsoNormal>----End---<o:p></o:p></p><p =
class=3DMsoNormal><o:p> </o:p></p><p class=3DMsoNormal>Why not they =
replace for ${eDME}? I think coz backslash is an escape character so =
cheetah ignore ${eDME} replacement.<o:p></o:p></p><p =
class=3DMsoNormal>Then I solve it by put more blackslash =
.<o:p></o:p></p><p class=3DMsoNormal><o:p> </o:p></p><p =
class=3DMsoNormal>---Test2---<o:p></o:p></p><p =
class=3DMsoNormal><i><span style=3D'color:#0070C0'>Temp_FileName =3D =
“${COMM_BUS}\\Pass =
through\\\${eDME}_max.pkg”<o:p></o:p></span></i></p><p =
class=3DMsoNormal><i><span style=3D'color:#0070C0'>t_FileName =3D =
Template(Temp_FileName,searchList =3D =
[dobj])<o:p></o:p></span></i></p><p =
class=3DMsoNormal><o:p> </o:p></p><p =
class=3DMsoNormal>Output:<o:p></o:p></p><p =
class=3DMsoNormal><o:p> </o:p></p><p class=3DMsoNormal><i><span =
style=3D'color:#0070C0'>A_CAN\Pass through\${eDME}_max.pkg =
<o:p></o:p></span></i></p><p =
class=3DMsoNormal>---End---<o:p></o:p></p><p =
class=3DMsoNormal><o:p> </o:p></p><p class=3DMsoNormal>But it =
doesn’t work. Just got only backslash output not ${eDME} =
replacement. <o:p></o:p></p><p class=3DMsoNormal><o:p> </o:p></p><p =
class=3DMsoNormal>---Test3---<o:p></o:p></p><p =
class=3DMsoNormal><i><span style=3D'color:#0070C0'>Temp_FileName =3D =
“${COMM_BUS}\\Pass =
through\\_${eDME}_max.pkg”<o:p></o:p></span></i></p><p =
class=3DMsoNormal><i><span style=3D'color:#0070C0'>t_FileName =3D =
Template(Temp_FileName,searchList =3D =
[dobj])</span></i><o:p></o:p></p><p =
class=3DMsoNormal>Output:<o:p></o:p></p><p class=3DMsoNormal><i><span =
style=3D'color:#0070C0'>A_CAN\Pass =
through\_AgeDegHvsto_min.pkg<o:p></o:p></span></i></p><p =
class=3DMsoNormal>---End---<o:p></o:p></p><p =
class=3DMsoNormal><o:p> </o:p></p><p class=3DMsoNormal>For Test3, =
just to prove that if I put underscore before ${eDME}, it work =
(replacement) but underscore is not what I want. <o:p></o:p></p><p =
class=3DMsoNormal><o:p> </o:p></p><p =
class=3DMsoNormal><o:p> </o:p></p><p class=3DMsoNormal>How I can =
solve this problem?<o:p></o:p></p><p =
class=3DMsoNormal><o:p> </o:p></p><p =
class=3DMsoNormal><o:p> </o:p></p><p class=3DMsoNormal>Best =
regard,<o:p></o:p></p><p class=3DMsoNormal>Saranakom =
Cheecharoen<o:p></o:p></p></div></body></html>
------=_NextPart_000_000A_01CBB6E8.DB6E7BF0--
--===============6390707553572718950==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
--===============6390707553572718950==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Cheetahtemplate-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
--===============6390707553572718950==--