From 1c4c4b18a232d22097f716bcc128db8f5d796222 Mon Sep 17 00:00:00 2001 From: Kevin Matz Date: Thu, 25 Oct 2018 16:39:41 -0400 Subject: [PATCH] remove parser internals from macro implementations --- OscCommentMacroListener.py | 3 +-- OscMacroDefinitions.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/OscCommentMacroListener.py b/OscCommentMacroListener.py index 7062fc0..9fd66c9 100644 --- a/OscCommentMacroListener.py +++ b/OscCommentMacroListener.py @@ -112,5 +112,4 @@ class OscCommentMacroListener(CommentMacroListener): ctx.parentCtx.device = ctx def exitNodeType(self, ctx: CommentMacroParser.NodeTypeContext): - if isinstance(ctx.parentCtx, CommentMacroParser.DeviceContext): - ctx.parentCtx.type = ctx + ctx.parentCtx.type = ctx.getText() diff --git a/OscMacroDefinitions.py b/OscMacroDefinitions.py index bf9dfc6..80469d7 100644 --- a/OscMacroDefinitions.py +++ b/OscMacroDefinitions.py @@ -47,7 +47,7 @@ class HogDevice(): if device is None: osc = list(self.servers.values())[0] else: - if (device.type.getText() != 'h'): + if (device.type != 'h'): logger.error("ERROR: Only Hog type devices are supported.") return else: