On Thu, Mar 14, 2013 at 8:04 AM, Stefan Seifert <n...@detonation.org> wrote:

> On Tuesday 12 March 2013 11:15:40 Chris Nighswonger wrote:
> > So here's my shot at this:
> >
> > use Inline::Python qw( py_new_object );
> >
> > my $pykota_conf = py_new_object("config", "pykota.config",
> "PyKotaConfig",
> > '/etc/pykota/');
> > print "Admin mail for the AP400N: " .
> $pykota_conf->getAdminMail('AP400N')
> > . "\n";
>
> You're missing the import statement. It's still necessary for Python to
> load
> the package.
>

That was most of it. Here is what finally worked:

use Inline::Python qw( py_new_object py_call_method );
use Inline  Python   => 'DATA',
            DIRECTORY   => '/usr/share/webmin/pykota/.Inline/';

Inline->init();

my $pykota_conf = py_new_object("PyKotaConfig", "pykota.config",
"PyKotaConfig", '/etc/pykota/');

print "Admin mail for the AP400N: " . py_call_method($pykota_conf,
"getAdminMail", 'AP400N') . "\n";

I ended up having to use py_call_method rather than Perl's method syntax.
Maybe I just missed something else about that along the way.

Many thanks to Stefan and Rob for the help and bearing with me.

And thanks for a very cool module which will hopefully save me loads of
execution time over making system calls.

Kind Regards,
Chris

Reply via email to