Commit #4
[smartthings-infrastructure.git] / Extractor / ExtractorScript.py
index b9654b4512f7c4f4d2ed8f8becc4fb6ce47dc263..399651bcb037d1bf40b61e55ac78e8e4ae9535b3 100644 (file)
@@ -37,7 +37,7 @@ def GetToken(f):
                
 
 F = open("Extractor/App.groovy", "r")
-Out = open("Extractor/ExtractedObjects.groovy", "w+")
+Out = open("Extractor/extractedObjects.groovy", "w+")
 Temp = GetToken(F)
 
 Objects = []
@@ -83,11 +83,11 @@ while (Temp != "EOF"):
                        if (Multiple != "" and Multiple == "true"):
                                g = raw_input("Enter the number of locks to control: (1, 2, or 3)\n") 
                                Out.write("//Global Object for class lock!\n")
-                               Out.write("@Field def %s = new locking(" % Object)
+                               Out.write("@Field def %s = new Locking(sendEvent, " % Object)
                                Out.write("%s)\n" % g)
                        elif (Multiple == "" or Multiple == "false"):
                                Out.write("//Global Object for class lock!\n")
-                               Out.write("@Field def %s = new locking(1)\n" % Object)
+                               Out.write("@Field def %s = new Locking(sendEvent, 1)\n" % Object)
                #elif (Type == "capability.alarm"):
 
                #elif (Type == "capability.battery"):
@@ -104,11 +104,11 @@ while (Temp != "EOF"):
                        if (Multiple != "" and Multiple == "true"):
                                g = raw_input("Enter the number of contactSensors to monitor: (1, 2, or 3)\n") 
                                Out.write("//Global Object for class contactSensor!\n")
-                               Out.write("@Field def %s = new contacting(" % Object)
+                               Out.write("@Field def %s = new Contacting(sendEvent, " % Object)
                                Out.write("%s)\n" % g)
                        elif (Multiple == "" or Multiple == "false"):
                                Out.write("//Global Object for class contactSensor!\n")
-                               Out.write("@Field def %s = new contacting(1)\n" % Object)
+                               Out.write("@Field def %s = new Contacting(sendEvent, 1)\n" % Object)
                #elif (Type == "capability.doorControl"):
 
                #elif (Type == "capability.energyMeter"):
@@ -141,11 +141,11 @@ while (Temp != "EOF"):
                        if (Multiple != "" and Multiple == "true"):
                                g = raw_input("Enter the number of switches to control: (1, 2, or 3)\n") 
                                Out.write("//Global Object for class switch!\n")
-                               Out.write("@Field def %s = new switching(" % Object)
+                               Out.write("@Field def %s = new Switching(sendEvent, " % Object)
                                Out.write("%s)\n" % g)
                        elif (Multiple == "" or Multiple == "false"):
                                Out.write("//Global Object for class switch!\n")
-                               Out.write("@Field def %s = new switching(1)\n" % Object)
+                               Out.write("@Field def %s = new Switching(sendEvent, 1)\n" % Object)
                #elif (Type == "capability.switchLevel"):
 
                #elif (Type == "capability.temperatureMeasurement"):