cleanup and sort functions
This commit is contained in:
parent
2a42b496ef
commit
5014f71915
|
@ -57,9 +57,6 @@ class OscCommentMacroListener(CommentMacroListener):
|
|||
def __init__(self, servers):
|
||||
self.osc = HogDevice(servers)
|
||||
|
||||
def exitDevice(self, ctx: CommentMacroParser.DeviceContext):
|
||||
ctx.parentCtx.device = ctx
|
||||
|
||||
def enterMacro(self, ctx: CommentMacroParser.MacroContext):
|
||||
ctx.device = None
|
||||
ctx.number = None
|
||||
|
@ -89,6 +86,12 @@ class OscCommentMacroListener(CommentMacroListener):
|
|||
def exitMaster(self, ctx: CommentMacroParser.MasterContext):
|
||||
ctx.parentCtx.master = ctx
|
||||
|
||||
def enterTarget(self, ctx: CommentMacroParser.TargetContext):
|
||||
ctx.targets = []
|
||||
|
||||
def exitTarget(self, ctx: CommentMacroParser.TargetContext):
|
||||
ctx.parentCtx.targets.extend(ctx.targets) # add to parent targets
|
||||
|
||||
def exitNumber(self, ctx: CommentMacroParser.NumberContext):
|
||||
ctx.value = num(ctx.getText())
|
||||
if isinstance(ctx.parentCtx, CommentMacroParser.TargetContext):
|
||||
|
@ -107,11 +110,9 @@ class OscCommentMacroListener(CommentMacroListener):
|
|||
else:
|
||||
logger.error("ERROR: Spans must be ranged with intigers.")
|
||||
|
||||
def enterTarget(self, ctx: CommentMacroParser.TargetContext):
|
||||
ctx.targets = []
|
||||
|
||||
def exitTarget(self, ctx: CommentMacroParser.TargetContext):
|
||||
ctx.parentCtx.targets.extend(ctx.targets) # add to parent targets
|
||||
def exitDevice(self, ctx: CommentMacroParser.DeviceContext):
|
||||
ctx.parentCtx.device = ctx
|
||||
|
||||
def exitNodeType(self, ctx: CommentMacroParser.NodeTypeContext):
|
||||
if isinstance(ctx.parentCtx, CommentMacroParser.DeviceContext):
|
||||
|
|
|
@ -71,7 +71,7 @@ class HogDevice():
|
|||
for i in ctx.master.targets:
|
||||
if isinstance(i, int) is not True:
|
||||
logger.warn("GO MASTER macro targets must be intigers. "
|
||||
+ str(i) + " is not an intigers.")
|
||||
+ str(i) + " is not an intigers.")
|
||||
continue
|
||||
if (i < 0):
|
||||
logger.warn("Master "+str(i)+" is not greater than 0.")
|
||||
|
@ -89,7 +89,7 @@ class HogDevice():
|
|||
for i in ctx.master.targets:
|
||||
if isinstance(i, int) is not True:
|
||||
logger.warn("GO MASTER macro targets must be intigers. "
|
||||
+ str(i) + " is not an intigers.")
|
||||
+ str(i) + " is not an intigers.")
|
||||
continue
|
||||
if (i < 0):
|
||||
logger.warn("Master "+str(i)+" is not greater than 0.")
|
||||
|
@ -129,7 +129,7 @@ class HogDevice():
|
|||
for i in ctx.master.targets:
|
||||
if isinstance(i, int) is not True:
|
||||
logger.warn("FADE MASTER macro targets must be intigers. "
|
||||
+ str(i) + " is not an intigers.")
|
||||
+ str(i) + " is not an intigers.")
|
||||
continue
|
||||
if (i < 0):
|
||||
logger.warn("Master "+str(i)+" is not greater than 0.")
|
||||
|
|
Loading…
Reference in New Issue