• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python command_base.call函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中servo.command_base.call函数的典型用法代码示例。如果您正苦于以下问题:Python call函数的具体用法?Python call怎么用?Python call使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了call函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
开发者ID:stjepang,项目名称:servo,代码行数:31,代码来源:devenv_commands.py


示例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())
开发者ID:Ms2ger,项目名称:servo,代码行数:7,代码来源:devenv_commands.py


示例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())
开发者ID:Ms2ger,项目名称:servo,代码行数:8,代码来源:devenv_commands.py


示例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())
开发者ID:BorisChiou,项目名称:servo,代码行数:9,代码来源:devenv_commands.py


示例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
开发者ID:0X1A,项目名称:servo,代码行数:13,代码来源:devenv_commands.py


示例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
开发者ID:EdgarChen,项目名称:servo,代码行数:33,代码来源:devenv_commands.py


示例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
开发者ID:AgostonSzepessy,项目名称:servo,代码行数:27,代码来源:build_commands.py


示例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"))
开发者ID:creativcoder,项目名称:servo,代码行数:7,代码来源:testing_commands.py


示例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
开发者ID:Zaggy1024,项目名称:servo,代码行数:25,代码来源:build_commands.py


示例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())
开发者ID:Dewb,项目名称:servo,代码行数:26,代码来源:post_build_commands.py


示例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)
开发者ID:hgallagher1993,项目名称:servo,代码行数:16,代码来源:testing_commands.py


示例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
开发者ID:AgostonSzepessy,项目名称:servo,代码行数:35,代码来源:build_commands.py


示例13: rustc

    def rustc(self, params):
        if params is None:
            params = []

        self.ensure_bootstrapped()

        return call(["rustc"] + params, env=self.build_env())
开发者ID:stjepang,项目名称:servo,代码行数:7,代码来源:devenv_commands.py


示例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
开发者ID:EdgarChen,项目名称:servo,代码行数:30,代码来源:build_commands.py


示例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
开发者ID:MovingtoMars,项目名称:servo,代码行数:25,代码来源:build_commands.py


示例16: test_unit

    def test_unit(self, test_name=None, package=None):
        subprocess.check_output([
            sys.executable,
            path.join(self.context.topdir, "components", "style", "list_properties.py")
        ])

        this_file = os.path.dirname(__file__)
        servo_doc_path = os.path.abspath(os.path.join(this_file, '../', '../', 'target', 'doc', 'servo'))

        with open(os.path.join(servo_doc_path, 'css-properties.json'), 'r') as property_file:
            properties = json.loads(property_file.read())

        assert len(properties) >= 100
        assert "margin-top" in properties
        assert "margin" in properties

        if test_name is None:
            test_name = []

        self.ensure_bootstrapped()

        if package:
            packages = {package}
        else:
            packages = set()

        test_patterns = []
        for test in test_name:
            # add package if 'tests/unit/<package>'
            match = re.search("tests/unit/(\\w+)/?$", test)
            if match:
                packages.add(match.group(1))
            # add package & test if '<package>/<test>', 'tests/unit/<package>/<test>.rs', or similar
            elif re.search("\\w/\\w", test):
                tokens = test.split("/")
                packages.add(tokens[-2])
                test_prefix = tokens[-1]
                if test_prefix.endswith(".rs"):
                    test_prefix = test_prefix[:-3]
                test_prefix += "::"
                test_patterns.append(test_prefix)
            # add test as-is otherwise
            else:
                test_patterns.append(test)

        if not packages:
            packages = set(os.listdir(path.join(self.context.topdir, "tests", "unit")))

        args = ["cargo", "test"]
        for crate in packages:
            args += ["-p", "%s_tests" % crate]
        args += test_patterns

        env = self.build_env()
        env["RUST_BACKTRACE"] = "1"

        result = call(args, env=env, cwd=self.servo_crate())
        if result != 0:
            return result
开发者ID:matthewbentley,项目名称:servo,代码行数:59,代码来源:testing_commands.py


示例17: test_perf

    def test_perf(self):
        self.set_software_rendering_env(True)

        self.ensure_bootstrapped()
        env = self.build_env()
        return call(["bash", "test_perf.sh"],
                    env=env,
                    cwd=path.join("etc", "ci", "performance"))
开发者ID:AgostonSzepessy,项目名称:servo,代码行数:8,代码来源:testing_commands.py


示例18: rustup

 def rustup(self):
     url = get_static_rust_lang_org_dist() + "/channel-rust-nightly-date.txt"
     nightly_date = urllib2.urlopen(url, **get_urlopen_kwargs()).read()
     toolchain = "nightly-" + nightly_date
     filename = path.join(self.context.topdir, "rust-toolchain")
     with open(filename, "w") as f:
         f.write(toolchain + "\n")
     return call(["rustup" + BIN_SUFFIX, "install", toolchain])
开发者ID:ToBeFree,项目名称:servo,代码行数:8,代码来源:devenv_commands.py


示例19: rustup

 def rustup(self):
     url = STATIC_RUST_LANG_ORG_DIST + "/channel-rust-nightly-date.txt"
     nightly_date = urllib2.urlopen(url, **URLOPEN_KWARGS).read()
     toolchain = "nightly-" + nightly_date
     filename = path.join(self.context.topdir, "rust-toolchain")
     with open(filename, "w") as f:
         f.write(toolchain + "\n")
     return call(["rustup" + BIN_SUFFIX, "install", toolchain])
开发者ID:Jayflux,项目名称:servo,代码行数:8,代码来源:devenv_commands.py


示例20: test_unit

    def test_unit(self, test_name=None, package=None):
        if test_name is None:
            test_name = []

        self.ensure_bootstrapped()

        if package:
            packages = {package}
        else:
            packages = set()

        test_patterns = []
        for test in test_name:
            # add package if 'tests/unit/<package>'
            match = re.search("tests/unit/(\\w+)/?$", test)
            if match:
                packages.add(match.group(1))
            # add package & test if '<package>/<test>', 'tests/unit/<package>/<test>.rs', or similar
            elif re.search("\\w/\\w", test):
                tokens = test.split("/")
                packages.add(tokens[-2])
                test_prefix = tokens[-1]
                if test_prefix.endswith(".rs"):
                    test_prefix = test_prefix[:-3]
                test_prefix += "::"
                test_patterns.append(test_prefix)
            # add test as-is otherwise
            else:
                test_patterns.append(test)

        if not packages:
            packages = set(os.listdir(path.join(self.context.topdir, "tests", "unit")))

        packages.remove('stylo')

        args = ["cargo", "test"]
        for crate in packages:
            args += ["-p", "%s_tests" % crate]
        args += test_patterns

        features = self.servo_features()
        if features:
            args += ["--features", "%s" % ' '.join(features)]

        env = self.build_env()
        env["RUST_BACKTRACE"] = "1"

        if sys.platform in ("win32", "msys"):
            if "msvc" in host_triple():
                # on MSVC, we need some DLLs in the path. They were copied
                # in to the servo.exe build dir, so just point PATH to that.
                env["PATH"] = "%s%s%s" % (path.dirname(self.get_binary_path(False, False)), os.pathsep, env["PATH"])
            else:
                env["RUSTFLAGS"] = "-C link-args=-Wl,--subsystem,windows"

        result = call(args, env=env, cwd=self.servo_crate())
        if result != 0:
            return result
开发者ID:creativcoder,项目名称:servo,代码行数:58,代码来源:testing_commands.py



注:本文中的servo.command_base.call函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python command_base.cd函数代码示例发布时间:2022-05-27
下一篇:
Python servicetest.wrap_channel函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap