working directory for extensions
Is there any reason why Inkscape remains CD'd to the startup directory when calling extensions, or would it be possible to set the working directory to the one a file is being saved in? Otherwise, I need some other way to figure out were to save additional files besides the extension's main output file.
Lee Braiden wrote:
Is there any reason why Inkscape remains CD'd to the startup directory when calling extensions, or would it be possible to set the working directory to the one a file is being saved in? Otherwise, I need some other way to figure out were to save additional files besides the extension's main output file.
Uhm, we could do that, but we'd have to make a directory in tmp. Really, a program shouldn't assume that it can write anywhere, but usually temporary files in tmp works out. Probably, if you want a scratch directory you should use "mktemp -d" to create a unique directory as a scratch pad. I'm not sure which language you're using, but it seems that most have a function for that.
I think that this would be a lot of overhead for doing with every script, so it would seem like only the scripts that need it should do it themselves?
--Ted
On Friday 29 July 2005 00:22, Ted Gould wrote:
Uhm, we could do that, but we'd have to make a directory in tmp. Really, a program shouldn't assume that it can write anywhere, but usually temporary files in tmp works out.
The thing is, these aren't temporary files; they're additional files that are required, simply to make a complete "save" in some formats.
That is, for saving as HTML with slices, I'm outputting the HTML on stdout for Inkscape to handle the actual save, but I still need to know where it's going, since images which are part of the page need to be saved too.
On Friday 29 July 2005 09:21, Lee Braiden wrote:
On Friday 29 July 2005 00:22, Ted Gould wrote:
Uhm, we could do that, but we'd have to make a directory in tmp. Really, a program shouldn't assume that it can write anywhere, but usually temporary files in tmp works out.
The thing is, these aren't temporary files; they're additional files that are required, simply to make a complete "save" in some formats.
Oh. Are we dealing with GNOMEVFS here, and it's inaccessibility to shell scripts?
Lee Braiden wrote:
The thing is, these aren't temporary files; they're additional files that are required, simply to make a complete "save" in some formats.
That is, for saving as HTML with slices, I'm outputting the HTML on stdout for Inkscape to handle the actual save, but I still need to know where it's going, since images which are part of the page need to be saved too.
Hmm, I didn't realize what your issue is. I don't know that we really have a model for that... are you sure you don't want to write out a .chm file ;)
The currently problem isn't caused by gnome-vfs problems, but I'd like it to be in the future as we start to further integrate gnome-vfs.
I wonder if we're going to have a different scripting interface for multiple files? Anyone have an elegant idea on this?
--Ted
Ted Gould wrote:
Lee Braiden wrote:
The thing is, these aren't temporary files; they're additional files that are required, simply to make a complete "save" in some formats.
That is, for saving as HTML with slices, I'm outputting the HTML on stdout for Inkscape to handle the actual save, but I still need to know where it's going, since images which are part of the page need to be saved too.
Hmm, I didn't realize what your issue is. I don't know that we really have a model for that... are you sure you don't want to write out a .chm file ;)
The currently problem isn't caused by gnome-vfs problems, but I'd like it to be in the future as we start to further integrate gnome-vfs.
I wonder if we're going to have a different scripting interface for multiple files? Anyone have an elegant idea on this?
I have no idea what Ted is talking about. :)
Lee, you just want to know where to save the files, right? I think a file chooser widget/dialog would be the most efficient way to pick a directory and I could use it in a few places too. Alternately you could make a pygtk interface of your own for the extension like was being done for the OCAL interface.
Aaron Spike
aaron@...749... wrote:
I have no idea what Ted is talking about. :)
Lee, you just want to know where to save the files, right? I think a file chooser widget/dialog would be the most efficient way to pick a directory and I could use it in a few places too. Alternately you could make a pygtk interface of your own for the extension like was being done for the OCAL interface.
Well, that wouldn't work as well for an output extension. The life cycle goes something like this:
File dialog Extension preferences Extension execution Save to filename specified in file dialog
So, the script never knows what the filename it is save to really is. The reason for this is that we can go to filesystems which allow for placement of files on network drives that the extension itself doesn't have to support.
So, if the user saves to ftp://myserver.com/myfile the extension itself doesn't have to support this, Inkscape will take care of the network issues (well, gnome-vfs will) for it. Not to say that gnome-vfs is fully tied in today, but it will be (someday, I promise :) )
--Ted
participants (3)
-
unknown@example.com
-
Lee Braiden
-
Ted Gould