Re: "posix" variable modifier doesn't exist?

Bill Deegan <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <CAEyG4CEL5LoHoDaiwZn02d++wKJ-=tmHpO1AQCe8QwGyJc288g@mail.gmail.com>
Try:

env = Environment()
env['path1'] = Dir('src/images')
env['path2'] = env['path1'].posix

?


On Sun, Jul 19, 2020 at 8:59 PM Damjan Jovanovic <[email protected]>
wrote:

> It does not work with File or Entry either.
>
> If I use the undocumented get_subst_proxy() function on the file object
> before using the .posix modifier, then it works:
> env['path1'] = Entry('src/images').get_subst_proxy()
> env['path2'] = env.subst('${path1.posix}')
> print(env['path2'])
>
> I think .posix was only intended for $SOURCE and $TARGET, not for other
> variables.
>
> On Sun, Jul 19, 2020 at 9:07 PM Bill Deegan <[email protected]>
> wrote:
>
>> Does it work if with a File and not a Dir ?
>>
>> On Sat, Jul 18, 2020 at 10:56 PM Damjan Jovanovic <[email protected]>
>> wrote:
>>
>>> Windows 7
>>> Python 3.7.4
>>> Both SCons 3.0.1 and 4.0.1
>>>
>>>
>>> On Sat, Jul 18, 2020 at 10:48 PM Bill Deegan <[email protected]>
>>> wrote:
>>>
>>>> Which version of SCons? which version of Python? Which operating system?
>>>>
>>>> On Sat, Jul 18, 2020 at 4:35 AM Damjan Jovanovic <[email protected]>
>>>> wrote:
>>>>
>>>>> Hi
>>>>>
>>>>> The man page claims how there's a variable substitution modifier
>>>>> called "posix":
>>>>>
>>>>> *posix* - The path with directories separated by forward slashes (*/*).
>>>>> Sometimes necessary on Windows systems when a path references a file on
>>>>> other (POSIX) systems.
>>>>>
>>>>> However it doesn't work:
>>>>>
>>>>> env = Environment()
>>>>> env['path1'] = Dir('src/images')
>>>>> env['path2'] = env.subst('${path1.posix}')
>>>>>
>>>>> scons: *** AttributeError `<class 'SCons.Node.FS.Dir'> object has no
>>>>> attribute 'posix'' trying to evaluate `${path1.posix}'
>>>>>
>>>>> I can use ${str(path1).replace('\\\\', '/')} but is there a better way?
>>>>>
>>>>> Thank you
>>>>> Damjan
>>>>>
>>>>> _______________________________________________
>>>>> Scons-users mailing list
>>>>> [email protected]
>>>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>>>
>>>> _______________________________________________
>>>> Scons-users mailing list
>>>> [email protected]
>>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>>
>>> _______________________________________________
>>> Scons-users mailing list
>>> [email protected]
>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>
>> _______________________________________________
>> Scons-users mailing list
>> [email protected]
>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>
> _______________________________________________
> Scons-users mailing list
> [email protected]
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>

_______________________________________________
Scons-users mailing list
[email protected]
https://pairlist4.pair.net/mailman/listinfo/scons-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.