librelist archives

« back to archive

Re: Call Sigal from Python

Re: Call Sigal from Python

From:
David Ketcheson
Date:
2015-01-07 @ 07:50
Resending since the machine says my message was dropped.

On Wed, Jan 7, 2015 at 9:07 AM, David Ketcheson 
<david.ketcheson@kaust.edu.sa<mailto:david.ketcheson@kaust.edu.sa>> wrote:
Thanks for developing the very nice tool that is Sigal!

I'd like to call sigal from another Python package.  Of course I can do it
via a system call to the command line interface, but I'd prefer to avoid 
that.  I tried

    import sigal
    sigal.build(args)

with various attempts at what should go in args, but to no avail.  Is it 
possible to call Sigal from Python?

David Ketcheson


________________________________

This message and its contents including attachments are intended solely 
for the original recipient. If you are not the intended recipient or have 
received this message in error, please notify me immediately and delete 
this message from your computer system. Any unauthorized use or 
distribution is prohibited. Please consider the environment before 
printing this email.

Re: [sigal] Re: Call Sigal from Python

From:
Simon
Date:
2015-01-08 @ 22:25
Le 07/01 10:50, David Ketcheson à écrit:
> Resending since the machine says my message was dropped.
>
> On Wed, Jan 7, 2015 at 9:07 AM, David Ketcheson 
<david.ketcheson@kaust.edu.sa<mailto:david.ketcheson@kaust.edu.sa>> wrote:
> Thanks for developing the very nice tool that is Sigal!
>
> I'd like to call sigal from another Python package.  Of course I can do 
it via a system call to the command line interface, but I'd prefer to 
avoid that.  I tried
>
>     import sigal
>     sigal.build(args)
>
> with various attempts at what should go in args, but to no avail.  Is it
possible to call Sigal from Python?
>
> David Ketcheson

Hi,

Sure it is possible. You can take example on the 'sigal build' command
here: https://github.com/saimn/sigal/blob/master/sigal/__init__.py#L90

You need to use 'read_settings' even with no filename, to load the
default settings. Then you can modify the settings if you want to, and
run sigal with:

    gal = Gallery(settings)
    gal.build()

Simon