5252
5353# TODO: replace this with the new parser
5454from OMPython import OMTypedParser
55- from OMPython import OMParser
55+ from OMPython . OMParser import om_parser_basic
5656
5757
5858# define logger using the current module name as ID
@@ -81,9 +81,6 @@ def __init__(self, readonly=False):
8181 self ._readonly = readonly
8282 self ._omc_cache = {}
8383
84- def clearOMParserResult (self ):
85- OMParser .result = {}
86-
8784 def execute (self , command ):
8885 warnings .warn ("This function is depreciated and will be removed in future versions; "
8986 "please use sendExpression() instead" , DeprecationWarning , stacklevel = 1 )
@@ -246,8 +243,7 @@ def getComponentModifierValue(self, className, componentName):
246243 logger .warning ('OMTypedParser error: %s' , ex .message )
247244 result = self .ask ('getComponentModifierValue' , f'{ className } , { componentName } ' , parsed = False )
248245 try :
249- answer = OMParser .check_for_values (result )
250- OMParser .result = {}
246+ answer = om_parser_basic (result )
251247 return answer [2 :]
252248 except (TypeError , UnboundLocalError ) as ex :
253249 logger .warning ('OMParser error: %s' , ex )
@@ -264,8 +260,7 @@ def getExtendsModifierValue(self, className, extendsName, modifierName):
264260 logger .warning ('OMTypedParser error: %s' , ex .message )
265261 result = self .ask ('getExtendsModifierValue' , f'{ className } , { extendsName } , { modifierName } ' , parsed = False )
266262 try :
267- answer = OMParser .check_for_values (result )
268- OMParser .result = {}
263+ answer = om_parser_basic (result )
269264 return answer [2 :]
270265 except (TypeError , UnboundLocalError ) as ex :
271266 logger .warning ('OMParser error: %s' , ex )
0 commit comments