The file references are what we call a stack trace. The last line shows where the actual problem is and the other lines give context on how we got there to give additional help in tracking down the problem and to show how that error propagates backwards through the code. Generally, you only care about the last line but sometimes it's useful to know what else was happening.
Let's look at your first error:
Code:
[COLOR="Blue"]CvEventInterface, line 23, in onEvent[/COLOR]
[COLOR="Green"]CvEventManager, line 194, in handleEvent[/COLOR]
[COLOR="Red"]CvEventManager, line 435, in onBeginPlayerTurn[/COLOR]
Here is the function onEvent() from the unmodified CvEventInterface file. The reason you can't find it is because your mod doesn't change it and so the game is running the original one in the Assets folder.
Code:
21 def onEvent(argsList):
22 'Called when a game event happens - return 1 if the event was consumed'
[COLOR="Blue"]23 return getEventManager().handleEvent(argsList)[/COLOR]
Line 23 is calling your event manager and telling it to handle some event. So now this code is executed in your CvEventManager file. Even though it doesn't show in the part you posted, this code must be within the function handleEvent():
Code:
192 if self.EventHandlerMap.has_key(tag):
193 fxn = self.EventHandlerMap[tag]
[COLOR="Green"]194 ret = fxn(argsList[1:idx])[/COLOR]
195 return ret
Now line 194 calls another function (in this case onBeginPlayerTurn()) which is elsewhere in that file, so we jump down to it. Once again, this code has to be inside the function onBeginPlayerTurn(). If for some reason you don't think it is, there may be an indentation issue.
Code:
434 while(loopCity):
[COLOR="Red"]435 if (loopCity.isHasBuilding(iShrine)):
[/COLOR]436 # City has the official State Religion Shrine - Prerequisite 3
437 #CyInterface().addMessage(CyGame().getActivePlayer(),True,25,'A Shrine was Found!','AS2D_DISCOVERBONUS',1,'Art/Interface/Buttons/TerrainFeatures/Forest.dds',ColorTypes(8),0,0,False,False)
438 bHasShrine = True
439 break
440 (loopCity, iter) = pPlayer.nextCity(iter, false)
And now we finally get to your problem. Line 435 is checking if a city has a building with ID number "iShrine" but iShrine has not yet been defined. To fix it, figure out what iShrine is supposed to represent and make sure it gets initialized somewhere in that function, probably before the loop.
Note that only reason I worked through the first 2 references was to illustrate how this all works; to identify the problem we really only needed to look at the final line reference. So for the other errors, you want to start with the last line reference to track down the problem and only work backwards if you need to know why the error-causing function was being called.
For your second error, assuming that the line you quoted from CvGameUtils is line 269, then your problem is probably that iInqVersions.get(...) is supposed to return some function reference which is then called but it is instead returning None. Your first step would be to try and determine what that line is *supposed* to do and then see why None is being returned.