comparison demos/pychan_demo/pychan_test.py @ 440:3a6441d9e01c

The demos and editor now look for a local copy of FIFE before trying to import the installed version of FIFE. This is to ease development and not force developers to install FIFE every time they make changes to core and/or the extensions. fixes[t:453]
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Tue, 02 Mar 2010 15:05:30 +0000
parents cfc7c384603b
children 90d369c788c0
comparison
equal deleted inserted replaced
439:cfc7c384603b 440:3a6441d9e01c
24 24
25 # This is the pychan demo client for FIFE. 25 # This is the pychan demo client for FIFE.
26 26
27 import sys, os, re 27 import sys, os, re
28 28
29 fife_path = os.path.join('..','..','engine','python')
30 if os.path.isdir(fife_path) and fife_path not in sys.path:
31 sys.path.insert(0,fife_path)
32
29 from fife import fife 33 from fife import fife
34 print "Using the FIFE python module found here: ", os.path.dirname(fife.__file__)
35
30 from fife.extensions import fifelog 36 from fife.extensions import fifelog
31 from fife.extensions import basicapplication 37 from fife.extensions import basicapplication
32 from fife.extensions import pychan 38 from fife.extensions import pychan
33 from fife.extensions.pychan.dialogs import trace 39 from fife.extensions.pychan.dialogs import trace
34 40
151 """ 157 """
152 Callback handler from the credits link/label. 158 Callback handler from the credits link/label.
153 """ 159 """
154 # We use PyChan's synchronous execution feature here. 160 # We use PyChan's synchronous execution feature here.
155 pychan.loadXML('gui/credits.xml').execute({ 'okButton' : "Yay!" }) 161 pychan.loadXML('gui/credits.xml').execute({ 'okButton' : "Yay!" })
156 162
157 class TestXMLApplication(basicapplication.ApplicationBase): 163 class TestXMLApplication(basicapplication.ApplicationBase):
158 """ 164 """
159 Test Application. Run the pychan_test.py file 165 Test Application. Run the pychan_test.py file
160 with the XML file you want to load as argument. 166 with the XML file you want to load as argument.
161 """ 167 """