csbot.plugins.calc module¶
-
csbot.plugins.calc.guarded_power(a, b)[source]¶ A limited power function to make sure that commands do not take too long to process.
-
class
csbot.plugins.calc.CalcEval[source]¶ Bases:
ast.NodeVisitor-
generic_visit(node)[source]¶ Fallback visitor which always raises an exception.
We evaluate expressions by using return values of node visitors, and
generic_visit()returns None, therefore if it’s called we know this is an expression we don’t support and should give an error.
-
-
class
csbot.plugins.calc.Calc(bot)[source]¶ Bases:
csbot.plugin.PluginA plugin that calculates things.