1Experimental support for the use of Boost::Python has been added to the Python
2interface. All Boost code is exported in a separate module, scribus2, that is
3only created if Boost::Python is available.
4
5Currently there's no autotools support for this in Scribus, so to compile the
6scripter with this highly experimental feature you must:
7
8$ make clean
9$ make CXXFLAGS=" -Wno-extra -Wno-unused -DHAVE_BOOST_PYTHON -fexceptions " LDFLAGS=" -lboost_python "
10$ make install
11
12For more information on Boost::Python see:
13	http://www.boost.org/libs/python/doc/
14	http://www-eleves-isia.cma.fr/documentation/BoostDoc/boost_1_29_0/libs/python/doc/tutorial/
15
16It's strongly recommended that you read the FAQ at:
17	http://www.boost.org/libs/python/doc/v2/faq.html
18(probably once before reading the code, and again after).
19
20All the fun stuff is in the `scribus2' module and is used for manipulating
21paragraph styles. There are currently two (dirty hack) interfaces. One is a
22"value based" interface - ask for a /copy of/ a style, add a style by /copying/
23it into the style list, etc. The other interface is reference based - get a
24dict of references to the existing styles and modify them directly. Soon,
25hopefully, add and remove styles from the dict as if it was a Python one too.
26The value based interface is safer but clumsier; the reference based one
27can be a tad dangerous but is very handy.
28
29Examples:
30
31>>> import scribus2
32>>> p = scribus2.ParagraphStyle()
33>>> p.Vname = "testing"
34>>> scribus2.addStyle(p)
35>>> scribus2.getStyleNames()
36[ blah, blah, blah , "testing" ]
37>>> scribus2.getStylesRef()['testing'].Vname = "newname"
38>>> scribus2.getStyleNames()
39[ blah, blah, blah, "newname"]
40>>> ref = scribus2.getStyleRef("newname")
41>>> ref.Vname = "renamed"
42>>> scribus2.getStyleNames()
43[ blah, blah, blah, "renamed"]
44>>> val = scribus2.getStyleVal("renamed")
45>>> val.Vname = "doesnothing"
46>>> scribus2.getStyleNames()
47[ blah, blah, blah, "renamed"]
48>>> scribus2.addStyle(val)
49>>> scribus2.getStyleNames()
50[ blah, blah, blah, "renamed", "doesnothing"]
51