[Freeswitch-users] Possible to mock out _freeswitch.py?

Brian Deacon bdeacon at highergear.com
Wed Jan 28 16:07:41 PST 2009


I have.  But 'says here:
http://wiki.freeswitch.org/wiki/Mod_python#Can_I_test_scripts_using_python_shell.3F

That the "import _freeswitch" in freeswitch.py breaks except when the
script is run by mod_python.  (At which point there is some python
voodoo going on here that is beyond me.  Is _freeswitch a
runtime-generated SWIGism?)

So I was thinking I could dump a _freeswitch.py onto the PYTHONPATH when
trying to debug code outside of mod_python.  But probably easier for
trivial things would be to just get the python error output to spit to
the log, but it seems to be getting swallowed.

Or was there something else in python_example.py that I've been too
dense to notice?

Brian


On Wed, 2009-01-28 at 16:39 -0600, Brian West wrote:
> Have you see this
> 
> http://fisheye.freeswitch.org/browse/FreeSWITCH/src/mod/languages/mod_python/python_example.py?r=9052
> 
> /b
> 
> On Jan 28, 2009, at 4:31 PM, Brian Deacon wrote:
> 
> > Greetings,
> >
> > Actually any advice on how to test or diagnose my mod_python code  
> > would
> > be appreciated.  For the most part I've been trying to keep as much of
> > my code as possible separated from the actual interaction with
> > freeswitch so that it's separately testable.  But I will occasionally
> > run into:
> > [ERR] mod_python.c:121 eval_some_python() Error importing module
> >
> > This latest is, I think some missing modules in site_packages, but  
> > it'd
> > be nice to get some output hinting at that.  So nice would be able to
> > have a mocked out _freeswitch so the rest of my unit test stuff could
> > run.  Or failing that, is there a switch I can flip to get some of the
> > python errors output to the log?
> >
> > TIA,
> > Brian
> >
> >
> > _______________________________________________
> > Freeswitch-users mailing list
> > Freeswitch-users at lists.freeswitch.org
> > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> > UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> > http://www.freeswitch.org
> 
> 
> _______________________________________________
> Freeswitch-users mailing list
> Freeswitch-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org





More information about the FreeSWITCH-users mailing list