View Issue Details

IDProjectCategoryView StatusLast Update
0010769ScribusScripterpublic2012-06-20 13:36
ReporterAstroman Pete Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
PlatformWindowsOSWindows 7 ProfessionalOS VersionService Pack 1
Product Version1.4.1 
Summary0010769: Master page not refreshed after being edited in script
DescriptionI'm working on a set of scripts to layout construction drawings for architecture & engineering in Scribus. Right now, I am working on title block functionality. Information is either set page-by-page, or applies to the whole set. Information that applies to the whole set is put on the Master page.

I've gotten everything to work, except text frames that I create on the Master don't show up until the document is closed and reopened, or the Master page is edited by the user. The normal Scripter redraw toggling seems to not help.

Also, I've noticed that Scribus crashes sometimes when leaving the master page under these conditions. I'm unfamiliar with producing crash reports, I will gladly oblige if someone points me to a how-to on this.

I'm developing at work in Windows, I'm running Kubuntu 12.04 at home (w/ Scribus 1.4.0) and I got the same result there.
Steps To Reproduce1. Save the attached "master_test.py" to a convenient place.
1. Open a new document in Scribus with the default single page template.
2. From the pull-down menus: "Script > Execute Script..."
3. In the "Run Script" dialog: Browse to "master_test.py" and press "OK"
4. Script will create two text frames, one on the current page that says "Hello from the Normal Page!", and one on the master page that says "Hello from the Master Page!". The latter text frame doesn't appear after running the script, until the document is saved and re-opened, or the master page is opened for editing.
* Sometimes when leaving the master page editing under these conditions, Scribus crashes.
TagsNo tags attached.
Patch

Activities

Astroman Pete

2012-06-20 13:36

reporter  

master_test.py (1,113 bytes)   
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys

try:
    import scribus
except ImportError,err:
    print "This script must be run within Scribus."
    sys.exit(1)


def main(argv):
    """
    Test function: Master pages not redrawn after the following changes. 
    """
    w, h = scribus.getPageSize()
    scribus.createText(0.0,h/2.0,w,h/2.0,'test_frame')
    scribus.setText('Hello from the Normal Page!','test_frame')
    try:
        scribus.editMasterPage(scribus.masterPageNames()[0])
        scribus.createText(0.0,0.0,w,h,'test_frame2')
        scribus.setText('Hello from the Master Page!','test_frame2')
    finally:
        scribus.closeMasterPage()


def main_wrapper(argv):
    """ Boiler plate from /share/samples/boilerplate.py """
    try:
        scribus.statusMessage("Running script...")
        scribus.progressReset()
        main(argv)
    finally:
        if scribus.haveDoc():
            scribus.setRedraw(True)
        scribus.statusMessage("")
        scribus.progressReset()

if __name__ == '__main__':
    main_wrapper(sys.argv)
master_test.py (1,113 bytes)   

Issue History

Date Modified Username Field Change
2012-06-20 13:36 Astroman Pete New Issue
2012-06-20 13:36 Astroman Pete File Added: master_test.py