From: rtrimana Date: Mon, 29 Jul 2019 17:47:01 +0000 (-0700) Subject: Fixing a bug in event to variable mapping. X-Git-Url: http://plrg.eecs.uci.edu/git/?p=smartthings-infrastructure.git;a=commitdiff_plain;h=48d721558425cad469bf9e67663c4e60018eb249 Fixing a bug in event to variable mapping. --- diff --git a/Extractor/ExtractorScript.py b/Extractor/ExtractorScript.py index 8e10962..0e9539f 100644 --- a/Extractor/ExtractorScript.py +++ b/Extractor/ExtractorScript.py @@ -76,6 +76,8 @@ def ExtractFunctions(F, appName): else: app2Subscribe = True Temp = GetToken(F) + if (Temp == "("): + Temp = GetToken(F) variable = Temp while (Temp != "\"" and Temp != "app" and Temp != "location"): Temp = GetToken(F) @@ -260,10 +262,13 @@ def ExtractEvents(extractedEvents): event.close() extractedEvents.write("\t\t\t}\n") elif eventList[i] == "carbonMonoxide": + print eventVarMap + print capabilityMap + #Check which capability variable = eventVarMap[eventList[i]] capability = capabilityMap[variable] - + #Write three events subsequently extractedEvents.write("\t\t\tdef event = Verify.getInt(0,2)\n") extractedEvents.write("\t\t\tif (event == 0) {\n")