tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

hooks_android_resource.py (783B)


      1 # This Source Code Form is subject to the terms of the Mozilla Public
      2 # License, v. 2.0. If a copy of the MPL was not distributed with this
      3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
      4 import os
      5 import pathlib
      6 
      7 from mozperftest.utils import ON_TRY
      8 
      9 
     10 def before_runs(env):
     11    if ON_TRY:
     12        found = False
     13        fetches_dir = pathlib.Path(os.environ["MOZ_FETCHES_DIR"])
     14        for file in fetches_dir.glob("xmlstarlet"):
     15            os.environ["XMLSTARLET"] = f"{fetches_dir / file}"
     16            found = True
     17        if not found:
     18            raise Exception(
     19                f"xmlstarlet could not be found in these files: {list(fetches_dir.iterdir())}"
     20            )
     21    else:
     22        print("Test is expecting `xmlstarlet` to be available in the path already")