[webmin-devel] Using Inline in a Webmin module

Chris Nighswonger <[email protected]> Thu, 7 Mar 2013 12:57:05 -0500
Newsgroups gmane.comp.web.webmin.devel
Message-ID <CAP3yOonZU2KX-MGk8sMJhZVzsnZODLV9qWZn7KUTZSMc9q5YSQ@mail.gmail.com>
--===============4566753778206347992==
Content-Type: multipart/alternative; boundary=e89a8f923cd27af46b04d759704e

--e89a8f923cd27af46b04d759704e
Content-Type: text/plain; charset=UTF-8

Hi all,

I'm attempting to use Inline::Python in a webmin module.

I can execute the script from the command line and things go just fine: I
am able to bind to the Python lib and create objects based on Python
classes, etc.

Once I add code to the script to load up the required webmin prereqs, the
problems start. I end up with an error like this:

"Can't locate object method "new" via package "FooBar" (perhaps you forgot
to load "FooBar"?)"

Where "FooBar" is the Perl name for a Python class "foobar".

For some reason it looks like maybe @INC is not correct the second time
around, but I cannot confirm that.

Could it be that Inline compiles the library in one location, but somehow
there is a change relative to that location once inside of the webmin
environment?

Any thoughts on what's going on?

Kind Regards,
Chris

--e89a8f923cd27af46b04d759704e
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi all,<br><br>I&#39;m attempting to use Inline::Python in a webmin module.=
<br><br>I can=20
execute the script from the command line and things go just fine: I am=20
able to bind to the Python lib and create objects based on Python=20
classes, etc.<br>
<br>Once I add code to the script to load up the required webmin prereqs, t=
he problems start. I end up with an error like this:<br><br>&quot;Can&#39;t=
 locate object method &quot;new&quot; via package &quot;FooBar&quot; (perha=
ps you forgot to load &quot;FooBar&quot;?)&quot;<br>


<br>Where &quot;FooBar&quot; is the Perl name for a Python class &quot;foob=
ar&quot;.<br><br>For some reason it looks like maybe @INC is not correct th=
e second time around, but I cannot confirm that.<br><br>Could
 it be that Inline compiles the library in one location, but somehow=20
there is a change relative to that location once inside of the webmin=20
environment?<br>
<br>Any thoughts on what&#39;s going on?<br><br>Kind Regards,<br>Chris<br>

--e89a8f923cd27af46b04d759704e--


--===============4566753778206347992==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
--===============4566753778206347992==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-
Forwarded by the Webmin development list at [email protected]
To remove yourself from this list, go to
http://lists.sourceforge.net/lists/listinfo/webadmin-devel

--===============4566753778206347992==--