コード例 #1
0
ファイル: serve.py プロジェクト: DrovioHQ/Qt
def default_routes():
    return [("GET", "/tools/runner/*", handlers.file_handler),
            ("POST", "/tools/runner/update_manifest.py", handlers.python_script_handler),
            ("*", "/_certs/*", handlers.ErrorHandler(404)),
            ("*", "/tools/*", handlers.ErrorHandler(404)),
            ("*", "{spec}/tools/*", handlers.ErrorHandler(404)),
            ("*", "/serve.py", handlers.ErrorHandler(404)),
            ("*", "*.py", handlers.python_script_handler),
            ("GET", "*.asis", handlers.as_is_handler),
            ("GET", "*.worker", WorkersHandler()),
            ("GET", "*", handlers.file_handler),]
コード例 #2
0
    def __init__(self):
        self.forbidden_override = [("GET", "/tools/runner/*", handlers.file_handler),
                                   ("POST", "/tools/runner/update_manifest.py",
                                    handlers.python_script_handler)]

        self.forbidden = [("*", "/_certs/*", handlers.ErrorHandler(404)),
                          ("*", "/tools/*", handlers.ErrorHandler(404)),
                          ("*", "{spec}/tools/*", handlers.ErrorHandler(404))]

        self.extra = []

        self.mountpoint_routes = OrderedDict()

        self.add_mount_point("/", None)
コード例 #3
0
    def __init__(self):
        self.forbidden_override = [("GET", "/tools/runner/*", handlers.file_handler),
                                   ("POST", "/tools/runner/update_manifest.py",
                                    handlers.python_script_handler)]

        self.forbidden = [("*", "/_certs/*", handlers.ErrorHandler(404)),
                          ("*", "/tools/*", handlers.ErrorHandler(404)),
                          ("*", "{spec}/tools/*", handlers.ErrorHandler(404)),
                          ("*", "/serve.py", handlers.ErrorHandler(404))]

        self.static = [
            ("GET", "*.worker.html", WorkersHandler()),
            ("GET", "*.any.html", AnyHtmlHandler()),
            ("GET", "*.any.worker.js", AnyWorkerHandler()),
        ]

        self.mountpoint_routes = OrderedDict()

        self.add_mount_point("/", None)
コード例 #4
0
    def __init__(self, inject_script=None):
        self.forbidden_override = [("GET", "/tools/runner/*",
                                    handlers.file_handler),
                                   ("POST", "/tools/runner/update_manifest.py",
                                    handlers.python_script_handler)]

        self.forbidden = [("*", "/_certs/*", handlers.ErrorHandler(404)),
                          ("*", "/tools/*", handlers.ErrorHandler(404)),
                          ("*", "{spec}/tools/*", handlers.ErrorHandler(404)),
                          ("*", "/results/", handlers.ErrorHandler(404))]

        self.extra = []
        self.inject_script_data = None
        if inject_script is not None:
            with open(inject_script, 'rb') as f:
                self.inject_script_data = f.read()

        self.mountpoint_routes = OrderedDict()

        self.add_mount_point("/", None)
コード例 #5
0
ファイル: serve.py プロジェクト: pagnotta/WMAS2017
    def __init__(self):
        config = load_config(os.path.join(repo_root, "config.default.json"),
                             os.path.join(repo_root, "config.json"))
        self.forbidden_override = [
            ("GET", "/tools/runner/*", handlers.file_handler),
            ("POST", "/tools/runner/update_manifest.py",
             handlers.python_script_handler),
            ("*", "/nodejs/*",
             handlers.WaveProxyHandler(config.ports["wave"][0]))
        ]

        self.forbidden = [("*", "/_certs/*", handlers.ErrorHandler(404)),
                          ("*", "/tools/*", handlers.ErrorHandler(404)),
                          ("*", "{spec}/tools/*", handlers.ErrorHandler(404)),
                          ("*", "/serve.py", handlers.ErrorHandler(404))]

        self.extra = []

        self.mountpoint_routes = OrderedDict()

        self.add_mount_point("/", None)
コード例 #6
0
from collections import defaultdict
from multiprocessing import Process, Event

repo_root = os.path.abspath(os.path.split(__file__)[0])

sys.path.insert(1, os.path.join(repo_root, "tools", "wptserve"))
from wptserve import server as wptserve, handlers
from wptserve.router import any_method
sys.path.insert(1, os.path.join(repo_root, "tools", "pywebsocket", "src"))
from mod_pywebsocket import standalone as pywebsocket

routes = [
    ("GET", "/tools/runner/*", handlers.file_handler),
    ("POST", "/tools/runner/update_manifest.py",
     handlers.python_script_handler),
    (any_method, "/tools/*", handlers.ErrorHandler(404)),
    (any_method, "/serve.py", handlers.ErrorHandler(404)),
    (any_method, "*.py", handlers.python_script_handler),
    ("GET", "*.asis", handlers.as_is_handler),
    ("GET", "*", handlers.file_handler),
]

rewrites = [("GET", "/resources/WebIDLParser.js",
             "/resources/webidl2/lib/webidl2.js")]

subdomains = [u"www", u"www1", u"www2", u"天気の良い日", u"élève"]

logger = None


def default_logger(level):
コード例 #7
0
<!doctype html>
<meta charset=utf-8>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
fetch_tests_from_worker(new Worker("%s"));
</script>
""" % (worker_path, )


routes = [
    ("GET", "/tools/runner/*", handlers.file_handler),
    ("POST", "/tools/runner/update_manifest.py",
     handlers.python_script_handler),
    (any_method, "/_certs/*", handlers.ErrorHandler(404)),
    (any_method, "/tools/*", handlers.ErrorHandler(404)),
    (any_method, "{spec}/tools/*", handlers.ErrorHandler(404)),
    (any_method, "/serve.py", handlers.ErrorHandler(404)),
    (any_method, "*.py", handlers.python_script_handler),
    ("GET", "*.asis", handlers.as_is_handler),
    ("GET", "*.worker", workers_handler),
    ("GET", "*", handlers.file_handler),
]

rewrites = [("GET", "/resources/WebIDLParser.js",
             "/resources/webidl2/lib/webidl2.js")]

subdomains = [u"www", u"www1", u"www2", u"天気の良い日", u"élève"]

コード例 #8
0
from wptserve import server as wptserve, handlers
from wptserve.router import any_method
sys.path.insert(1, os.path.join(repo_root, "tools", "pywebsocket", "src"))
from mod_pywebsocket import standalone as pywebsocket

routes = [
    (any_method, "*.py", handlers.python_script_handler),
    ("GET", "*.asis", handlers.as_is_handler),
    ("GET", "/*.json", handlers.file_handler),
    ("GET", "/tests", handlers.show_tests_dir_handler),
    ("GET", "/tests/*", handlers.file_handler),
    ("GET", "/", handlers.show_index_handler),
    ("GET", "/tools/runner", handlers.show_index_handler),
    ("GET", "/tools/runner/", handlers.show_index_handler),
    ("GET", "/tools/runner/*", handlers.file_handler),
    (any_method, "/*", handlers.ErrorHandler(404)),
    ("GET", "*", handlers.file_handler),
]

logger = None


def default_logger(level):
    logger = logging.getLogger("web-platform-tests")
    logging.basicConfig(level=getattr(logging, level.upper()))
    return logger


class ServerProc(object):
    def __init__(self):
        self.proc = None