absolute paths in imports

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

absolute paths in imports

chrysn
hello openscad list,

the import() module's file parameter doesn't accept absolute path
parameters:

import(file="/tmp/plan.dxf");

WARNING: Can't open DXF file '/tmp/tmp/plan.dxf'.

it seems paths are just concatenated to $PWD instead of being
interpreted like usual.

while looking around for where to fix this, i found that the library
path configuration in parsersettings.cc is rather unflexible; what would
you think about accepting a OPENSCADPATH environment variable in the
same spirit as python's PYTHONPATH or a shell's PATH? this would allow
users to use their own libraries without either having to specify
absolute paths or having to requiring write permissions on /usr/share/.

regards
chrysn (forwarding a bug report sent directly to me)

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: absolute paths in imports

G. Wade Johnson
On Sat, 2 Jun 2012 01:52:20 +0200
chrysn <[hidden email]> wrote:

> hello openscad list,
>
> the import() module's file parameter doesn't accept absolute path
> parameters:
>
> import(file="/tmp/plan.dxf");
>
> WARNING: Can't open DXF file '/tmp/tmp/plan.dxf'.
>
> it seems paths are just concatenated to $PWD instead of being
> interpreted like usual.
>
> while looking around for where to fix this, i found that the library
> path configuration in parsersettings.cc is rather unflexible; what
> would you think about accepting a OPENSCADPATH environment variable
> in the same spirit as python's PYTHONPATH or a shell's PATH? this
> would allow users to use their own libraries without either having to
> specify absolute paths or having to requiring write permissions
> on /usr/share/.
>
> regards
> chrysn (forwarding a bug report sent directly to me)

I would love to see this. In fact, I was planning on looking into it
myself if I could scrounge up some tuits.

G. Wade
--
If the universe puts a mystery in front of us as a gift, politeness
requires that we at least try to solve it.
                                           -- Delenn in "Attonement"

Reply | Threaded
Open this post in threaded view
|

Re: absolute paths in imports

kintel
Administrator
In reply to this post by chrysn
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi chrysn,

Thanks for the report. It's now an issue: https://github.com/openscad/openscad/issues/123

 -Marius

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org

iEYEARECAAYFAk/MaO8ACgkQF4TaqdSZNKTtCgCg5Xu460ISLO++wiIwzpVPVTa5
ProAoNPi4xKIXu113acSIYNomxV9Cf6Q
=CU7s
-----END PGP SIGNATURE-----

Reply | Threaded
Open this post in threaded view
|

Re: absolute paths in imports

kintel
Administrator
In reply to this post by chrysn
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

..and fixed :)

 -Marius

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org

iEYEARECAAYFAk/Mf9UACgkQF4TaqdSZNKQ/GACdE3r02d+NXFYkYXteEr5MMe5m
tLkAn1owe8H9BDWkO13XHUMYYkNAsTAl
=GsM9
-----END PGP SIGNATURE-----