[Scribus] Extensions are great

Craig Ringer craig
Tue Feb 15 08:46:40 CET 2005

On Tue, 2005-02-15 at 08:19 +0100, Jan Ulrich Hasecke wrote:
> Am Montag, 14. Februar 2005 18:44 schrieb scribus at gubba.org:
> > Hi,
> >
> > I think extensions are one of the greatest new features in Scribus.
> > The attached file shows how PyQt can extend the GUI.
> Sounds great, but... ;-)
> ... I do not understand the concept of extensions in reference to scribus. Can 
> you explain, what I can do with the script, where to put it and so on?

I've used the term 'extension script' to describe support in Scribus for
running Python scripts outside their normal (somewhat) restricted
environment. The main difference is that when the script exits, normally
all the objects it creates are deleted - but when you use "load
extension script" this does not happen. There are also some internal
differences related to how the script gets run that mean that PyQt can
be used with 'extension' scripts but not from the normal 'Execute
script...' mode.

Most scripting tasks are better done the same as always, because scripts
run as 'extension' scripts need to be more careful about memory and
about namespace collisions. Normal scripts get a lot of cleanup done for
them, so unless you know you need to use PyQt or create objects that
persist while Scribus is running, stick with the normal scripter

The main goal with the extension script code was to make it possible to
use PyQt to add new palettes and windows to the Scribus GUI. I expect
this to be useful for things like content management system interfaces.
With things like content management systems, there's a lot of variation
site-to-site and system-to-system, and the coding to interface to them
tends to involve lots of networking etc. Python with PyQt should be well
suited to writing the tools to integrate a site's content management
system with Scribus. It looks like it's useful for OpenClipArt too ;-) .

There are other things I'd like to explore later, such as event hooks
(especially if we can get sip going with the scripter), but for now PyQt
is the main purpose of the 'extension script' feature.

With luck and some documentation (sorry!), the extension script feature
will make it a bit easier for users to extend the Scribus user interface
in simple ways to make it better for their specific needs.

I have some documentation for this just about done now and it'll be in
1.2.2cvs in a bit. It's taken a while as I've been trying to sort out
some other things.

Craig Ringer

More information about the scribus mailing list