X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=Runner.py;h=ed4e62c38741d48a67263ebabe2a7029e3558862;hb=ed638d831055c06a45f12bf3b8e885d03345386f;hp=6f8bd4def5599b5c28792704c7248d8e5fae598e;hpb=de35dfa319418baf7ba4bc2eeb4dbfc0fd20230a;p=smartthings-infrastructure.git diff --git a/Runner.py b/Runner.py index 6f8bd4d..ed4e62c 100644 --- a/Runner.py +++ b/Runner.py @@ -15,6 +15,7 @@ GlobalVariablesEachApp = open("GlobalVariables/"+"GlobalVariablesEachApp.groovy" setLocationMode = open("Methods/"+"setLocationMode.groovy", "r") subscribe = open("Methods/"+"subscribe.groovy", "r") runIn = open("Methods/"+"runIn.groovy", "r") +runDaily = open("Methods/"+"runDaily.groovy", "r") unschedule = open("Methods/"+"unschedule.groovy", "r") sendNotificationToContacts = open("Methods/"+"sendNotificationToContacts.groovy", "r") sendSms = open("Methods/"+"sendSms.groovy", "r") @@ -31,6 +32,8 @@ sendNotification = open("Methods/"+"sendNotification.groovy", "r") canSchedule = open("Methods/"+"canSchedule.groovy", "r") createAccessToken = open("Methods/"+"createAccessToken.groovy", "r") runOnce = open("Methods/"+"runOnce.groovy", "r") +parseJson = open("Methods/"+"parseJson.groovy", "r") +unsubscribe = open("Methods/"+"unsubscribe.groovy", "r") App1 = open("Extractor/"+"App1/App1.groovy", "r") extractedObjectsApp1 = open("Extractor/"+"App1/extractedObjectsApp1.groovy", "r") extractedObjectsConstructorApp1 = open("Extractor/"+"App1/extractedObjectsConstructorApp1.groovy", "r") @@ -110,6 +113,15 @@ Out.write("import Valve.Valve\n") Out.write("import Valve.Valves\n") Out.write("import MobilePresence.MobilePresence\n") Out.write("import MobilePresence.MobilePresences\n") +Out.write("import ColorTemperature.ColorTemperature\n") +Out.write("import ColorTemperature.ColorTemperatures\n") +Out.write("import Button.Button\n") +Out.write("import Button.Buttons\n") +Out.write("import ThreeAxis.ThreeAxis\n") +Out.write("import ThreeAxis.ThreeAxises\n") +Out.write("import Momentary.Momentary\n") +Out.write("import Momentary.Momentaries\n") +Out.write("import RemainingDevices.RemainingDevices\n") Out.write("import Event.Event\n") Out.write("import Timer.SimulatedTimer\n") Out.write("\n") @@ -121,13 +133,18 @@ for line in eventHandler: Out.write(line) Out.write("\n") Out.write("//GlobalVariables for both Apps\n") +Out.write("@Field def init = Verify.getBoolean()\n\n") for line in GlobalVariablesBothApps: Out.write(line) Out.write("\n") +Out.write("//clear init flag now we are done with it\n") +Out.write("init = false\n") Out.write("//Application #1\n") Out.write("class App1 {\n") Out.write("\tdef reference\n") Out.write("\tdef location\n") +Out.write("\t// A local variable added for conflict detection tool\n") +Out.write("\tdef location_mode\n") Out.write("\tdef app\n") Out.write("\n") Out.write("\t//Extracted objects for App1\n") @@ -156,6 +173,8 @@ for line in subscribe: Out.write("\t"+line) for line in runIn: Out.write("\t"+line) +for line in runDaily: + Out.write("\t"+line) for line in unschedule: Out.write("\t"+line) for line in sendNotificationToContacts: @@ -186,6 +205,10 @@ for line in createAccessToken: Out.write("\t"+line) for line in runOnce: Out.write("\t"+line) +for line in parseJson: + Out.write("\t"+line) +for line in unsubscribe: + Out.write("\t"+line) Out.write("\n") Start = 0 for line in App1: @@ -203,6 +226,7 @@ GlobalVariablesEachApp = open("GlobalVariables/"+"GlobalVariablesEachApp.groovy" setLocationMode = open("Methods/"+"setLocationMode.groovy", "r") subscribe = open("Methods/"+"subscribe.groovy", "r") runIn = open("Methods/"+"runIn.groovy", "r") +runDaily = open("Methods/"+"runDaily.groovy", "r") unschedule = open("Methods/"+"unschedule.groovy", "r") sendNotificationToContacts = open("Methods/"+"sendNotificationToContacts.groovy", "r") sendSms = open("Methods/"+"sendSms.groovy", "r") @@ -219,6 +243,8 @@ sendNotification = open("Methods/"+"sendNotification.groovy", "r") canSchedule = open("Methods/"+"canSchedule.groovy", "r") createAccessToken = open("Methods/"+"createAccessToken.groovy", "r") runOnce = open("Methods/"+"runOnce.groovy", "r") +parseJson = open("Methods/"+"parseJson.groovy", "r") +unsubscribe = open("Methods/"+"unsubscribe.groovy", "r") App2 = open("Extractor/"+"App2/App2.groovy", "r") extractedObjectsApp2 = open("Extractor/"+"App2/extractedObjectsApp2.groovy", "r") extractedObjectsConstructorApp2 = open("Extractor/"+"App2/extractedObjectsConstructorApp2.groovy", "r") @@ -228,6 +254,8 @@ Out.write("//Application #2\n") Out.write("class App2 {\n") Out.write("\tdef reference\n") Out.write("\tdef location\n") +Out.write("\t// A local variable added for conflict detection tool\n") +Out.write("\tdef location_mode\n") Out.write("\tdef app\n") Out.write("\n") Out.write("\t//Extracted objects for App2\n") @@ -256,6 +284,8 @@ for line in subscribe: Out.write("\t"+line) for line in runIn: Out.write("\t"+line) +for line in runDaily: + Out.write("\t"+line) for line in unschedule: Out.write("\t"+line) for line in sendNotificationToContacts: @@ -286,6 +316,10 @@ for line in createAccessToken: Out.write("\t"+line) for line in runOnce: Out.write("\t"+line) +for line in parseJson: + Out.write("\t"+line) +for line in unsubscribe: + Out.write("\t"+line) Out.write("\n") Start = 0 for line in App2: @@ -297,22 +331,22 @@ Out.write("}\n") Out.write("\n") Out.write("@Field def app1\n") Out.write("@Field def app2\n") -Out.write("def initOrder = Verify.getBoolean()\n") -Out.write("if (initOrder) {\n") +Out.write("//def initOrder = Verify.getBoolean()\n") +Out.write("//if (initOrder) {\n") Out.write("\tapp1 = new App1(this)\n") Out.write("\tapp2 = new App2(this)\n") -Out.write("} else {\n") -Out.write("\tapp2 = new App2(this)\n") -Out.write("\tapp1 = new App1(this)\n") -Out.write("}\n\n") -Out.write("def installOrder = Verify.getBoolean()\n") -Out.write("if (installOrder) {\n") +Out.write("//} else {\n") +Out.write("\t//app2 = new App2(this)\n") +Out.write("\t//app1 = new App1(this)\n") +Out.write("//}\n\n") +Out.write("//def installOrder = Verify.getBoolean()\n") +Out.write("//if (installOrder) {\n") Out.write("\tapp1.installed()\n") Out.write("\tapp2.installed()\n") -Out.write("} else {\n") -Out.write("\tapp2.installed()\n") -Out.write("\tapp1.installed()\n") -Out.write("}\n\n") +Out.write("//} else {\n") +Out.write("\t//app2.installed()\n") +Out.write("\t//app1.installed()\n") +Out.write("//}\n\n") for line in eventSimulator: Out.write(line) Out.close()