mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 018ee8ea0c12 (bug 972518) for breaking Mnw jobs on a CLOSED TREE
This commit is contained in:
parent
e741c3a3ce
commit
23bfba1426
@ -23,22 +23,16 @@ from emulator_geo import EmulatorGeo
|
||||
from emulator_screen import EmulatorScreen
|
||||
|
||||
|
||||
class LogOutputProc(ProcessHandlerMixin):
|
||||
"""
|
||||
Process handler for processes which save all output to a logfile.
|
||||
If no logfile is specified, output will still be consumed to prevent
|
||||
the output pipe's from overflowing.
|
||||
class LogcatProc(ProcessHandlerMixin):
|
||||
"""Process handler for logcat which saves all output to a logfile.
|
||||
"""
|
||||
|
||||
def __init__(self, cmd, logfile=None, **kwargs):
|
||||
def __init__(self, logfile, cmd, **kwargs):
|
||||
self.logfile = logfile
|
||||
kwargs.setdefault('processOutputLine', []).append(self.log_output)
|
||||
ProcessHandlerMixin.__init__(self, cmd, **kwargs)
|
||||
|
||||
def log_output(self, line):
|
||||
if not self.logfile:
|
||||
return
|
||||
|
||||
f = open(self.logfile, 'a')
|
||||
f.write(line + "\n")
|
||||
f.flush()
|
||||
@ -323,14 +317,9 @@ waitFor(
|
||||
|
||||
original_online, original_offline = self._get_adb_devices()
|
||||
|
||||
filename = None
|
||||
if self.logcat_dir:
|
||||
filename = os.path.join(self.logcat_dir, 'qemu.log')
|
||||
if os.path.isfile(filename):
|
||||
self.rotate_log(filename)
|
||||
|
||||
self.proc = LogOutputProc(qemu_args, filename)
|
||||
self.proc.run()
|
||||
self.proc = subprocess.Popen(qemu_args,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
|
||||
online, offline = self._get_adb_devices()
|
||||
now = datetime.datetime.now()
|
||||
@ -474,14 +463,8 @@ window.addEventListener('mozbrowserloadend', function loaded(aEvent) {
|
||||
""" Rotate a logfile, by recursively rotating logs further in the sequence,
|
||||
deleting the last file if necessary.
|
||||
"""
|
||||
basename = os.path.basename(srclog)
|
||||
basename = basename[:-len('.log')]
|
||||
if index > 1:
|
||||
basename = basename[:-len('.1')]
|
||||
basename = '%s.%d.log' % (basename, index)
|
||||
|
||||
destlog = os.path.join(self.logcat_dir, basename)
|
||||
if os.path.isfile(destlog):
|
||||
destlog = os.path.join(self.logcat_dir, 'emulator-%d.%d.log' % (self.port, index))
|
||||
if os.access(destlog, os.F_OK):
|
||||
if index == 3:
|
||||
os.remove(destlog)
|
||||
else:
|
||||
@ -492,11 +475,11 @@ window.addEventListener('mozbrowserloadend', function loaded(aEvent) {
|
||||
""" Save the output of logcat to a file.
|
||||
"""
|
||||
filename = os.path.join(self.logcat_dir, "emulator-%d.log" % self.port)
|
||||
if os.path.isfile(filename):
|
||||
if os.access(filename, os.F_OK):
|
||||
self.rotate_log(filename)
|
||||
cmd = [self.adb, '-s', 'emulator-%d' % self.port, 'logcat', '-v', 'threadtime']
|
||||
|
||||
self.logcat_proc = LogOutputProc(cmd, filename)
|
||||
self.logcat_proc = LogcatProc(filename, cmd)
|
||||
self.logcat_proc.run()
|
||||
|
||||
def setup_port_forwarding(self, remote_port):
|
||||
|
Loading…
Reference in New Issue
Block a user