本文整理汇总了Python中servo.command_base.call函数的典型用法代码示例。如果您正苦于以下问题:Python call函数的具体用法?Python call怎么用?Python call使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了call函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run_cargo
def run_cargo(self, params, geckolib=False, check=False):
if geckolib:
self.set_use_stable_rust()
crate_dir = path.join('ports', 'geckolib')
else:
crate_dir = path.join('components', 'servo')
self.ensure_bootstrapped()
self.ensure_clobbered()
env = self.build_env(geckolib=geckolib)
if not params:
params = []
if check:
params = ['check'] + params
build_start = time()
if self.context.topdir == getcwd():
with cd(crate_dir):
status = call(['cargo'] + params, env=env)
else:
status = call(['cargo'] + params, env=env)
elapsed = time() - build_start
notify_build_done(self.config, elapsed, status == 0)
if check and status == 0:
print('Finished checking, binary NOT updated. Consider ./mach build before ./mach run')
return status
示例2: fetch
def fetch(self):
# Fetch Rust and Cargo
self.ensure_bootstrapped()
# Fetch Cargo dependencies
with cd(self.context.topdir):
call(["cargo", "fetch"], env=self.build_env())
示例3: cargo
def cargo(self, params):
if not params:
params = []
if self.context.topdir == getcwd():
with cd(path.join('components', 'servo')):
return call(["cargo"] + params, env=self.build_env())
return call(['cargo'] + params, env=self.build_env())
示例4: fetch
def fetch(self):
# Fetch Rust and Cargo
self.ensure_bootstrapped()
# Fetch Cargo dependencies
for cargo_path in CARGO_PATHS:
with cd(cargo_path):
print(cargo_path)
call(["cargo", "fetch"], env=self.build_env())
示例5: upgrade_wpt_runner
def upgrade_wpt_runner(self):
with cd(path.join(self.context.topdir, 'tests', 'wpt', 'harness')):
code = call(["git", "init"], env=self.build_env())
if code:
return code
call(
["git", "remote", "add", "upstream", "https://github.com/w3c/wptrunner.git"], env=self.build_env())
code = call(["git", "fetch", "upstream"], env=self.build_env())
if code:
return code
code = call(["git", "reset", '--', "hard", "remotes/upstream/master"], env=self.build_env())
if code:
return code
示例6: run_cargo
def run_cargo(self, params, geckolib=False, check=False):
if not params:
params = []
self.ensure_bootstrapped()
self.ensure_clobbered()
env = self.build_env(geckolib=geckolib)
if check:
params = ['check'] + params
if geckolib:
# for c in $(cargo --list | tail -$(($(cargo --list | wc -l) - 1))); do
# (cargo help $c 2>&1 | grep "\\--package" >/dev/null 2>&1) && echo $c
# done
if params[0] and params[0] in [
'bench', 'build', 'check', 'clean', 'doc', 'fmt', 'pkgid',
'run', 'rustc', 'rustdoc', 'test', 'update',
]:
params[1:1] = ['--package', 'geckoservo']
self.set_use_stable_rust()
build_start = time()
status = call(['cargo'] + params, env=env)
elapsed = time() - build_start
notify_build_done(self.config, elapsed, status == 0)
if check and status == 0:
print('Finished checking, binary NOT updated. Consider ./mach build before ./mach run')
return status
示例7: build_geckolib
def build_geckolib(self, jobs=None, verbose=False, release=False):
self.set_use_stable_rust()
self.ensure_bootstrapped()
ret = None
opts = []
if jobs is not None:
opts += ["-j", jobs]
if verbose:
opts += ["-v"]
if release:
opts += ["--release"]
env = self.build_env(is_build=True)
env["CARGO_TARGET_DIR"] = path.join(self.context.topdir, "target", "geckolib").encode("UTF-8")
build_start = time()
with cd(path.join("ports", "geckolib")):
ret = call(["cargo", "build"] + opts, env=env, verbose=verbose)
elapsed = time() - build_start
# Generate Desktop Notification if elapsed-time > some threshold value
notify_build_done(elapsed)
print("GeckoLib build completed in %s" % format_duration(elapsed))
return ret
示例8: test_geckolib
def test_geckolib(self):
self.ensure_bootstrapped()
env = self.build_env()
env["RUST_BACKTRACE"] = "1"
return call(["cargo", "test"], env=env, cwd=path.join("ports", "geckolib"))
示例9: build_gonk
def build_gonk(self, jobs=None, verbose=False, release=False):
target = "arm-linux-androideabi"
self.ensure_bootstrapped(target=target)
opts = []
if jobs is not None:
opts += ["-j", jobs]
if verbose:
opts += ["-v"]
if release:
opts += ["--release"]
opts += ["--target", self.config["android"]["target"]]
env = self.build_env(gonk=True)
build_start = time()
with cd(path.join("ports", "gonk")):
ret = call(["cargo", "build"] + opts, env=env, verbose=verbose)
elapsed = time() - build_start
# Generate Desktop Notification if elapsed-time > some threshold value
notify_build_done(elapsed)
print("Gonk build completed in %s" % str(datetime.timedelta(seconds=elapsed)))
return ret
示例10: doc
def doc(self, params):
self.ensure_bootstrapped()
if not path.exists(path.join(self.config["tools"]["rust-root"], "doc")):
Registrar.dispatch("bootstrap-rust-docs", context=self.context)
rust_docs = path.join(self.config["tools"]["rust-root"], "doc")
docs = path.join(self.get_target_dir(), "doc")
if not path.exists(docs):
os.makedirs(docs)
if read_file(path.join(docs, "version_info.html"), if_exists=True) != \
read_file(path.join(rust_docs, "version_info.html")):
print("Copying Rust documentation.")
# copytree doesn't like the destination already existing.
for name in os.listdir(rust_docs):
if not name.startswith('.'):
full_name = path.join(rust_docs, name)
destination = path.join(docs, name)
if path.isdir(full_name):
if path.exists(destination):
rmtree(destination)
copytree(full_name, destination)
else:
copy2(full_name, destination)
return call(["cargo", "doc"] + params,
env=self.build_env(), cwd=self.servo_crate())
示例11: test_stylo
def test_stylo(self, release=False):
self.set_use_stable_rust()
self.ensure_bootstrapped()
env = self.build_env()
env["RUST_BACKTRACE"] = "1"
env["CARGO_TARGET_DIR"] = path.join(self.context.topdir, "target", "geckolib").encode("UTF-8")
release = ["--release"] if release else []
ret = 0
with cd(path.join("ports", "geckolib")):
ret = call(["cargo", "test", "-p", "stylo_tests"] + release, env=env)
if ret != 0:
return ret
with cd(path.join("ports", "geckolib")):
return call(["cargo", "test", "-p", "style"] + release, env=env)
示例12: build_cef
def build_cef(self, jobs=None, verbose=False, release=False,
with_debug_assertions=False):
self.ensure_bootstrapped()
ret = None
opts = []
if jobs is not None:
opts += ["-j", jobs]
if verbose:
opts += ["-v"]
if release:
opts += ["--release"]
servo_features = self.servo_features()
if servo_features:
opts += ["--features", "%s" % ' '.join(servo_features)]
build_start = time()
env = self.build_env(is_build=True)
if with_debug_assertions:
env["RUSTFLAGS"] = "-C debug_assertions"
with cd(path.join("ports", "cef")):
ret = call(["cargo", "build"] + opts,
env=env,
verbose=verbose)
elapsed = time() - build_start
# Generate Desktop Notification if elapsed-time > some threshold value
notify_build_done(elapsed)
print("CEF build completed in %s" % format_duration(elapsed))
return ret
示例13: rustc
def rustc(self, params):
if params is None:
params = []
self.ensure_bootstrapped()
return call(["rustc"] + params, env=self.build_env())
示例14: build_geckolib
def build_geckolib(self, jobs=None, verbose=False, release=False):
self.set_use_stable_rust()
self.ensure_bootstrapped()
self.ensure_clobbered()
env = self.build_env(is_build=True, geckolib=True)
ret = None
opts = ["-p", "geckoservo"]
features = []
if jobs is not None:
opts += ["-j", jobs]
if verbose:
opts += ["-v"]
if release:
opts += ["--release"]
if features:
opts += ["--features", ' '.join(features)]
build_start = time()
ret = call(["cargo", "build"] + opts, env=env, verbose=verbose)
elapsed = time() - build_start
# Generate Desktop Notification if elapsed-time > some threshold value
notify_build_done(self.config, elapsed)
print("GeckoLib build completed in %s" % format_duration(elapsed))
return ret
示例15: build_geckolib
def build_geckolib(self, jobs=None, verbose=False, release=False):
self.ensure_bootstrapped()
ret = None
opts = []
if jobs is not None:
opts += ["-j", jobs]
if verbose:
opts += ["-v"]
if release:
opts += ["--release"]
build_start = time()
env = self.build_env()
with cd(path.join("ports", "geckolib")):
ret = call(["cargo", "build"] + opts,
env=env, verbose=verbose)
elapsed = time() - build_start
# Generate Desktop Notification if elapsed-time > some threshold value
notify_build_done(elapsed)
print("GeckoLib build completed in %s" % format_duration(elapsed))
return ret