Пример #1
0
 def createSQLFile(self,params,file_name):
      writer=FileWriter(file_name)
      writer.writeLine("BEGIN;");
      writer.writeLine(("DELETE FROM datacaster_parameter;"));
      for p in params:
          writer.writeLine(p.as_sql())
      writer.writeLine("COMMIT;")
      return writer.get_file()
Пример #2
0
 def loadCastFromFile(self,file):
     xml=file.read()
     writer=FileWriter(self.temp_dir + "temp_cast_2.xml" )
     writer.writeLine(xml)
     writer.close()
     castf=DataCastFactory()
     cast=castf.castFromXML(self.temp_dir+"temp_cast_2.xml")
     json=cast.asJSON()
     return json
Пример #3
0
 def createJSONFile(self,params,file_name):
      writer=FileWriter(file_name)
      writer.writeLine("{")
      writer.writeLine('"parameters":[')
      for p in params:
          writer.writeLine(p.as_json() + ",")
      writer.writeLine("]")
      writer.writeLine("}")
      return writer.get_file()
Пример #4
0
 def loadCastFromFile(self, file):
     xml = file.read()
     writer = FileWriter(self.temp_dir + "temp_cast_2.xml")
     writer.writeLine(xml)
     writer.close()
     castf = DataCastFactory()
     cast = castf.castFromXML(self.temp_dir + "temp_cast_2.xml")
     json = cast.asJSON()
     return json
Пример #5
0
 def saveCast(self, cast_xml, cast_rid):
     print cast_rid
     writer = FileWriter(self.temp_dir + "cast_" + cast_rid + ".xml")
     writer.writeLine(cast_xml)
     return "/tmp/cast_" + cast_rid + ".xml"
 def createJSONFile(self, params, file_name):
     writer = FileWriter(file_name)
     writer.writeLine("{")
     writer.writeLine('"parameters":[')
     for p in params:
         writer.writeLine(p.as_json() + ",")
     writer.writeLine("]")
     writer.writeLine("}")
     return writer.get_file()
 def createSQLFile(self, params, file_name):
     writer = FileWriter(file_name)
     writer.writeLine("BEGIN;")
     writer.writeLine(("DELETE FROM datacaster_parameter;"))
     for p in params:
         writer.writeLine(p.as_sql())
     writer.writeLine("COMMIT;")
     return writer.get_file()
Пример #8
0
 def saveCast(self,cast_xml,cast_rid):
     print cast_rid
     writer=FileWriter(self.temp_dir + "cast_" + cast_rid + ".xml" )
     writer.writeLine(cast_xml)
     return "/tmp/cast_" + cast_rid + ".xml"