Jean Elcard
The Flavournator
My intension is to use this function from PyHelpers.py: getImprovementFoodBonus
My Code (shortened to the essentials):
If I run this, I get this Python Exception:
Line 1010 in PyHelpers is looking like this:
If I change that line to:
I get a similar error like the one before for another line, but if I add PyInfo. to this line too, everything is working like intended.
Is this a bug in PyHelper or am I doing something wrong in my code? I don't want to change anything in PyHelper itself to get this to work. I could easily rewrite the PyHelpers function, but why should I reinvent the wheel.
My Code (shortened to the essentials):
Code:
import PyHelpers
PyInfo = PyHelpers.PyInfo
#some function calling another function of the same module:
iYieldChange = PyInfo.BonusInfo(iBonusType).getImprovementFoodBonus()
#do something with the result
Code:
File "FlavourMod", line 268, in normalizeStartingPlotLocations
File "FlavourMod", line 387, in evaluateStartingPlot
File "PyHelpers", line 1181, in getImprovementFoodBonus
File "PyHelpers", line 1172, in getImprovementModifierInfo
File "PyHelpers", line 1015, in getAPrereqImprovementID
File "PyHelpers", line [B]1010[/B], in getPrereqImprovementID
NameError: global name 'ImprovementInfo' is not defined
Line 1010 in PyHelpers is looking like this:
if self.ID in ImprovementInfo(i).getAffectedBonusIDList():
If I change that line to:
if self.ID in PyInfo.ImprovementInfo(i).getAffectedBonusIDList():
I get a similar error like the one before for another line, but if I add PyInfo. to this line too, everything is working like intended.
Is this a bug in PyHelper or am I doing something wrong in my code? I don't want to change anything in PyHelper itself to get this to work. I could easily rewrite the PyHelpers function, but why should I reinvent the wheel.