diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-06-03 08:04:11 -0500 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-06-03 08:04:11 -0500 |
commit | 9aa1d932828d15f6590816c638af1e3f451130a4 (patch) | |
tree | 96c458021d7eb1ca9ce883ad997cf8ab69165021 /python | |
parent | b408fa9960b0644544c1ef0c7f13f0738f06a32b (diff) | |
parent | e3b71c65bf77d532287d8eb6c5ed7f9468e3e1f5 (diff) | |
download | servo-9aa1d932828d15f6590816c638af1e3f451130a4.tar.gz servo-9aa1d932828d15f6590816c638af1e3f451130a4.zip |
Auto merge of #6268 - frewsxcv:tidy-python, r=jdm
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6268)
<!-- Reviewable:end -->
Diffstat (limited to 'python')
-rw-r--r-- | python/mach_bootstrap.py | 3 | ||||
-rw-r--r-- | python/servo/__init__.py | 8 | ||||
-rw-r--r-- | python/servo/bootstrap_commands.py | 9 | ||||
-rw-r--r-- | python/servo/build_commands.py | 11 | ||||
-rw-r--r-- | python/servo/command_base.py | 61 | ||||
-rw-r--r-- | python/servo/devenv_commands.py | 9 | ||||
-rw-r--r-- | python/servo/post_build_commands.py | 9 | ||||
-rw-r--r-- | python/servo/testing_commands.py | 9 | ||||
-rw-r--r-- | python/tidy.py | 14 |
9 files changed, 113 insertions, 20 deletions
diff --git a/python/mach_bootstrap.py b/python/mach_bootstrap.py index e7ca0c9d02b..894cbbf97c0 100644 --- a/python/mach_bootstrap.py +++ b/python/mach_bootstrap.py @@ -66,7 +66,8 @@ CATEGORIES = { }, 'disabled': { 'short': 'Disabled', - 'long': 'The disabled commands are hidden by default. Use -v to display them. These commands are unavailable for your current context, run "mach <command>" to see why.', + 'long': 'The disabled commands are hidden by default. Use -v to display them. These commands are unavailable ' + 'for your current context, run "mach <command>" to see why.', 'priority': 0, } } diff --git a/python/servo/__init__.py b/python/servo/__init__.py index e69de29bb2d..6b6351ddd2b 100644 --- a/python/servo/__init__.py +++ b/python/servo/__init__.py @@ -0,0 +1,8 @@ +# Copyright 2013 The Servo Project Developers. See the COPYRIGHT +# file at the top-level directory of this distribution. +# +# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +# option. This file may not be copied, modified, or distributed +# except according to those terms. diff --git a/python/servo/bootstrap_commands.py b/python/servo/bootstrap_commands.py index 49a9cc1514c..ad211b97eff 100644 --- a/python/servo/bootstrap_commands.py +++ b/python/servo/bootstrap_commands.py @@ -1,3 +1,12 @@ +# Copyright 2013 The Servo Project Developers. See the COPYRIGHT +# file at the top-level directory of this distribution. +# +# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +# option. This file may not be copied, modified, or distributed +# except according to those terms. + from __future__ import print_function, unicode_literals import os diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py index 77f7d1b7a2d..a0ff559ee54 100644 --- a/python/servo/build_commands.py +++ b/python/servo/build_commands.py @@ -1,3 +1,12 @@ +# Copyright 2013 The Servo Project Developers. See the COPYRIGHT +# file at the top-level directory of this distribution. +# +# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +# option. This file may not be copied, modified, or distributed +# except according to those terms. + from __future__ import print_function, unicode_literals import os @@ -331,6 +340,6 @@ class MachCommands(CommandBase): opts += ["--manifest-path", manifest_path] if verbose: opts += ["-v"] - opts += params + opts += params return subprocess.call(["cargo", "clean"] + opts, env=self.build_env(), cwd=self.servo_crate()) diff --git a/python/servo/command_base.py b/python/servo/command_base.py index ed8f9de2de8..5ac41b06009 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -1,3 +1,12 @@ +# Copyright 2013 The Servo Project Developers. See the COPYRIGHT +# file at the top-level directory of this distribution. +# +# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +# option. This file may not be copied, modified, or distributed +# except according to those terms. + import os from os import path import contextlib @@ -222,25 +231,45 @@ class CommandBase(object): env["CC"] = "arm-linux-androideabi-gcc" env["ARCH_DIR"] = "arch-arm" - env["CPPFLAGS"] = ("-DANDROID -DTARGET_OS_GONK -DGR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE=1 " - "-isystem %(gonkdir)s/bionic/libc/%(archdir)s/include -isystem %(gonkdir)s/bionic/libc/include/ " - "-isystem %(gonkdir)s/bionic/libc/kernel/common -isystem %(gonkdir)s/bionic/libc/kernel/%(archdir)s " - "-isystem %(gonkdir)s/bionic/libm/include -I%(gonkdir)s/system -I%(gonkdir)s/system/core/include " - "-isystem %(gonkdir)s/bionic -I%(gonkdir)s/frameworks/native/opengl/include -I%(gonkdir)s/external/zlib " - "-I%(gonkdir)s/hardware/libhardware/include/hardware/") % {"gonkdir": env["GONKDIR"], "archdir": env["ARCH_DIR"] } - env["CXXFLAGS"] = ("-O2 -mandroid -fPIC %(cppflags)s -I%(gonkdir)s/ndk/sources/cxx-stl/stlport/stlport " - "-I%(gonkdir)s/ndk/sources/cxx-stl/system/include") % {"gonkdir": env["GONKDIR"], "cppflags": env["CPPFLAGS"] } - env["CFLAGS"] = ("-O2 -mandroid -fPIC %(cppflags)s -I%(gonkdir)s/ndk/sources/cxx-stl/stlport/stlport " - "-I%(gonkdir)s/ndk/sources/cxx-stl/system/include") % {"gonkdir": env["GONKDIR"], "cppflags": env["CPPFLAGS"] } - - another_extra_path = path.join(env["GONKDIR"], "prebuilts", "gcc", "linux-x86", "arm", "arm-linux-androideabi-4.7", "bin") + env["CPPFLAGS"] = ( + "-DANDROID -DTARGET_OS_GONK " + "-DGR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE=1 " + "-isystem %(gonkdir)s/bionic/libc/%(archdir)s/include " + "-isystem %(gonkdir)s/bionic/libc/include/ " + "-isystem %(gonkdir)s/bionic/libc/kernel/common " + "-isystem %(gonkdir)s/bionic/libc/kernel/%(archdir)s " + "-isystem %(gonkdir)s/bionic/libm/include " + "-I%(gonkdir)s/system " + "-I%(gonkdir)s/system/core/include " + "-isystem %(gonkdir)s/bionic " + "-I%(gonkdir)s/frameworks/native/opengl/include " + "-I%(gonkdir)s/external/zlib " + "-I%(gonkdir)s/hardware/libhardware/include/hardware/ " + ) % {"gonkdir": env["GONKDIR"], "archdir": env["ARCH_DIR"]} + env["CXXFLAGS"] = ( + "-O2 -mandroid -fPIC %(cppflags)s " + "-I%(gonkdir)s/ndk/sources/cxx-stl/stlport/stlport " + "-I%(gonkdir)s/ndk/sources/cxx-stl/system/include " + ) % {"gonkdir": env["GONKDIR"], "cppflags": env["CPPFLAGS"]} + env["CFLAGS"] = ( + "-O2 -mandroid -fPIC %(cppflags)s " + "-I%(gonkdir)s/ndk/sources/cxx-stl/stlport/stlport " + "-I%(gonkdir)s/ndk/sources/cxx-stl/system/include " + ) % {"gonkdir": env["GONKDIR"], "cppflags": env["CPPFLAGS"]} + + another_extra_path = path.join( + env["GONKDIR"], "prebuilts", "gcc", "linux-x86", "arm", "arm-linux-androideabi-4.7", "bin") env["PATH"] = "%s%s%s" % (another_extra_path, os.pathsep, env["PATH"]) - env["LDFLAGS"] = ("-mandroid -L%(gonkdir)s/out/target/product/%(gonkproduct)s/obj/lib " - "-Wl,-rpath-link=%(gonkdir)s/out/target/product/%(gonkproduct)s/obj/lib " - "--sysroot=%(gonkdir)s/out/target/product/%(gonkproduct)s/obj/") % {"gonkdir": env["GONKDIR"], "gonkproduct": env["GONK_PRODUCT"] } + env["LDFLAGS"] = ( + "-mandroid -L%(gonkdir)s/out/target/product/%(gonkproduct)s/obj/lib " + "-Wl,-rpath-link=%(gonkdir)s/out/target/product/%(gonkproduct)s/obj/lib " + "--sysroot=%(gonkdir)s/out/target/product/%(gonkproduct)s/obj/" + ) % {"gonkdir": env["GONKDIR"], "gonkproduct": env["GONK_PRODUCT"]} # Not strictly necessary for a vanilla build, but might be when tweaking the openssl build - openssl_dir = "%(gonkdir)s/out/target/product/%(gonkproduct)s/obj/lib" % {"gonkdir": env["GONKDIR"], "gonkproduct": env["GONK_PRODUCT"] } + openssl_dir = ( + "%(gonkdir)s/out/target/product/%(gonkproduct)s/obj/lib" + ) % {"gonkdir": env["GONKDIR"], "gonkproduct": env["GONK_PRODUCT"]} env["OPENSSL_LIB_DIR"] = openssl_dir env['OPENSSL_INCLUDE_DIR'] = path.join(openssl_dir, "include") diff --git a/python/servo/devenv_commands.py b/python/servo/devenv_commands.py index f061d79675c..e569951342e 100644 --- a/python/servo/devenv_commands.py +++ b/python/servo/devenv_commands.py @@ -1,3 +1,12 @@ +# Copyright 2013 The Servo Project Developers. See the COPYRIGHT +# file at the top-level directory of this distribution. +# +# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +# option. This file may not be copied, modified, or distributed +# except according to those terms. + from __future__ import print_function, unicode_literals from os import path, getcwd, listdir diff --git a/python/servo/post_build_commands.py b/python/servo/post_build_commands.py index f6c4c015ba1..9ed97bec045 100644 --- a/python/servo/post_build_commands.py +++ b/python/servo/post_build_commands.py @@ -1,3 +1,12 @@ +# Copyright 2013 The Servo Project Developers. See the COPYRIGHT +# file at the top-level directory of this distribution. +# +# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +# option. This file may not be copied, modified, or distributed +# except according to those terms. + from __future__ import print_function, unicode_literals import os diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index 44220022db4..b9ce70b2d8b 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -1,3 +1,12 @@ +# Copyright 2013 The Servo Project Developers. See the COPYRIGHT +# file at the top-level directory of this distribution. +# +# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +# option. This file may not be copied, modified, or distributed +# except according to those terms. + from __future__ import print_function, unicode_literals import argparse diff --git a/python/tidy.py b/python/tidy.py index 500c75bf316..bfad1b43ea3 100644 --- a/python/tidy.py +++ b/python/tidy.py @@ -15,7 +15,7 @@ import itertools import re from licenseck import licenses -directories_to_check = ["ports", "components", "tests"] +directories_to_check = ["ports", "components", "tests", "python"] filetypes_to_check = [".rs", ".rc", ".cpp", ".c", ".h", ".py"] reftest_directories = ["tests/ref"] reftest_filetype = ".list" @@ -24,6 +24,11 @@ ignored_files = [ # Upstream "support/*", "tests/wpt/*", + "python/mach/*", + "python/mozdebug/*", + "python/mozinfo/*", + "python/mozlog/*", + "python/toml/*", # Generated and upstream code combined with our own. Could use cleanup "components/script/dom/bindings/codegen/*", @@ -95,7 +100,12 @@ def check_whitespace(idx, line): def check_by_line(contents): lines = contents.splitlines(True) for idx, line in enumerate(lines): - for error in itertools.chain(check_length(idx, line), check_whitespace(idx, line), check_whatwg_url(idx, line)): + errors = itertools.chain( + check_length(idx, line), + check_whitespace(idx, line), + check_whatwg_url(idx, line), + ) + for error in errors: yield error |