launcher: Minor indentation issue fixes

This commit is contained in:
Thibault Saunier 2018-03-23 18:02:43 -03:00
parent 2b40c6c306
commit cd1c4eb44d

View file

@ -417,14 +417,16 @@ class Test(Loggable):
vg_config = get_data_file('data', 'valgrind.config')
if self.proc_env.get('GST_VALIDATE_CONFIG'):
subenv['GST_VALIDATE_CONFIG'] = '%s%s%s' % (self.proc_env['GST_VALIDATE_CONFIG'], os.pathsep, vg_config)
subenv['GST_VALIDATE_CONFIG'] = '%s%s%s' % (
self.proc_env['GST_VALIDATE_CONFIG'], os.pathsep, vg_config)
else:
subenv['GST_VALIDATE_CONFIG'] = vg_config
if subenv == self.proc_env:
self.add_env_variable('G_DEBUG', 'gc-friendly')
self.add_env_variable('G_SLICE', 'always-malloc')
self.add_env_variable('GST_VALIDATE_CONFIG', self.proc_env['GST_VALIDATE_CONFIG'])
self.add_env_variable('GST_VALIDATE_CONFIG',
self.proc_env['GST_VALIDATE_CONFIG'])
return command
@ -535,9 +537,11 @@ class Test(Loggable):
return self.result
class GstValidateTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
pass
class GstValidateListener(socketserver.BaseRequestHandler):
def handle(self):
"""Implements BaseRequestHandler handle method"""
@ -564,7 +568,8 @@ class GstValidateListener(socketserver.BaseRequestHandler):
test = t
break
if test is None:
self.server.launcher.error("Could not find test for UUID %s" % uuid)
self.server.launcher.error(
"Could not find test for UUID %s" % uuid)
return
obj_type = obj.get("type", '')
@ -674,7 +679,8 @@ class GstValidateTest(Test):
def get_override_file(self, media_descriptor):
if media_descriptor:
if media_descriptor.get_path():
override_path = os.path.splitext(media_descriptor.get_path())[0] + VALIDATE_OVERRIDE_EXTENSION
override_path = os.path.splitext(media_descriptor.get_path())[
0] + VALIDATE_OVERRIDE_EXTENSION
if os.path.exists(override_path):
return override_path
@ -1319,7 +1325,8 @@ class _TestsLauncher(Loggable):
files = []
for f in files:
if f.endswith(".py"):
exec(compile(open(os.path.join(app_dir, f)).read(), os.path.join(app_dir, f), 'exec'), env)
exec(compile(open(os.path.join(app_dir, f)).read(),
os.path.join(app_dir, f), 'exec'), env)
def _exec_apps(self, env):
app_dirs = self._list_app_dirs()
@ -1371,7 +1378,8 @@ class _TestsLauncher(Loggable):
if not loaded_module[0]:
if "." in testsuite:
self.options.testsuites.append(testsuite.split('.')[0])
self.info("%s looks like a test name, trying that" % testsuite)
self.info("%s looks like a test name, trying that" %
testsuite)
self.options.wanted_tests.append(testsuite)
else:
printc("Could not load testsuite: %s, reasons: %s" % (
@ -1426,7 +1434,8 @@ class _TestsLauncher(Loggable):
globals()["options"] = options
c__file__ = __file__
globals()["__file__"] = self.options.config
exec(compile(open(self.options.config).read(), self.options.config, 'exec'), globals())
exec(compile(open(self.options.config).read(),
self.options.config, 'exec'), globals())
globals()["__file__"] = c__file__
def set_settings(self, options, args):
@ -1999,7 +2008,8 @@ class MediaDescriptor(Loggable):
return False
if self.is_live() and not scenario.compatible_with_live_content():
self.debug("Do not run %s as %s is a live content", scenario, self.get_uri())
self.debug("Do not run %s as %s is a live content",
scenario, self.get_uri())
return False
if not self.prerrols() and getattr(scenario, 'needs_preroll', False):
@ -2046,7 +2056,8 @@ class GstValidateMediaDescriptor(MediaDescriptor):
self._extract_data(media_xml)
self.set_protocol(urllib.parse.urlparse(urllib.parse.urlparse(self.get_uri()).scheme).scheme)
self.set_protocol(urllib.parse.urlparse(
urllib.parse.urlparse(self.get_uri()).scheme).scheme)
def _extract_data(self, media_xml):
# Extract the information we need from the xml
@ -2058,7 +2069,8 @@ class GstValidateMediaDescriptor(MediaDescriptor):
pass
else:
for stream in streams:
self._track_caps.append((stream.attrib["type"], stream.attrib["caps"]))
self._track_caps.append(
(stream.attrib["type"], stream.attrib["caps"]))
self._uri = media_xml.attrib["uri"]
self._duration = int(media_xml.attrib["duration"])
self._protocol = media_xml.get("protocol", None)
@ -2112,7 +2124,8 @@ class GstValidateMediaDescriptor(MediaDescriptor):
if verbose:
printc("Result: Failed", Colors.FAIL)
else:
loggable.warning("GstValidateMediaDescriptor", "Exception: %s" % e)
loggable.warning("GstValidateMediaDescriptor",
"Exception: %s" % e)
return None
if verbose: