# HG changeset patch # User David McClosky # Date 1119031177 0 # Node ID 9bf9685f5aae56e59206a86fffd867aa720e5020 # Parent 5a2c85174a19553ec31f60d25754e852f807d87d curvecalc exprs can return a whole Submaster now subterms will be ignored -- we only use the Submaster in this case diff -r 5a2c85174a19 -r 9bf9685f5aae bin/curvecalc --- a/bin/curvecalc Fri Jun 17 17:52:38 2005 +0000 +++ b/bin/curvecalc Fri Jun 17 17:59:37 2005 +0000 @@ -124,10 +124,16 @@ class Subterm: """one Submaster and its Subexpr""" - def __init__(self,submaster,subexpr): - make_attributes_from_args('submaster','subexpr') - def scaled(self,t): - return self.submaster * self.subexpr.eval(t) + def __init__(self, submaster, subexpr): + make_attributes_from_args('submaster', 'subexpr') + def scaled(self, t): + subexpr_eval = self.subexpr.eval(t) + if isinstance(subexpr_eval, Submaster.Submaster): + # if the expression returns a submaster, just return it + return subexpr_eval + else: + # otherwise, return our submaster multiplied by the value returned + return self.submaster * subexpr_eval class Subtermview(tk.Frame): def __init__(self,master,st,**kw):