예제 #1
0
 def score_http_xml(self, data):
   """This function should be used as the callback for the HTTP server when the data is expected to be XML."""
   wrapper = StringIO(data) #wrap the data in a StringIO object
   rdr = Reader(self.score, source = wrapper, logger = self.logger, magicheader = False, unitable = False)
   pipe = rdr.new_pipe()
   #try:
   return rdr.feed_pipe(None, pipe)
예제 #2
0
 def score_http_xml(self, data):
   """This function should be used as the callback for the HTTP server when the data is expected to be XML."""
   wrapper = StringIO(data) #wrap the data in a StringIO object
   rdr = Reader(self.score, source = wrapper, logger = self.logger, magicheader = False, unitable = False)
   pipe = rdr.new_pipe()
   #try:
   return rdr.feed_pipe(None, pipe)
예제 #3
0
 def score_http_uni(self,data):
   """This function should be used as the callback for the HTTP server when the data is expected to be a UniTable or csv file."""
   wrapper = StringIO(data) #wrap the data in a StringIO object
   rdr = Reader(self.score, source = wrapper, logger = self.logger, magicheader = False, unitable = True)
   pipe = rdr.new_pipe()
   try:
     return rdr.feed_pipe(None, pipe)
   except:
     self.logger.error("something broke.")
   pass
예제 #4
0
 def score_http_uni(self,data):
   """This function should be used as the callback for the HTTP server when the data is expected to be a UniTable or csv file."""
   wrapper = StringIO(data) #wrap the data in a StringIO object
   rdr = Reader(self.score, source = wrapper, logger = self.logger, magicheader = False, unitable = True)
   pipe = rdr.new_pipe()
   try:
     return rdr.feed_pipe(None, pipe)
   except:
     self.logger.error("something broke.")
   pass
예제 #5
0
 def http_callback(data):
     wrapper = StringIO.StringIO(data)
     rdr =\
         Reader(callback,
             source=wrapper,
             logger=self._logger,
             magicheader=False,
             unitable=not isXML,
             wholeUniTable=not isXML)
     pipe = rdr.new_pipe()
     try:
         result = rdr.feed_pipe(None, pipe)
     except:
         raise IOError("Problem reading data over HTTP.")
     return result
예제 #6
0
 def http_callback(data):
     wrapper = StringIO.StringIO(data)
     rdr =\
         Reader(callback,
             source=wrapper,
             logger=self._logger,
             magicheader=False,
             unitable=not isXML,
             wholeUniTable=not isXML)
     pipe = rdr.new_pipe()
     try:
         result = rdr.feed_pipe(None, pipe)
     except:
         raise IOError("Problem reading data over HTTP.")
     return result