View Issue Details

IDProjectCategoryView StatusLast Update
0002913ScribusScripterpublic2017-04-04 10:17
Reporterkurfuerst Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status confirmedResolutionopen 
Product Version1.3.1 
Summary0002913: modify/create templates with scripter
DescriptionHi,
It would be really nice if template pages could be added/copied/deleted with scripter, and then modified as well.

Thanks for your great work!

Sebastian
TagsNo tags attached.
Patch

Relationships

related to 0003837 acknowledged Metabug: Master pages/Page templates 
child of 0003813 acknowledged Metabug: Scripter 

Activities

kurfuerst

2005-12-10 23:04

reporter   ~0007693

Btw, and it would be great as well to access the attributes of objects from within scripter.
:-)
Greets, Sebastian

ringerc

2005-12-11 03:34

reporter   ~0007701

Internally, Scribus uses a "master page mode" to control these things. It should be possible to expose that to the scripter pretty much transparently, so that all the existing functions operate on master pages when you enter master page mode.

I think. It might also be a buggy-as-hell nightmare. We shall see, as it's very easy to implement the basic mode switch.

ringerc

2005-12-11 03:38

reporter   ~0007702

I'm not sure what you mean on the second point - "access the attributes of objects from within scripter". Do you mean the object attributes as shown in the GUI (for ToC etc) ? If so, I strongly agree - in fact they came about because I thought they were crucial for scripting.

By the time support for them in the core code got put in place (thanks to Craig Bradney) I found I was a bit busy, to say the least, and I've had little time to work on the scripter. The attributes that ended up being supported are also more complex than the simple key/value pairs I initially thought should be done, and while that's useful it means more work supporting them in the scripter.

It'll get done at some point. It's not hard or even that tine consuming, but it will take some time and be a bit tedious. Hey, feel like doing some very simple C++ coding? Adding scripter functions is EASY.

ringerc

2005-12-11 05:47

reporter   ~0007703

Current 1.3.2cvs as of five minutes ago has basic master page editing support. It's not in the snapshot, only in actual CVS. It'll appear in anoncvs some time in the next 24 hours or so, whenever it next gets synce.

DO NOT USE THIS ON ANYTHING BUT TEST DOCUMENTS YET.

It's not quite right yet; in particular, items on master pages tend to all get moved to the most recently edited master page. It also can't yet delete master pages (the core code for that is ... er ... gross). There may be other issues; Scribus's master page support is internally still very messy and doesn't properly check to ensure that the app is in the right state to perform a given operation.

The new scripter functions are:

createMasterPage
editMasterPage
closeMasterPage
masterPageNames

See their docstrings (accessed with "help(function)" ) for information on their use.

kurfuerst

2005-12-11 07:20

reporter   ~0007705

"I'm not sure what you mean on the second point - "access the attributes of objects from within scripter". Do you mean the object attributes as shown in the GUI (for ToC etc) ? If so, I strongly agree - in fact they came about because I thought they were crucial for scripting."

Yes, I meant that. Your speed is incredible!
Umm it is a long time ago since I last coded in C++, I usually code PHP... But I'
ll have a look!

Greets, Sebastian

kurfuerst

2005-12-11 07:57

reporter   ~0007706

Hi,
I just found out that the interesting part needs to be implemented in scripter/cmdgetsetprop.cpp and the interesting function can be found on
* PageItem::getObjectAttributes or
ObjectAttribute PageItem::getObjectAttribute ( QString )

I am confident you already know this :-) But currently I am missing too much python/C++ knowledge to code this I fear. Sorry..

Greets, Sebastian

jurajF

2017-04-04 10:17

reporter   ~0043696

This can be closed now since masterpages can be edited with scripter and in report 0008118 attributes was addressed also.

Issue History

Date Modified Username Field Change
2005-12-10 22:50 kurfuerst New Issue
2005-12-10 23:04 kurfuerst Note Added: 0007693
2005-12-11 03:34 ringerc Note Added: 0007701
2005-12-11 03:34 ringerc Assigned To => ringerc
2005-12-11 03:34 ringerc Status new => assigned
2005-12-11 03:38 ringerc Note Added: 0007702
2005-12-11 05:47 ringerc Note Added: 0007703
2005-12-11 07:20 kurfuerst Note Added: 0007705
2005-12-11 07:57 kurfuerst Note Added: 0007706
2006-05-13 21:20 christoph_s Relationship added child of 0003813
2006-05-18 18:41 christoph_s Relationship added related to 0003837
2008-03-14 06:54 ringerc Assigned To ringerc =>
2008-03-14 06:54 ringerc Status assigned => confirmed
2017-04-04 10:17 jurajF Note Added: 0043696