Logo QF-Test

Im Archiv der Mailingliste
wertvolle Antworten finden.

 

Gratis Testen  Download  Kaufen

Thomas Max, QF-Test Training und Support

Tipp für die Recherche in der Mailingliste: Volltextsuche (oben) verwenden.

Thomas Max,
Sr. Software Engineer & Trainer, QFS

2016 bis heute 2015 | 2014 | 2013 | 2012 | 2011 2010 2009 | 2008 | 2007

(ältere Archiveinträge vor 2007 nicht dargestellt, aber in der Suche enthalten)

Mailingliste - Einträge 2007


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [QF-Test] Replace a backslash by two backslashes


  • Subject: Re: [QF-Test] Replace a backslash by two backslashes
  • From: Gregor Schmid <Gregor.Schmid@?.de>
  • Date: 16 Aug 2007 11:25:46 +0200

Hi René,

be sure to use rc.lookup instead of $() - otherwise you'll end up in
quoting hell.

Best regards,
    Greg

René Hegeman <Rene.Hegeman@?.nl> writes:

> Thanks Greg,
>
> The i_path is now correctly converted into \\\\server\\folder\\file.txt
> Unfortunately, when running the next script lines, it resulted in another error message:
>
> Script lines:
> 	o_file_size = os.path.getsize("$(i_path)")
> 	rc.setGlobal("o_file_size", o_file_size)
>
> Error message:
> 	No such file or directory:  \server\folder\file.txt
>
> Do you have another idea?
>
> Best regards,
> René
>
>
> -----Oorspronkelijk bericht-----
> Van: Gregor Schmid [mailto:Gregor.Schmid@?.de]
> Verzonden: woensdag 15 augustus 2007 18:49
> Aan: qftest-list@?.de
> CC: René Hegeman
> Onderwerp: Re: [QF-Test] Replace a backslash by two backslashes
>
>
> Hi René,
>
> that's trivial: You need to escape the backslash for Jython as well, so use
>
> name = name.replace('\\','\\\\')
>
> Best regards,
>     Greg
>
> René Hegeman <Rene.Hegeman@?.nl> writes:
>
> >    Hi all,
> >
> >
> >
> >    I am trying to replace a backslash by two backslashes with this script:
> >
> >
> >
> >    name = rc.lookup("i_path")
> >    name = name.replace('\','\\')
> >    rc.setLocal("i_path", name)
> >
> >
> >
> >    i_path can be [1]\\server\folder\file.txt and need to be transferred
> >    into \\\\server\\folder\\file.txt
> >
> >
> >
> >    However, this scripts gives an error message:
> >
> >    SyntaxError: Lexical error at line 4, column 27. Encountered: "\\"
> >    (92), after : "\\"
> >
> >
> >
> >    Does anyone knows how to replace the backslash by two backslashes?
> >
> >
> >
> >    Greetings,
> >
> >
> >
> >    René Hegeman
> >
> >    Planon

--
Gregor Schmid                                Gregor.Schmid@?.de
Quality First Software GmbH                     http://www.qfs.de
Tulpenstr. 41                                Tel: +49 8171 919870
DE-82538 Geretsried                          Fax: +49 8171 919876
GF: Gregor Schmid, Karlheinz Kellerer          HRB München 140833


Videos Downloads Dokumentation Kaufen Gratis Testen