Why isn't the Python code running?

Saketh

Brutal banana
Joined
Aug 17, 2006
Messages
100
I have a fairly simple question.

I've made a test mod, put it in the Mods directory, etc. I can edit the graphics properly in TestMod\Assets\Art, so the mod is in the proper directory and everything.

However, I have changed some Python code and it is not executing. Specifically, I copied CvEventManager.py into TestMod\Assets\Python, and changed a bit of code.
Code:
...
    def showHello(self):
        startPopup = PyPopup.PyPopup()
        popup.setBodyString('Hello, world! This is a test.')
        popup.launch()
...
    def onBeginGameTurn(self, argsList):
        'Called at the beginning of the end of each turn'
        iGameTurn = argsList[0]
        CvTopCivs.CvTopCivs().turnChecker(iGameTurn)
        self.showHello()
...
But no popup is appearing. How can I get this simple test to work?

Thanks in advance.
 
In your showHello function,
whether do that:
Code:
...
    def showHello(self):
        startPopup = PyPopup.PyPopup()
        startPopup.setBodyString('Hello, world! This is a test.')
        startPopup.launch()
...

or
Code:
...
    def showHello(self):
        popup = PyPopup.PyPopup()
        popup.setBodyString('Hello, world! This is a test.')
        popup.launch()
...

But you have to make a choice :D
 
Back
Top Bottom