Exemplo n.º 1
0
def save_thread():
  '''thread for saving files'''
  try:
    os.mkdir('tmp')
  except Exception:
    pass
  last_filename = None
  while True:
    frame_time, im, is_jpeg = state.save_queue.get()
    if is_jpeg:
      filename = 'tmp/i%s.jpg' % cuav_util.frame_time(frame_time)
      chameleon.save_file(filename, im)
    else:
      filename = 'tmp/i%s.pgm' % cuav_util.frame_time(frame_time)
      chameleon.save_pgm(filename, im)
    if opts.make_fake is not None:
      try:
        os.unlink(opts.make_fake)
      except OSError:
        pass
      os.symlink(filename, opts.make_fake)
      if last_filename is not None:
        try:
          os.unlink(last_filename)
        except OSError:
          pass
      last_filename = filename
Exemplo n.º 2
0
def save_thread():
    global save_queue
    while True:
        (frame_time, im) = save_queue.get()
        filename = '%s/%s.pgm' % (opts.output,
                                  cuav_util.frame_time(frame_time))
        chameleon.save_pgm(filename, im)
Exemplo n.º 3
0
def save_thread():
  '''thread for saving files'''
  try:
    os.mkdir('tmp')
  except Exception:
    pass
  while True:
    frame_time, im, is_jpeg = state.save_queue.get()
    if is_jpeg:
      filename = 'tmp/i%s.jpg' % cuav_util.frame_time(frame_time)
      chameleon.save_file(filename, im)
    else:
      filename = 'tmp/i%s.pgm' % cuav_util.frame_time(frame_time)
      chameleon.save_pgm(filename, im)
Exemplo n.º 4
0
def save_thread():
    '''thread for saving files'''
    try:
        os.mkdir('tmp')
    except Exception:
        pass
    while True:
        frame_time, im, is_jpeg = state.save_queue.get()
        if is_jpeg:
            filename = 'tmp/i%s.jpg' % cuav_util.frame_time(frame_time)
            chameleon.save_file(filename, im)
        else:
            filename = 'tmp/i%s.pgm' % cuav_util.frame_time(frame_time)
            chameleon.save_pgm(filename, im)
Exemplo n.º 5
0
def save_thread():
  global save_queue
  while True:
    (frame_time, im) = save_queue.get()
    filename = '%s/%s.pgm' % (opts.output, cuav_util.frame_time(frame_time))
    chameleon.save_pgm(filename, im)