Subversion Repositories Scribus

Compare Revisions

No changes between revisions

Ignore whitespace Rev 1003 → Rev 1004

/trunk/Scribus/scribus/plugins/scriptplugin/samples/boilerplate.py
0,0 → 1,51
#!/usr/bin/env python2.3
# -*- coding: utf-8 -*-
 
import sys
 
try:
# Please do not use 'from scribus import *' . If you must use a 'from import',
# Do so _after_ the 'import scribus' and only import the names you need, such
# as commonly used constants.
import scribus
except ImportError,err:
print "This Python script is written for the Scribus scripting interface."
print "It can only be run from within Scribus."
sys.exit(1)
 
#########################
# YOUR IMPORTS GO HERE #
#########################
 
def main(argv):
"""This is a documentation string. Write a description of what your code
does here. You should generally put documentation strings ("docstrings")
on all your Python functions."""
#########################
# YOUR CODE GOES HERE #
#########################
pass # <--- Delete this line
 
def main_wrapper(argv):
"""The main_wrapper() function disables redrawing, sets a sensible generic
status bar message, and optionally sets up the progress bar. It then runs
the main() function. Once everything finishes it cleans up after the main()
function, making sure everything is sane before the script terminates."""
try:
scribus.statusMessage("Running script...")
scribus.progressReset()
main(argv)
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()
 
# This code detects if the script is being run as a script, or imported as a module.
# It only runs main() if being run as a script. This permits you to import your script
# and control it manually for debugging.
if __name__ == '__main__':
main_wrapper(sys.argv)
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
Added: svn:keywords
+Author Date Id Revision
\ No newline at end of property
/trunk/Scribus/scribus/plugins/scriptplugin/samples/ReadMe
1,5 → 1,7
This folder contains some Example Scripts:
 
boilerplate.py = The template for your scripts. See Scripter-FAQ in the documentation, please.
 
3columnA4.py = Sample 3 column layout
3columnUSLTR.py = Sample 3 column layout
Calender.py = Creates a Calendar of the current Month in the current Document as a Group
/trunk/Scribus/scribus/plugins/scriptplugin/samples/Makefile.am
1,7 → 1,7
####### kdevelop will overwrite this part!!! (begin)##########
 
 
EXTRA_DIST = Sample1.py Calender.py trait_de_coupe.py pochette_cd.py htmlimport.py 3columnUSLTR.py 3columnA4.py legende.py moins_10_pourcent_group.py plus_10_pourcent_group.py wordcount.py quote.py golden-mean.py ReadMe
EXTRA_DIST = Sample1.py Calender.py trait_de_coupe.py pochette_cd.py htmlimport.py 3columnUSLTR.py 3columnA4.py legende.py moins_10_pourcent_group.py plus_10_pourcent_group.py wordcount.py quote.py golden-mean.py ReadMe boilerplate.py
 
install-data-local:
$(mkinstalldirs) $(prefix)/share/scribus/samples/
31,6 → 31,8
$(INSTALL_DATA) $(srcdir)/plus_10_pourcent_group.py $(prefix)/share/scribus/samples/plus_10_pourcent_group.py
$(mkinstalldirs) $(prefix)/share/scribus/samples/
$(INSTALL_DATA) $(srcdir)/ReadMe $(prefix)/share/scribus/samples/ReadMe
$(mkinstalldirs) $(prefix)/share/scribus/samples/
$(INSTALL_DATA) $(srcdir)/boilerplate.py $(prefix)/share/scribus/samples/boilerplate.py
 
uninstall-local:
-rm -f $(prefix)/share/scribus/samples/quote.py
47,5 → 49,6
-rm -f $(prefix)/share/scribus/samples/legende.py
-rm -f $(prefix)/share/scribus/samples/golden-mean.py
-rm -f $(prefix)/share/scribus/samples/ReadMe
-rm -f $(prefix)/share/scribus/samples/boilerplate.py
 
####### kdevelop will overwrite this part!!! (end)############