Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1437)

Unified Diff: Tools/Scripts/webkitpy/layout_tests/port/factory.py

Issue 546133003: Reformat webkitpy.layout_tests w/ format-webkitpy. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Tools/Scripts/webkitpy/layout_tests/port/factory.py
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/factory.py b/Tools/Scripts/webkitpy/layout_tests/port/factory.py
index 8703ddf3d3e612488820f5b68293557da895d2c7..2ebfe5485b895f536bc212c12685204f40365472 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/factory.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/factory.py
@@ -38,34 +38,33 @@ from webkitpy.layout_tests.port import builders
def platform_options(use_globs=False):
return [
optparse.make_option('--platform', action='store',
- help=('Glob-style list of platform/ports to use (e.g., "mac*")' if use_globs else 'Platform to use (e.g., "mac-lion")')),
+ help=('Glob-style list of platform/ports to use (e.g., "mac*")' if use_globs else 'Platform to use (e.g., "mac-lion")')),
# FIXME: Update run_webkit_tests.sh, any other callers to no longer pass --chromium, then remove this flag.
optparse.make_option('--chromium', action='store_const', dest='platform',
- const=('chromium*' if use_globs else 'chromium'),
- help=('Alias for --platform=chromium*' if use_globs else 'Alias for --platform=chromium')),
+ const=('chromium*' if use_globs else 'chromium'),
+ help=('Alias for --platform=chromium*' if use_globs else 'Alias for --platform=chromium')),
optparse.make_option('--android', action='store_const', dest='platform',
- const=('android*' if use_globs else 'android'),
- help=('Alias for --platform=android*' if use_globs else 'Alias for --platform=android')),
- ]
+ const=('android*' if use_globs else 'android'),
+ help=('Alias for --platform=android*' if use_globs else 'Alias for --platform=android')),
+ ]
def configuration_options():
return [
- optparse.make_option("-t", "--target", dest="configuration",
- help="specify the target configuration to use (Debug/Release)"),
- optparse.make_option('--debug', action='store_const', const='Debug', dest="configuration",
- help='Set the configuration to Debug'),
- optparse.make_option('--release', action='store_const', const='Release', dest="configuration",
- help='Set the configuration to Release'),
- ]
-
+ optparse.make_option('-t', '--target', dest='configuration',
+ help='specify the target configuration to use (Debug/Release)'),
+ optparse.make_option('--debug', action='store_const', const='Debug', dest='configuration',
+ help='Set the configuration to Debug'),
+ optparse.make_option('--release', action='store_const', const='Release', dest='configuration',
+ help='Set the configuration to Release'),
+ ]
def _builder_options(builder_name):
- configuration = "Debug" if re.search(r"[d|D](ebu|b)g", builder_name) else "Release"
- is_webkit2 = builder_name.find("WK2") != -1
+ configuration = 'Debug' if re.search(r"[d|D](ebu|b)g", builder_name) else 'Release'
+ is_webkit2 = builder_name.find('WK2') != -1
builder_name = builder_name
return optparse.Values({'builder_name': builder_name, 'configuration': configuration})
@@ -108,7 +107,7 @@ class PortFactory(object):
module_name, class_name = port_name.rsplit('.', 1)
module = __import__(module_name, globals(), locals(), [], -1)
port_class_name = module.get_port_class_name(class_name)
- if port_class_name != None:
+ if port_class_name is not None:
cls = module.__dict__[port_class_name]
port_name = cls.determine_full_port_name(self._host, options, class_name)
return cls(self._host, port_name, options=options, **kwargs)

Powered by Google App Engine
This is Rietveld 408576698