#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import sys, scribus, traceback def main(argv): print "\nYES! main is reached in cmdtest script\ncheck out the arguments it's got:", " ".join(argv) if scribus.haveDoc(): print "\nthis script could modify the current document ", scribus.getDocName(), " automatically" else: print "\nno document is currently open in scribus" def main_wrapper(argv): try: if scribus.haveDoc(): scribus.setRedraw(False) #scribus.statusMessage("ĥeadless test") #scribus.progressReset() main(argv) except Exception: print "error: "+traceback.format_exc() finally: # Exit neatly even if the script terminated with an exception, # so we leave the progress bar and status bar blank and make sure # drawing is enabled. if scribus.haveDoc(): scribus.setRedraw(True) scribus.statusMessage('') scribus.progressReset() if __name__ == '__main__': main_wrapper(sys.argv)