Little env. Hack

Tech talk for MV3D developers or those looking to lend a hand.

Moderator: SirGolan

Little env. Hack

Postby jhamel » Mon Jul 18, 2011 9:12 am

Hi there,
I did the first steps to test if we can use mv3d for our project and it looks pretty good. We run mostly linux machines and we have at our project an global preferences directory, at ~/DIRNAME/etc/ . So we insert also for the overseer server the config files to ~/..../etc/grid/overseer and ~/..../etc/grid/overseer/config. So we can start it with a shellscript that change to this env. dir and starts from there the overseer program. We do setup a shell script like this:
Code: Select all
#!/bin/sh
cd ~/vrap/etc/grid/overseer
python ~/vrap/MV/mv3d/tools/overseer/overseer.py

To run that correctly we do a little quick and dirty hack at the top of the python file, perhaps it is usefull for you:
Code: Select all
try:
    liPath = os.path.dirname( os.path.realpath( __file__ ) ).split('/')
    newPath = os.path.join('/')
    for i in range(1,len(liPath)-3):
        newPath = os.path.join(newPath,liPath[i])
    sys.path.insert(0,  newPath )
except:
    pass


Now it read the configs from our special config dirs and find the needet python modules, we set that also to the other programs, importer and so.
For us it is nice to have all config files at one location, so we can work on them from our Admin-Tool.

bye
Juergen
jhamel
 
Posts: 17
Joined: Fri Jul 15, 2011 11:07 am

Re: Little env. Hack

Postby SirGolan » Tue Jul 19, 2011 1:10 am

That seems like a pretty neat trick!

For config files, you can also override the defaults in ~/.mv3d/

In particular, the overseer files would go in ~/.mv3d/overseer/services.conf

Mike
SirGolan
Site Admin
 
Posts: 214
Joined: Wed Mar 19, 2008 7:04 pm


Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron