#!/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)