WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Vizcore.cfg - help with syntax (https://forum.worldviz.com/showthread.php?t=2314)

GiudiceLab 10-09-2009 10:12 AM

Vizcore.cfg - help with syntax
 
As I mentioned in the previous post, our lab is getting bigger and we are making a push to organize our code development. One of the things we are working on is a central network folder for resources. We can add this folder to any script using
Code:

viz.res.addPath('//rootname/foldername/Components/resources')
and it works fine, but we want to create a config file that will do this automatically, and just copy it to our development computers. I see in the configuration basics documentation that I can use something like
Code:

viz.resource.path('//rootname/foldername/Components/resources')
but I can't get it to work, and I'm guessing it is a syntax error of some sort. Can someone tell me what the correct syntax is? Also, is it possible to use sys.path.append or some equivalent in the config file as well, so that we can drop Python libraries on the network too, without having to reconfigure each Python? Thanks in advance once again.

farshizzo 10-09-2009 10:25 AM

Have a look at the Configuration settings basics page in the docs, it explains how to add options to your vizcore.cfg file. In this case you would add the following line:
Code:

viz.resource.path = //rootname/foldername/Components/resources

GiudiceLab 10-09-2009 10:44 AM

Yes, that's the page I was looking at, but when I tried to modify the option with the equals sign, I was using quotation marks as well, so that's why that wasn't working. Thanks.

So is it possible to modify the sys.path in the vizcore.cfg file as well? Or will we have to add the path manually on every computer?

farshizzo 10-09-2009 10:52 AM

During initialization, the Python interpreter will attempt to import sitecustomize. This allows you to make customizations to your Python environment. So create a file called sitecustomize.py and place it anywhere on the default module search path (i.e. Vizard/bin folder) and it will be imported before any Vizard script is executed.

GiudiceLab 10-09-2009 10:57 AM

That did the trick. Thank you very much!


All times are GMT -7. The time now is 10:54 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2022, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC