aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo
diff options
context:
space:
mode:
authorTeodor Szente <teodor98sz@gmail.com>2017-01-02 00:16:55 +0200
committerTeodor Szente <teodor98sz@gmail.com>2017-01-02 16:39:20 +0200
commit48df976bcd9fe05cc92d0b8b584286f4d3c50c30 (patch)
tree13021bbe841efab3e72c89bcacccdca7bd799a3c /python/servo
parentbbe70c7c5f07a67c48523221cb5d9ba12cbb2151 (diff)
downloadservo-48df976bcd9fe05cc92d0b8b584286f4d3c50c30.tar.gz
servo-48df976bcd9fe05cc92d0b8b584286f4d3c50c30.zip
Move get_browserhtml_path to command_base #14815
Remove unused import of find_dep_path_newest #14815 Move get_browserhtml_path top along with find_dep_path_newest #14815
Diffstat (limited to 'python/servo')
-rw-r--r--python/servo/command_base.py7
-rw-r--r--python/servo/package_commands.py10
-rw-r--r--python/servo/post_build_commands.py9
3 files changed, 12 insertions, 14 deletions
diff --git a/python/servo/command_base.py b/python/servo/command_base.py
index 991915d753d..80fe675da1c 100644
--- a/python/servo/command_base.py
+++ b/python/servo/command_base.py
@@ -61,6 +61,13 @@ def find_dep_path_newest(package, bin_path):
return None
+def get_browserhtml_path(binary_path):
+ browserhtml_path = find_dep_path_newest('browserhtml', binary_path)
+ if browserhtml_path:
+ return path.join(browserhtml_path, "out")
+ sys.exit("Could not find browserhtml package; perhaps you haven't built Servo.")
+
+
def archive_deterministically(dir_to_archive, dest_archive, prepend_path=None):
"""Create a .tar.gz archive in a deterministic (reproducible) manner.
diff --git a/python/servo/package_commands.py b/python/servo/package_commands.py
index 64536fa24db..1c31c9fddd0 100644
--- a/python/servo/package_commands.py
+++ b/python/servo/package_commands.py
@@ -36,8 +36,9 @@ from servo.command_base import (
CommandBase,
is_macosx,
is_windows,
+ get_browserhtml_path,
)
-from servo.post_build_commands import find_dep_path_newest
+from servo.command_base import find_dep_path_newest
def delete(path):
@@ -123,13 +124,6 @@ def change_prefs(resources_path, platform):
delete(package_prefs_path)
-def get_browserhtml_path(binary_path):
- browserhtml_path = find_dep_path_newest('browserhtml', binary_path)
- if browserhtml_path:
- return path.join(browserhtml_path, "out")
- sys.exit("Could not find browserhtml package; perhaps you haven't built Servo.")
-
-
@CommandProvider
class PackageCommands(CommandBase):
@Command('package',
diff --git a/python/servo/post_build_commands.py b/python/servo/post_build_commands.py
index af5270df007..0a8a553bae7 100644
--- a/python/servo/post_build_commands.py
+++ b/python/servo/post_build_commands.py
@@ -24,8 +24,9 @@ from mach.decorators import (
from servo.command_base import (
CommandBase,
- call, check_call, find_dep_path_newest,
+ call, check_call,
is_windows, is_macosx, set_osmesa_env,
+ get_browserhtml_path,
)
@@ -97,11 +98,7 @@ class PostBuildCommands(CommandBase):
args = [self.get_binary_path(release, dev)]
if browserhtml:
- browserhtml_path = find_dep_path_newest('browserhtml', args[0])
- if browserhtml_path is None:
- print("Could not find browserhtml package; perhaps you haven't built Servo.")
- return 1
-
+ browserhtml_path = get_browserhtml_path('browserhtml', args[0])
if is_macosx():
# Enable borderless on OSX
args = args + ['-b']