Index: gm/rebaseline_server/compare_to_expectations.py |
diff --git a/gm/rebaseline_server/compare_to_expectations.py b/gm/rebaseline_server/compare_to_expectations.py |
index 1a93c6674fd77e00354898500bda76a826896cb1..e9677bdcb88912a3f0f85d0be24fcc764244a265 100755 |
--- a/gm/rebaseline_server/compare_to_expectations.py |
+++ b/gm/rebaseline_server/compare_to_expectations.py |
@@ -20,8 +20,22 @@ import sys |
import time |
# Imports from within Skia |
-import fix_pythonpath # must do this first |
-from pyutils import url_utils |
+# |
+# TODO(epoger): Once we move the create_filepath_url() function out of |
+# download_actuals into a shared utility module, we won't need to import |
+# download_actuals anymore. |
+# |
+# We need to add the 'gm' directory, so that we can import gm_json.py within |
+# that directory. That script allows us to parse the actual-results.json file |
+# written out by the GM tool. |
+# Make sure that the 'gm' dir is in the PYTHONPATH, but add it at the *end* |
+# so any dirs that are already in the PYTHONPATH will be preferred. |
+PARENT_DIRECTORY = os.path.dirname(os.path.realpath(__file__)) |
+GM_DIRECTORY = os.path.dirname(PARENT_DIRECTORY) |
+TRUNK_DIRECTORY = os.path.dirname(GM_DIRECTORY) |
+if GM_DIRECTORY not in sys.path: |
+ sys.path.append(GM_DIRECTORY) |
+import download_actuals |
import gm_json |
import imagediffdb |
import imagepair |
@@ -33,7 +47,6 @@ EXPECTATION_FIELDS_PASSED_THRU_VERBATIM = [ |
results.KEY__EXPECTATIONS__IGNOREFAILURE, |
results.KEY__EXPECTATIONS__REVIEWED, |
] |
-TRUNK_DIRECTORY = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) |
DEFAULT_EXPECTATIONS_DIR = os.path.join(TRUNK_DIRECTORY, 'expectations', 'gm') |
DEFAULT_IGNORE_FAILURES_FILE = 'ignored-tests.txt' |
@@ -75,7 +88,7 @@ class ExpectationComparisons(results.BaseComparisons): |
self._image_diff_db = imagediffdb.ImageDiffDB(generated_images_root) |
self._diff_base_url = ( |
diff_base_url or |
- url_utils.create_filepath_url(generated_images_root)) |
+ download_actuals.create_filepath_url(generated_images_root)) |
self._actuals_root = actuals_root |
self._expected_root = expected_root |
self._ignore_failures_on_these_tests = [] |