[Scribus] Scripter Image manipulation -- an ugly kludge
Mon Jan 10 03:16:20 CET 2005
On Sat, 2005-01-08 at 23:02 -0500, Gregory Pittman wrote:
> Addendum: yes, if I load two images, doing the save/close/open once at
> the end suffices. Of some added interest is that this script works
> repeatedly, which means that Scripter will overwrite a previous file of
> the same name, without asking and without error -- so in other words one
> would need to code the safeguards into the script.
Yep; that's in line with the behaviour of the Python file object and the
file I/O in most languages. Scribus could require you to pass an extra
boolean to enable overwriting, or prompt the user, but both solutions
are kind of ugly (especially the one that may result in an unexpected
dialog). It's easy enough to just use os.path.exists() and prompt the
user with an input dialog.
I agree that it's an important thing to point out to folks who aren't
used to computers just doing what they say without arguing, though.
More information about the scribus