Mantis Issue Tracking for Scribus
· Hosting provided by Anduin.net / Øverby Consulting ·

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007868ScribusScripterpublic09-Mar-14 01:5809-Apr-07 02:57
Reporterchristoph_s 
Assigned Tosubik 
PrioritynormalSeverityfeatureReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version1.3.3.13svn 
Target Version1.3.3.13Fixed in Version1.3.3.13svn 
Summary0007868: Check and add the csv import script from the Wiki.
Descriptionhttp://wiki.scribus.net/index.php/Create_tables_out_of_csv_data [^]

Works like a charm in 1.3.3.13 and 1.3.5svn. After Subik has checked the security, it should be added to both versions.
TagsNo tags attached.
Attached Files? file icon importcsv2table.py [^] (7,222 bytes) 09-Mar-15 16:12
? file icon csv2table_exp.py [^] (7,365 bytes) 09-Mar-22 17:10

- Relationships

-  Notes
(0021319)
gpittman (reporter)
09-Mar-15 16:11

importcsv2table.py
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.
Limitations:
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.
(0021320)
gpittman (reporter)
09-Mar-15 16:19

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.
(0021376)
subik (manager)
09-Mar-21 09:34

poll: where to store this cool script? "samples" or "scripts" directory?

notes: samples = just examples; scripts = "Scribus official scripts accessible in the menu"
(0021377)
christoph_s (administrator)
09-Mar-21 10:50

Scripts, of course!
(0021378)
gpittman (reporter)
09-Mar-22 17:09

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.
(0021379)
gpittman (reporter)
09-Mar-22 17:43

I've submitted a bug about the above.
(0021465)
cbradney (administrator)
09-Apr-03 22:00

subik.. are you ok with these going in now?
(0021467)
malex (administrator)
09-Apr-04 03:24

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.
(0021468)
subik (manager)
09-Apr-04 09:04
edited on: 09-Apr-04 09:24

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.


- Issue History
Date Modified Username Field Change
09-Mar-14 01:58 christoph_s New Issue
09-Mar-14 01:58 christoph_s Status new => assigned
09-Mar-14 01:58 christoph_s Assigned To => subik
09-Mar-15 16:11 gpittman Note Added: 0021319
09-Mar-15 16:12 gpittman File Added: importcsv2table.py
09-Mar-15 16:19 gpittman Note Added: 0021320
09-Mar-16 13:54 gpittman Issue Monitored: gpittman
09-Mar-21 09:34 subik Note Added: 0021376
09-Mar-21 10:50 christoph_s Note Added: 0021377
09-Mar-22 17:09 gpittman Note Added: 0021378
09-Mar-22 17:10 gpittman File Added: csv2table_exp.py
09-Mar-22 17:43 gpittman Note Added: 0021379
09-Apr-03 22:00 cbradney Note Added: 0021465
09-Apr-04 03:24 malex Note Added: 0021467
09-Apr-04 09:04 subik Note Added: 0021468
09-Apr-04 09:24 subik Note Edited: 0021468
09-Apr-07 02:57 christoph_s Status assigned => resolved
09-Apr-07 02:57 christoph_s Fixed in Version => 1.3.3.13svn
09-Apr-07 02:57 christoph_s Resolution open => fixed
09-Apr-07 02:57 christoph_s Status resolved => closed



Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker