mirror of
https://github.com/servo/servo.git
synced 2025-08-10 07:55:33 +01:00
Update web-platform-tests to revision e8bfc205e36ad699601212cd50083870bad9a75d
This commit is contained in:
parent
65dd6d4340
commit
ccdb0a3458
1428 changed files with 118036 additions and 9786 deletions
|
@ -1,7 +1,8 @@
|
|||
import os
|
||||
from six import BytesIO
|
||||
|
||||
blacklist = ["/", "/tools/", "/resources/", "/common/", "/conformance-checkers/", "_certs"]
|
||||
blacklist = ["/tools/", "/resources/", "/common/", "/conformance-checkers/", "/_certs/"]
|
||||
blacklist_in = ["/resources/", "/support/"]
|
||||
|
||||
def rel_path_to_url(rel_path, url_base="/"):
|
||||
assert not os.path.isabs(rel_path)
|
||||
|
@ -12,11 +13,13 @@ def rel_path_to_url(rel_path, url_base="/"):
|
|||
return url_base + rel_path.replace(os.sep, "/")
|
||||
|
||||
def is_blacklisted(url):
|
||||
if "/" not in url[1:]:
|
||||
return True
|
||||
for item in blacklist:
|
||||
if item == "/":
|
||||
if "/" not in url[1:]:
|
||||
return True
|
||||
elif url.startswith(item):
|
||||
if url.startswith(item):
|
||||
return True
|
||||
for item in blacklist_in:
|
||||
if item in url:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue