root/livinglogic.python.xist/INSTALL.rst @ 4087:41976089e64e

Revision 4087:41976089e64e, 2.8 KB (checked in by Walter Doerwald <walter@…>, 9 years ago)

Use the new "with" form of py.test.raises() in the test suite.

This requires py 1.3.2.

Line 
1Requirements
2============
3
4To use XIST you need the following software packages:
5
6    *   `Python 2.6`_;
7
8    *   `cssutils`_;
9
10    *   `Python Imaging Library`_ (if you want to use automatic image size
11        calculation);
12
13    *   `libxml2`_ and its Python wrapper (if you want to parse "broken" HTML);
14
15    *   `elinks`_ (if you want want to use the function
16        :func:`ll.xist.ns.html.astext`);
17
18    *   `cx_Oracle`_ (if you want to use :mod:`ll.orasql`);
19
20    *   `setuptools`_ (if you want to install this package as an egg);
21
22    *   `py.test`_ (if you want to run the test suite; at least version 1.3.2)
23
24    *   `execnet`_ (if you want to use ssh URLs)
25
26    *   and a C compiler supported by distutils, if you want to install the
27        source distribution.
28
29    .. _Python 2.6: http://www.python.org/
30    .. _cssutils: http://cthedot.de/cssutils/
31    .. _Python Imaging Library: http://www.pythonware.com/products/pil/
32    .. _libxml2: http://www.xmlsoft.org/
33    .. _elinks: http://elinks.or.cz/
34    .. _cx_Oracle: http://cx-oracle.sourceforge.net/
35    .. _setuptools: http://peak.telecommunity.com/DevCenter/setuptools
36    .. _py.test: http://codespeak.net/py/current/doc/test.html
37    .. _execnet: http://codespeak.net/execnet/
38
39
40Installation
41============
42
43setuptools is used for installation so you can install this package with the
44following command::
45
46    $ easy_install ll-xist
47
48If you want to install from source, you can download one of the
49`distribution archives`__, unpack it, enter the directory and execute the
50following command::
51
52    $ python setup.py install
53
54__ http://www.livinglogic.de/Python/Download.html#xist
55
56This will copy ``*.py`` files, compile ``*.c`` files and install everything in
57the ``site-packages`` directory as the :mod:`ll` and :mod:`ll.xist` packages.
58
59For Windows a binary distribution is provided. To install it,
60double click it, and follow the instructions.
61
62
63Character encoding
64==================
65
66When you pass an 8bit string in the constructor of an XIST element, these
67strings have to be converted to Unicode. XIST assumes that these 8bit strings
68are in the system default encoding, which normally is ASCII.
69
70If your strings contain non-ASCII characters you *must* pass them as unicode
71strings to the XIST constructors and you *must* specify the encoding you're
72using in your source code in the first or second line of your script (see
73:pep:`263` for a detailed description).
74
75
76IPython display hooks
77=====================
78
79If you're using XIST in an `IPython`_ shell, XIST allows you to browse through
80your trees using any of the browsers provided by IPython's `ipipe module`_.
81
82    .. _IPython: http://ipython.scipy.org/
83    .. _ipipe module: http://ipython.scipy.org/moin/UsingIPipe
84
85You can specify which format gets used by changing the value of the
86``defaultpresenter`` variable in the module :mod:`ll.xist.present`::
87
88    from ll.xist import present
89    present.defaultpresenter = present.TreePresenter
90
91Setting this value to ``None`` turns the display hook off.
Note: See TracBrowser for help on using the browser.