View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0007868||Scribus||Scripter||public||2009-03-14 00:58||2009-04-07 00:57|
|Priority||normal||Severity||feature||Reproducibility||have not tried|
|Target Version||188.8.131.52||Fixed in Version||184.108.40.206svn|
|Summary||0007868: Check and add the csv import script from the Wiki.|
Works like a charm in 220.127.116.11 and 1.3.5svn. After Subik has checked the security, it should be added to both versions.
|Tags||No tags attached.|
Here is a new version of Sebastian's script. It works a bit differently. Instead of having you draw a frame which encompasses the future expanse of the table, all you need to do with this version is to make any kind of frame, and the only information the script uses is the X-Pos, Y-Pos of the upper left corner.
In this one, as well as the original, this frame is deleted.
After the script starts, it will ask for width of left cells (mm), then width of right cells (so the two columns can have different widths), then the height.
You then select your CSV file and the table is created, and the cells/frames are grouped at the end.
I have also edited the Script Info, and added information about creating a CSV file from a Postgresql database.
1. Only 2-column data files can be used
2. In 1.3.5svn, the ability to collectively edit fonts, colors, and lines in a group has disappeared, whereas in 1.3.3.x, these are all possible. I also note that you cannot collectively edit an ungrouped multiple frame selection.
importcsv2table.py (7,222 bytes)
I have also tried to modify the script so that if text ending in an image format extension is detected (.jpg for example), the script would instead create an image frame and load the image -- the data would have to be a filename, of course.
The only problem I have had is with trying to control where the script looks for the file. I could not figure out how to set a base path, and left to its own devices, where Scribus looks isn't completely consistent. You would think it might look relative the CSV file, but it may not (sometimes it looked relative to the location of the .py file).
I can't find any scripter commands to control this, at least yet.
poll: where to store this cool script? "samples" or "scripts" directory?
notes: samples = just examples; scripts = "Scribus official scripts accessible in the menu"
||Scripts, of course!|
Here is an update, something of a work in progress, csv2table_exp.py
What I discovered, is that the original script could actually make tables of more than 2 columns. What I've done here is to have 2 sizes, a leftmost column width, and all other columns the same.
The other thing I'm beginning to experiment with is to be able to set a Style for the text (see line 162, commented out). An issue with 1.3.5svn is that you cannot collectively change text parameters for either groups or even multiple selected objects. I think this is something worthy of change back to pre-1.3.5 behavior, since it is so convenient to edit rows, columns, or even the whole table in 1.3.3.x.
csv2table_exp.py (7,365 bytes)
||I've submitted a bug about the above.|
||subik.. are you ok with these going in now?|
||Scripts look alright to me, though they're not very robust, but I don't see any clear security risks. I'd put them in.|
Already in SVN now.
gpittman: when do you plan to finish the csv2table_exp.py, please? Is it suitable for importcsv2table.py replacement?
one note: please, don't mix spaces and tabelators for indenting in Python scripts, please.
|2009-03-14 00:58||christoph_s||New Issue|
|2009-03-14 00:58||christoph_s||Status||new => assigned|
|2009-03-14 00:58||christoph_s||Assigned To||=> subik|
|2009-03-15 15:11||gpittman||Note Added: 0021319|
|2009-03-15 15:12||gpittman||File Added: importcsv2table.py|
|2009-03-15 15:19||gpittman||Note Added: 0021320|
|2009-03-21 08:34||subik||Note Added: 0021376|
|2009-03-21 09:50||christoph_s||Note Added: 0021377|
|2009-03-22 16:09||gpittman||Note Added: 0021378|
|2009-03-22 16:10||gpittman||File Added: csv2table_exp.py|
|2009-03-22 16:43||gpittman||Note Added: 0021379|
|2009-04-03 20:00||cbradney||Note Added: 0021465|
|2009-04-04 01:24||malex||Note Added: 0021467|
|2009-04-04 07:04||subik||Note Added: 0021468|
|2009-04-04 07:24||subik||Note Edited: 0021468|
|2009-04-07 00:57||christoph_s||Status||assigned => resolved|
|2009-04-07 00:57||christoph_s||Fixed in Version||=> 18.104.22.168svn|
|2009-04-07 00:57||christoph_s||Resolution||open => fixed|
|2009-04-07 00:57||christoph_s||Status||resolved => closed|