def execute_streaming_diginorm(ifilename):
 fifo = utils.get_temp_filename(u'fifo')
 in_dir = os.path.dirname(fifo)
 script = u'normalize-by-median.py'
 args = [u'-C', u'1', u'-k', u'17', u'-o', u'outfile', fifo]
 os.mkfifo(fifo)
 thread = threading.Thread(target=utils.runscript, args=(script, args, in_dir))
 thread.start()
 ifile = io.open(ifilename, u'rb')
 fifofile = io.open(fifo, u'wb')
 chunk = ifile.read(8192)
 while (len(chunk) > 0):
  fifofile.write(chunk)
  chunk = ifile.read(8192)
 fifofile.close()
 thread.join()
 return (in_dir + u'/outfile')

def execute_streaming_diginorm ( ifilename ) : fifo = utils . get_temp_filename ( u'fifo' ) in_dir = os . path . dirname ( fifo ) script = u'normalize-by-median.py' args = [ u'-C' , u'1' , u'-k' , u'17' , u'-o' , u'outfile' , fifo ] os . mkfifo ( fifo ) thread = threading . Thread ( target = utils . runscript , args = ( script , args , in_dir ) ) thread . start ( ) ifile = io . open ( ifilename , u'rb' ) fifofile = io . open ( fifo , u'wb' ) chunk = ifile . read ( 8192 ) while ( len ( chunk ) > 0 ) : fifofile . write ( chunk ) chunk = ifile . read ( 8192 ) fifofile . close ( ) thread . join ( ) return ( in_dir + u'/outfile' )
helper function for the matrix of streaming tests for read_parser using diginorm .