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