View Issue Details

IDProjectCategoryView StatusLast Update
0009019ScribusScripterpublic2010-06-24 21:09
Reporterdanielb Assigned Tojghali  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
PlatformPCOSOpenSuseOS Version11.2
Product Version1.3.6 
Fixed in Version1.3.7svn 
Summary0009019: unGroupObject(...) won't work in scripter
DescriptionUnGroupObject(...) does not work. If you pass a name of a group this group won't be ungrouped.
Steps To Reproducefor i in range(1, 5) :
    #continue
    scribus.gotoPage(i)
    # scribus.messageBox('Message:', str(i))
    (iT, iI, iO , iB) = scribus.getPageMargins()
    iItem = scribus.getPageItems()
    
    
    n=0
    while n<len(iItem):
    scribus.messageBox('Message:', 'Pageitems:'+str(iItem))
        jItem=iItem[n]
        jFrame = jItem[0]

    if jItem[1]==6:
        scribus.messageBox('Message:', 'i:'+str(i)+'\njFrame6:'+str(jFrame) + str(jItem))
        scribus.unGroupObject(jFrame)
        continue
    scribus.messageBox('Message:', 'i:'+str(i)+'\njFrame:'+str(jFrame) + str(jItem))
        # the item must be at the same height as the original have the same width
        # and have a distance from the left margin equal to the difference
        # between left and right margin
        if i %2 == 0:
        scribus.moveObject(dX, 0, jFrame)
    else:
        scribus.moveObject(-dX, 0, jFrame)
    n+=1


if jItem[1] is 6 (group), than this group should be removed and number of items in iItem should be decreased by one!
TagsNo tags attached.
Patch

Activities

danielb

2010-04-15 14:47

reporter   ~0023700

Sry, but seems only partly fixed.

My script exits with that error on the second run of the while loop.

Traceback (most recent call last):
  File "<string>", line 8, in <module>
  File "...script.py", line 68, in <module>
    scribus.unGroupObject(jFrame)
NoValidObjectError: Object not found

although the Message:

Pageitems:[('Gruppe18', 6, 61), ('Text67', 4, 62), ('Bild68', 2, 63), ('Text71', 4, 64)]

confirms, that the group is stil there. Should end up in an endless loop as before.

However, the objects are ungrouped after the script ran till the end.

jghali

2010-04-15 15:31

administrator   ~0023701

Sorry but :
1) the indentation of pasted code is broken. I had to modify it to make it work correctly.
2) n must be incremented after ungrouping : iItem length won't change miraculously after ungrouping, after getPageItems() call scribus has no control anymore on iItem, that control is transferred to python

Issue History

Date Modified Username Field Change
2010-04-14 20:22 danielb New Issue
2010-04-14 22:27 jghali Summary UnGroupObject(...) won't work => unGroupObject(...) won't work in scripter
2010-04-14 22:27 jghali Steps to Reproduce Updated
2010-04-14 22:28 jghali Status new => resolved
2010-04-14 22:28 jghali Fixed in Version => 1.3.7svn
2010-04-14 22:28 jghali Resolution open => fixed
2010-04-14 22:28 jghali Assigned To => jghali
2010-04-15 14:47 danielb Note Added: 0023700
2010-04-15 14:47 danielb Status resolved => feedback
2010-04-15 14:47 danielb Resolution fixed => reopened
2010-04-15 15:31 jghali Note Added: 0023701
2010-04-15 15:31 jghali Status feedback => resolved
2010-04-15 15:31 jghali Resolution reopened => fixed
2010-06-24 21:09 cbradney Status resolved => closed