Mercurial > code > home > repos > light9
changeset 977:c0b09a24f6ca
subterm expression new function chan('channame'), replaces broken getsub one
Ignore-this: d15f574725c0c6b96c511c22aa3efda0
author | drewp@bigasterisk.com |
---|---|
date | Sat, 15 Jun 2013 21:25:45 +0000 |
parents | cfc748f4ad2e |
children | ce159eea90b5 |
files | light9/Submaster.py light9/curvecalc/subterm.py |
diffstat | 2 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/light9/Submaster.py Sat Jun 15 21:25:22 2013 +0000 +++ b/light9/Submaster.py Sat Jun 15 21:25:45 2013 +0000 @@ -327,6 +327,9 @@ def get_sub_by_uri(self, uri): return self.submasters[uri] + def get_sub_by_name(self, name): + return get_sub_by_name(name, self) + # a global instance of Submasters, created on demand _submasters = None @@ -344,8 +347,9 @@ if not submasters: submasters = get_global_submasters() - if name in submasters.get_all_sub_names(): - return submasters.get_sub_by_name(name) + # get_all_sub_names went missing. needs rework + #if name in submasters.get_all_sub_names(): + # return submasters.get_sub_by_name(name) try: val = int(name)
--- a/light9/curvecalc/subterm.py Sat Jun 15 21:25:22 2013 +0000 +++ b/light9/curvecalc/subterm.py Sat Jun 15 21:25:45 2013 +0000 @@ -140,6 +140,7 @@ glo = exprglo.exprGlobals(glo, t) glo['getsub'] = lambda name: self.submasters.get_sub_by_name(name) + glo['chan'] = lambda name: Submaster.Submaster("chan", {get_dmx_channel(name): 1}) try: self.lasteval = eval(expr, glo)