[SOLVED] egg2bam: Running via os.popen in Windows

Return to Pipeline

[SOLVED] egg2bam: Running via os.popen in Windows

Postby mtomczak » Wed Dec 27, 2006 7:07 pm

Greetings all!

Tripped over a little problem that may be shell-related; I was hoping someone might have some insight, as I'm pretty naive about the Windows shell.

We have a make script that recursively runs egg2bam across all directories under a specific file path. We run the command by assembling a shell string ('egg2bam -o myfile.bam myfile.egg') and then using Python's 'os.popen' function to run the command.

When we do the above, it appears that ObjectType specifications we've defined in our Config.prc file aren't used---as if the file is never read. I'm not able to capture egg2bam's error pipe in this environment, so I can't be sure whether the file is getting loaded. In any case, the output bam lacks the substitutions that our egg-object-type-* config entries should have created; the ObjectType tags appear to simply vanish from the bam output. Running the exact same command line outside of the python script (i.e. outside the os.popen method) has the desired result; our ObjectType tags are substituted with the proper content as per the egg-object-type specifiers in our Config.prc file.

Has anyone experienced a similar problem, or could recreate the problem I described? How does egg2bam locate the Config.prc files? Is there perhaps another way to get python to execute a shell command that I could try?

Thank you for the help!
-Mark
Last edited by mtomczak on Thu Dec 28, 2006 12:08 pm, edited 1 time in total.
User avatar
mtomczak
 
Posts: 69
Joined: Mon Dec 11, 2006 11:09 am
Location: Pittsburgh, PA

Postby rdb » Thu Dec 28, 2006 3:06 am

you can check if egg2bam gives an error by using:
Code: Select all
a = os.popen("egg2bam blah").read()
print a
rdb
 
Posts: 9584
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby mtomczak » Thu Dec 28, 2006 11:15 am

Unfortunately, that doesn't appear to generate any error output. Perhaps the error output is coming through on another pipe (the Windows equivalent to stderr), and popen only grabs the standard out pipe?

I was able to make a bit of forward progress by switching from the popen command to the os.system command. I now see the following errors coming from the program:

Code: Select all
:egg2pg(error): Unknown ObjectType customobjtype


The customobjtype tag is where I expect it to be, and I have the following line in my Config.prc file (panda3d1.2.3/etc/Config.prc):

Code: Select all
egg-object-type-customobjtype        <Tag> type { custom }


As I mentioned before, if I manually run egg2bam, everything works with no errors; it is only when I run via the os.popen or os.system commands that I get the errors I am currently seeing.

My hunch is that in this run context, egg2bam fails to find the Config.prc file in the panda install. What method does it use to locate that file?

-Mark
User avatar
mtomczak
 
Posts: 69
Joined: Mon Dec 11, 2006 11:09 am
Location: Pittsburgh, PA

Postby mtomczak » Thu Dec 28, 2006 12:08 pm

We identified the problem. :)

It wasn't an issue with the use of Python to drive the Panda tools. Another part of our build process was setting the PANDA_PRC_DIR environment variable to an incorrect directory.

Thank you for your help!

-Mark
User avatar
mtomczak
 
Posts: 69
Joined: Mon Dec 11, 2006 11:09 am
Location: Pittsburgh, PA


Return to Pipeline

Who is online

Users browsing this forum: No registered users and 0 guests