root/README

Revision 154:28020e2320b9, 6.7 KB (checked in by Roger Gammans <rgammans@…>, 4 months ago)

Use setuptools entry_points to generate our startup scripts.

  • should simplify the running of mysterymachine on windows a little
Line 
1Installation
2============
3
4If you are installing from a built source distribution then the command:-
5
6     python setup.py install -d <DirectoryToInstallInto>
7
8should work, if you have python virtualenv and setuptools already installed, and
9windows users should see the note under pyparsing below.
10
11This will create a python virtualenv in the specified installation directory and
12install MysteryMachine, a customised yapsy plus all of the dependencies into to
13it.
14
15You can still install MysteryMachine into you global environment if you don't have
16or want to install virtualenv by running
17
18     python setup.py install_here
19
20instead.
21
22If you are installing from the mercurial repo you need the following libraries
23on your PYTHONPATH. Once the libraries below and MysteryMachine itself are on your
24python path the scripts in the 'scripts' directory should work. Or you can install
25a patched version of yapsy (patch is in the patches directory) and paver then use:-
26
27    paver sdist
28
29to build you own source distribution and install from that.
30
31Windows Install Quick Reference
32-------------------------------
33
34To install on windows I suggest the following commands, if you use python for
35other applications want more control I suggest you read all of this README before
36doing this
37
38    1. Download a recent Python (2.6.x is recommended) from www.python.org and install it.
39    2. Download mercurial from  http://bitbucket.org/tortoisehg/thg-winbuild/downloads/ and install it.
40    3. From the MysteryMachine zip file run
41            python install -d c:\mysterymachine
42
43    4. Find where your TCL scripts are stored , this will normally by c:\pythonXX\tcl\tclY.Y
44       then edit c:\mysterymachine\scripts\activate to add this following line at
45       the beginning:-
46            set TCL_LIBRARY=c:\pythonXX\tcl\tclY,Z
47       
48        where X,Y are version numbers in the file names, eg if you have a folder of yout
49        computer called c:\python26\tcl\tcl8.5 you woud add this line:=
50            set TCL_LIBRARY=c:\python26\tcl\tcl8.5
51
52    5. Run c:\mysterymachine\scripts\activate
53    6. You ready to go - make sure you 
54
55
56Libraries Required
57------------------
58
59You will need to install the following Python packages to use the
60MysteryMachine .
61
62Yapsy > 1.7 : A Patch for versions lower than this can be found patches
63pyparsing > 1.5.0
64
65Yapsy
66'''''
67Yapsy does not currently meet our python3 requirements, and in fact the use of
68exec, rather than execfile creates a small security race hazard. Wether
69our application's useis sensitive enough to worry about this is a moot point
70though.
71
72Having said that since for python3 we need to fix yapsy - changing it to be
73secure as well strikes me as a good idea.
74
75Additionall MysteryMachine ships with a patched ersion of Yapsy which should
76be backwardly compatible with 1.7 - but add a filter mechanism which is currently
77used so we ignore UnTrusted plugins.
78
79Pyparsing
80'''''''''
81
82Actually you may be able to make MysteryMachine work with Pyparsing 1.4, and the
83parser was orginally written for it.
84However the whitespace handling code is different between the two releases and 1.4
85may damage rst documents when used with the settings required for 1.5.
86
87Also Pyparsing 1.4 did not throw and exception if it couldn't parse the whole string
88it would just silently discard the remaining output. SO don't blame me if you
89attempt to use it with and early version and find your mssing half your character sheet.
90
91The automatic setup will try to copy install the current version of pyparsing
92from my development environment into MysteryMachine's library if you haven't
93already got a global copy.
94
95Mercurial
96'''''''''
97MysteryMachine needs to be able to use Mercurial as a library , on a POSIX
98OS (Linux & MacOs) just installing mercurial asa  system applciation should be
99enough , but on windows you will need to ensure it is install as a python library,
100if this  doesn't work, `easy_install mercurial` will download it for you but
101it require python2.X-dev and working C toolchain installed . But that is quite
102common on Unix machines.
103
104I haven't yet worked out the best to get Mercurial installed appropriately on windows,
105due to the common lack of Visual Studio , which is required to build the C extension
106parts. However a binary version which can be used a a library can be downloaded from
107http://bitbucket.org/tortoisehg/thg-winbuild/downloads/
108
109
110Bpython
111'''''''
112This package os no longer considerer required as it doesn't work on windows,
113however it is recommended on those platforms where it does work.
114
115Use easy_install or your OS package manager
116to install it. If it ia not already installed the installer will try to fetch and
117install it automatically.
118
119Docutils
120''''''''
121MysteryMachine was first developed with docutils 0.4 but I'm currently using 0.6 myself
122as it generates less noise of on the python comaptiblity tests. I suspect 0.5 and 0.6 should
123work equally. 0.4 will probably work too but I haven't tested it in a while.
124
125Docutils can either be installed wiht easy_install or the installer will pull in the
126latest version for you.
127
128PyYaml
129''''''
130Yaml is the current prefered format for the MysteryMachine config file , and if you
131intend to start MysteryMachine with it default settings it will need PyYaml.
132PyYaml can be install easily using easy_install. Like so:
133    easy_install pyyaml
134
135But it should pulled in with the installer.
136
137
138Tkinter & Tcl/Tk
139''''''''''''''''
140These are only require for the Idle based Ui, but currently the installer doesn't
141setup the tcl/tk environment correctly (see https://bitbucket.org/ianb/virtualenv/issue/40/tkinter-fails-in-a-virtual-env )
142to fix this you need ensure the TCL_LIBARRY environmenr variable point to the TCL script
143and srtart up files. The easiest way to do this is to add a line to your
144activate.bat which set this varaibell to pint to the tcl directories tghat ship with
145python.
146
147Running MysteryMachine
148======================
149
150Running:-
151
152    mmcli
153
154will start the default MysteryMachine API cli for your platform.
155
156Mystery machine has a two Cli ui's at the moment which dumps you at the
157python shell with the global 'ctx' bound to MysteryMachine Library.
158
159The are basically identical, the primary one is base on bpython and can
160be started like this:
161
162   mysterymachine --ui=Ui.cli.BPython
163
164Bpython support auto completion and help pop-up documentation. The
165down side of Bpython is that it requires a Unix (or unix-like) terminal
166to run in, so is not compatible with windows.
167
168For windows , althought it shoulkd work anywhere that has python there is
169an alternative Ui based on the Idle development environment, this
170Ui can be started like this:-
171
172    mysterymachine --ui=Ui.cli.Idle
173
174Similiarily this supports auto-completion and pop-up documentation but
175where as Bpython will show the complete docstring, Idle tries to
176shorten it.
Note: See TracBrowser for help on using the browser.