Re: [Bf-committers] Scons can't define strings with spaces
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 26.1.2011 17:30, Tom Edwards wrote: > In scons, string defines cannot contain spaces. The entire value is > wrapped in quote marks even if it has already been escape-quoted. > > env['RCFLAGS'].append("-DTEST=\"a space\"") > env['RCFLAGS'].append("-DTEST=\"nospace\"") When giving a define like that you should use the Append() function of the environment. And leave out the -D part, so: env = BlenderEnvironment(ENV = os.environ) env.Append(RCFLAGS="Test=\"test it\"") print env['RCFLAGS'] Exit() Gives Test="test it" This should give correct result when it gets used in the call that generates the windres command. /Nathan > > Gives: > > windres "-DTEST="a space"" -DTEST="nospace" > > And the first is, of course, an invalid arg. > ___ > Bf-committers mailing list > Bf-committers@blender.org > http://lists.blender.org/mailman/listinfo/bf-committers - -- Nathan Letwory Letwory Interactive http://www.letworyinteractive.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJNQYfUAAoJEKtfN7KsE0Ttjs8H/1UOaZc4TgLE+q7ZqTOrogsz hZBxKm1PygWBAxD5ROif5bEjLXhJ2ZUPi6RPw+RisL02nM9hV6lTOasdpZZYWnZD J068gP/kx6ycIOT7b7VOYvBTMB0xisNSQQ7HyRQjcmZa5+Xt4+ieby3Xje7WUTl7 oFjbPf8eBXjocqDzT31uZ6KgoZEUo7MZ8ejdSAJVNi9L5oW2UVaEmEFE8MMbToVa cWJpYIgjBaj/Z7mEJnZ9xKC82bkMKy1uOnsVRevsqHKuKrJYGGylTqlxlzn8uXVP KSL3BYpL0vWvOfaFwV4/GyhPYltaXOrkBRgXtlQFPdNvWbLMa6z5mvW8LyKgEFc= =lKf0 -END PGP SIGNATURE- ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers
[Bf-committers] Scons can't define strings with spaces
Hi Tom then, though it looks not nice - but instead of space to use a special ( maybe unicode ) character, then replace this character with space as a last step of appending vars to env['RCFLAGS']? Regards Sergey ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers
Re: [Bf-committers] Scons can't define strings with spaces
I don't quite believe it, but no! On 26/01/2011 9:18, Sergey Kurdakov wrote: > Hi Tom, > > and escape sequence with > > \ooo Character with octal value ooo > \xhh Character with hex value hh > > where space is > Octal 40 or Hex 20 > > does not help too? > > Regards > Sergey > ___ > Bf-committers mailing list > Bf-committers@blender.org > http://lists.blender.org/mailman/listinfo/bf-committers > ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers
[Bf-committers] Scons can't define strings with spaces
Hi Tom, and escape sequence with \oooCharacter with octal value ooo \xhhCharacter with hex value hh where space is Octal 40or Hex 20 does not help too? Regards Sergey ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers
Re: [Bf-committers] Scons can't define strings with spaces
Unfortunately not. It isn't a syntax error, but the extra quotes are still added. On 26/01/2011 8:55, Sergey Kurdakov wrote: > Hi Tom, > > I'm very sorry for mistake, > > but then > > http://docs.python.org/reference/lexical_analysis.html > > there are also > > triple-quoted strings > > maybe they will go? > > Regards > Sergey > ___ > Bf-committers mailing list > Bf-committers@blender.org > http://lists.blender.org/mailman/listinfo/bf-committers > ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers
[Bf-committers] Scons can't define strings with spaces
Hi Tom, I'm very sorry for mistake, but then http://docs.python.org/reference/lexical_analysis.html there are also triple-quoted strings maybe they will go? Regards Sergey ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers
Re: [Bf-committers] Scons can't define strings with spaces
It's me, not Lars. That line gives "SyntaxError: unexpected character after line continuation character" because double quotes means a zero-character string, and so everything following it is interpreted by Python. On 26/01/2011 8:01, Sergey Kurdakov wrote: > Hi Lars, > >>> env['RCFLAGS'].append("-DTEST=\"a space\"") >>> env['RCFLAGS'].append("-DTEST=\"nospace\"") >>> >>> Gives: >>> >>> windres "-DTEST="a space"" -DTEST="nospace" > among scons docs there is a phrase: > > > string surrounded by double quotation marks is interpreted as a single > argument, regardless of white space contained within > > so > env['RCFLAGS'].append(""-DTEST=\"a space\""") > > might be what you are looking for ( not tested though ) > > Regards > Sergey > ___ > Bf-committers mailing list > Bf-committers@blender.org > http://lists.blender.org/mailman/listinfo/bf-committers > ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers
Re: [Bf-committers] Scons can't define strings with spaces
I didn't know that...but alas it doesn't help. On 26/01/2011 7:34, Lars Krueger wrote: >> In scons, string defines cannot contain spaces. The entire value is >> wrapped in quote marks even if it has already been escape-quoted. >> >> env['RCFLAGS'].append("-DTEST=\"a space\"") >> env['RCFLAGS'].append("-DTEST=\"nospace\"") >> >> Gives: >> >> windres "-DTEST="a space"" -DTEST="nospace" >> >> And the first is, of course, an invalid arg. > > Apostrophes are valid string delimiter also: Have you tried > > env['RCFLAGS'].append("-DTEST='a space'") > > ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers
[Bf-committers] Scons can't define strings with spaces
Hi Lars, >> env['RCFLAGS'].append("-DTEST=\"a space\"") >> env['RCFLAGS'].append("-DTEST=\"nospace\"") >> >> Gives: >> >> windres "-DTEST="a space"" -DTEST="nospace" among scons docs there is a phrase: string surrounded by double quotation marks is interpreted as a single argument, regardless of white space contained within so env['RCFLAGS'].append(""-DTEST=\"a space\""") might be what you are looking for ( not tested though ) Regards Sergey ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers
Re: [Bf-committers] Scons can't define strings with spaces
> In scons, string defines cannot contain spaces. The entire value is > wrapped in quote marks even if it has already been escape-quoted. > > env['RCFLAGS'].append("-DTEST=\"a space\"") > env['RCFLAGS'].append("-DTEST=\"nospace\"") > > Gives: > > windres "-DTEST="a space"" -DTEST="nospace" > > And the first is, of course, an invalid arg. Apostrophes are valid string delimiter also: Have you tried env['RCFLAGS'].append("-DTEST='a space'") -- Dr. Lars Krueger Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief! Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers
[Bf-committers] Scons can't define strings with spaces
In scons, string defines cannot contain spaces. The entire value is wrapped in quote marks even if it has already been escape-quoted. env['RCFLAGS'].append("-DTEST=\"a space\"") env['RCFLAGS'].append("-DTEST=\"nospace\"") Gives: windres "-DTEST="a space"" -DTEST="nospace" And the first is, of course, an invalid arg. ___ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers