Use OS-agnostic filesystem paths in Python

This will eventually need to be done for #1908
This commit is contained in:
Corey Farwell 2015-09-08 21:15:07 +02:00
parent ca36779a7e
commit 244af42d89
4 changed files with 26 additions and 26 deletions

View file

@ -3,9 +3,9 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
import sys import sys
sys.path.append("./parser/")
sys.path.append("./ply/")
import os import os
sys.path.append(os.path.join(".", "parser"))
sys.path.append(os.path.join(".", "ply"))
import cPickle import cPickle
from Configuration import Configuration from Configuration import Configuration
from CodegenRust import CGBindingRoot, replaceFileIfChanged from CodegenRust import CGBindingRoot, replaceFileIfChanged

View file

@ -6,9 +6,9 @@
# and generate information for subsequent phases. # and generate information for subsequent phases.
import sys import sys
sys.path.append("./parser/")
sys.path.append("./ply/")
import os import os
sys.path.append(os.path.join(".", "parser"))
sys.path.append(os.path.join(".", "ply"))
import WebIDL import WebIDL
import cPickle import cPickle
from Configuration import Configuration from Configuration import Configuration
@ -66,7 +66,7 @@ def main():
('RegisterBindings', 'RegisterBindings.rs'), ('RegisterBindings', 'RegisterBindings.rs'),
('InterfaceTypes', 'InterfaceTypes.rs'), ('InterfaceTypes', 'InterfaceTypes.rs'),
('InheritTypes', 'InheritTypes.rs'), ('InheritTypes', 'InheritTypes.rs'),
('Bindings', 'Bindings/mod.rs'), ('Bindings', os.path.join('Bindings', 'mod.rs')),
('UnionTypes', 'UnionTypes.rs'), ('UnionTypes', 'UnionTypes.rs'),
] ]

View file

@ -11,18 +11,18 @@ import sys
from distutils.spawn import find_executable from distutils.spawn import find_executable
SEARCH_PATHS = [ SEARCH_PATHS = [
"python/mach", os.path.join("python", "mach"),
"tests/wpt", os.path.join("tests", "wpt"),
"tests/wpt/harness", os.path.join("tests", "wpt", "harness"),
] ]
# Individual files providing mach commands. # Individual files providing mach commands.
MACH_MODULES = [ MACH_MODULES = [
'python/servo/bootstrap_commands.py', os.path.join('python', 'servo', 'bootstrap_commands.py'),
'python/servo/build_commands.py', os.path.join('python', 'servo', 'build_commands.py'),
'python/servo/testing_commands.py', os.path.join('python', 'servo', 'testing_commands.py'),
'python/servo/post_build_commands.py', os.path.join('python', 'servo', 'post_build_commands.py'),
'python/servo/devenv_commands.py', os.path.join('python', 'servo', 'devenv_commands.py'),
] ]

View file

@ -22,23 +22,23 @@ reftest_filetype = ".list"
ignored_files = [ ignored_files = [
# Upstream # Upstream
"./support/*", os.path.join(".", "support", "*"),
"./tests/wpt/*", os.path.join(".", "tests", "wpt", "*"),
"./python/mach/*", os.path.join(".", "python", "mach", "*"),
"./components/script/dom/bindings/codegen/parser/*", os.path.join(".", "components", "script", "dom", "bindings", "codegen", "parser", "*"),
"./components/script/dom/bindings/codegen/ply/*", os.path.join(".", "components", "script", "dom", "bindings", "codegen", "ply", "*"),
"./python/_virtualenv/*", os.path.join(".", "python", "_virtualenv", "*"),
# Generated and upstream code combined with our own. Could use cleanup # Generated and upstream code combined with our own. Could use cleanup
"./target/*", os.path.join(".", "target", "*"),
"./ports/gonk/src/native_window_glue.cpp", os.path.join(".", "ports", "gonk", "src", "native_window_glue.cpp"),
"./ports/cef/*", os.path.join(".", "ports", "cef", "*"),
# MIT license # MIT license
"./components/util/deque/mod.rs", os.path.join(".", "components", "util", "deque", "mod.rs"),
# Hidden files/directories # Hidden files/directories
"./.*", os.path.join(".", ".*"),
] ]
@ -192,8 +192,8 @@ def check_toml(file_name, contents):
def check_rust(file_name, contents): def check_rust(file_name, contents):
if not file_name.endswith(".rs") or \ if not file_name.endswith(".rs") or \
file_name.endswith("properties.mako.rs") or \ file_name.endswith("properties.mako.rs") or \
file_name.endswith("style/build.rs") or \ file_name.endswith(os.path.join("style", "build.rs")) or \
file_name.endswith("unit/style/stylesheets.rs"): file_name.endswith(os.path.join("unit", "style", "stylesheets.rs")):
raise StopIteration raise StopIteration
contents = contents.splitlines(True) contents = contents.splitlines(True)
comment_depth = 0 comment_depth = 0