def Prepare(self, test):
    recorder = test.GetRecorder()
    file_base = test.GetFileBase()
    if ((recorder is not None) and (file_base is not None)):
        args = [recorder, '--filebase', file_base, '--histograms']
        if test.TcpDump():
            args.append('--tcpdump')
        if test.Video():
            args.append('--video')
        if test.FullSizeVideo():
            args.append('--noresize')
        args.extend(['--quality', str(test.GetImageQuality())])
        try:
            self.proc = subprocess.Popen(args)
        except:
            logging.debug('Error launching recorder "{0}"'.format(recorder))
    start = time.time()
    while ((self.window is None) and ((time.time() - start) < 30)):
        try:
            self.window = win32ui.FindWindow('wptRecord', 'wptRecord')
        except:
            time.sleep(0.1)
    if (self.window is not None):
        try:
            self.window.SendMessage(self.UWM_PREPARE, 0, 0)
        except:
            pass
def Prepare(self, test):
    recorder = test.GetRecorder()
    file_base = test.GetFileBase()
    if ((recorder is not None) and (file_base is not None)):
        args = [recorder, '--filebase', file_base, '--histograms']
        if test.TcpDump():
            args.append('--tcpdump')
        if test.Video():
            args.append('--video')
        if test.FullSizeVideo():
            args.append('--noresize')
        args.extend(['--quality', str(test.GetImageQuality())])
        try:
            self.proc = subprocess.Popen(args)
        except:
            logging.debug('Error launching recorder "{0}"'.format(recorder))
    start = time.time()
    while ((self.window is None) and ((time.time() - start) < 30)):
        try:
            self.window = win32ui.FindWindow('wptRecord', 'wptRecord')
        except:
            time.sleep(0.1)
    if (self.window is not None):
        try:
            self.window.SendMessage(self.UWM_PREPARE, 0, 0)
        except:
            pass