patchSkencil - Patches: patch #4582, Direct "poster" support...


You are not allowed to post comments on this tracker with your current authentication level.

patch #4582: Direct "poster" support by Markus Rechtien

Submitted by:  Bernhard Reiter <bernhard>
Submitted on:  Mon 31 Oct 2005 11:35:41 AM UTC  
Votes:  10  
Category:  0.7.x Priority:  4
Status:  None Privacy:  Public
Assigned to:  Bernhard Herzog <bh> Open/Closed:  Open

Thu 10 Nov 2005 08:46:18 AM UTC, comment #4:

attaching improved

* Improved: Error checking for the output filename selection.
* Added: Ask back if an existing file should really be overwritten.
* Added a couple of TODO entries.
* Completed TODO:
20051031 replace deprecated gtk.Combo with gtkComboBox or BH's
Sketch.UI.gtkmisc.CommonComboBox or so.
so there are no deprecation warning in anymore.

Bernhard Reiter <bernhard>
Project Administrator
Wed 09 Nov 2005 12:09:21 AM UTC, comment #3:

The new is improved.
Obviously I cannot fix 5., so this remains untouched.
4. was done easily.

As for 1.,2. and 3.:
I have decided to actually build a string
for a command that would use a pipe for printing.
The reason is that the argv usage of popen* is not really documented
and with the argv usage I cannot create a pipe directly.
Simple, but sufficient shell argument quoting is implemented now.

In addition I have improved the error checking.

Bernhard Reiter <bernhard>
Project Administrator
Sat 05 Nov 2005 07:28:19 PM UTC, comment #2:

I had a look at this. Some relatively simple things that should be fixed:

1. It assembles shell commands as a string without doing proper quoting of e.g. filenames. Best is to avoid assembling a command as a single string completely and to always use a list of argv components. The popen functions in Python accept those too. Best would be to use the subprocess module from Python 2.4 (that would require raising the minimum python version I think)

2. If not explicitly selecting a file to write to, the plugin writes to a file called "" in the current directory. This might overwrite existing files and it may not work sometimes since the current working directory might mot be writable. The plugin should use proper temporary files or pipe the output of poster directly to lpr, or somesuch.

3. the logic of deleting looks wrong:

if outfile and == "":

This could delete a file the user wanted to create explicitly. Keep a separate flag of whether there's a file that needs to be removed.

4. at least one typo: orrured instead of occurred.

5. This shouldn't be a PluginCompound plugin. It doesn't define a new object type. The only reason this isn't a problem yet is that Skencil 0.7 doesn't have a menu for plugin types yet.
For to be loaded automatically, Skencil needs a new plugin type, though.

Bernhard Herzog <bh>
Project AdministratorIn charge of this item.
Mon 31 Oct 2005 11:52:04 AM UTC, comment #1:

Obviously the "ΓΌ" in the TODO comment needs to go
before applying the patch.

Bernhard Reiter <bernhard>
Project Administrator
Mon 31 Oct 2005 11:35:41 AM UTC, original submission:

Skencil Tool dialog for printing large ps poster via the "poster" tool. Originally by Markus Rechtien.
Tested with Skencil CVS from 20051029.

This is usable, but also
see the TODO list at the top of the file.

I suggest placing the file in a freshly created directory
call "Tools" below "Plugins".
So you get Plugins/Tools/

Bernhard R.

Bernhard Reiter <bernhard>
Project Administrator


Attached Files
file #6473: added by bernhard (15KiB - application/x-python - Third revision.)
file #6689: added by bernhard (14KiB - application/x-python - second try)
file #7424: added by bernhard (12KiB - application/x-python - Skencil Tool dialog for printing large ps poster via the "poster" tool. )


Depends on the following items: None found

Items that depend on this one: None found


CC list is empty


Do you think this task is very important?
If so, you can add your encouragement to it.
This task has 10 encouragements so far.

Only logged-in users can vote.


Please enter the title of George Orwell's famous dystopian book (it's a date):



Follow 5 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
Thu 10 Nov 2005 08:46:18 AM UTC bernhard Attached File- => Added, #5454
    Carbon-Copy- => Added bernhard
Wed 09 Nov 2005 12:09:22 AM UTC bernhard Carbon-Copy- => Added bh
Wed 09 Nov 2005 12:09:21 AM UTC bernhard Attached File- => Added, #5448
Mon 31 Oct 2005 11:35:42 AM UTC bernhard Attached File- => Added, #5410

Back to the top

Powered by Savane 3.3