[scribus] Scripter issue using createMasterPage('Test')

Stefano Danzi s.danzi at hawai.it
Fri Apr 5 17:39:15 UTC 2013


..... Scribus 1.4.2

Il 05/04/2013 19.36, Stefano Danzi ha scritto:
> I'm writing a script that create a new masterpage, place some elements 
> on this new masterpage and close it.
>
> When I run this script object are placed on current page and not in 
> new created masterpage.
>
> If I place element on an existing masterpage the script work.
>
> I tryed to create masterpage, close masterpage and reopen masterpage 
> but this not solve.
>
> Someone know any workaround?
>
> See this code, found on scribus forum and modifed:
>
> 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 just created not edited.
>     """
>     try:
>         scribus.createMasterPage('Test')
>         #scribus.closeMasterPage()
>         #scribus.editMasterPage('Test')
>         w, h = scribus.getPageSize()
>         scribus.createText(0.0,0.0,w,h,'test_frame')
>         scribus.setText('Hello from the Master Page!','test_frame')
>     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)
>
>
>
> ___
> Scribus Mailing List: scribus a lists.scribus.net
> Edit your options or unsubscribe:
> http://lists.scribus.net/mailman/listinfo/scribus
> See also:
> http://wiki.scribus.net
> http://forums.scribus.net
>

-- 

Stefano Danzi
Responsabile sistemi informativi

HAWAI ITALIA S.r.l.
Via Forte Garofolo, 16
37057 S. Giovanni Lupatoto Verona Italia

P. IVA 01680700232

tel. +39/045/8266400
fax +39/045/8266401
Web www.hawai.it




More information about the scribus mailing list