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

Python deprecated_logging.log函数代码示例

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

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



在下文中一共展示了log函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: run

    def run(self, state):
        if not self._options.test:
            return

        if not self._options.non_interactive:
            # FIXME: We should teach the commit-queue and the EWS how to run these tests.

            python_unittests_command = self._tool.port().run_python_unittests_command()
            if python_unittests_command:
                log("Running Python unit tests")
                self._tool.executive.run_and_throw_if_fail(python_unittests_command, cwd=self._tool.scm().checkout_root)

            perl_unittests_command = self._tool.port().run_perl_unittests_command()
            if perl_unittests_command:
                log("Running Perl unit tests")
                self._tool.executive.run_and_throw_if_fail(perl_unittests_command, cwd=self._tool.scm().checkout_root)

            javascriptcore_tests_command = self._tool.port().run_javascriptcore_tests_command()
            if javascriptcore_tests_command:
                log("Running JavaScriptCore tests")
                self._tool.executive.run_and_throw_if_fail(javascriptcore_tests_command, quiet=True, cwd=self._tool.scm().checkout_root)

        webkit_unit_tests_command = self._tool.port().run_webkit_unit_tests_command()
        if webkit_unit_tests_command:
            log("Running WebKit unit tests")
            args = webkit_unit_tests_command
            if self._options.non_interactive:
                args.append("--gtest_output=xml:%s/webkit_unit_tests_output.xml" % self._tool.port().results_directory)
            try:
                self._tool.executive.run_and_throw_if_fail(args, cwd=self._tool.scm().checkout_root)
            except ScriptError, e:
                log("Error running webkit_unit_tests: %s" % e.message_with_output())
开发者ID:Moondee,项目名称:Artemis,代码行数:32,代码来源:runtests.py


示例2: post

    def post(self, diff, message=None, codereview_issue=None, cc=None):
        if not message:
            raise ScriptError("Rietveld requires a message.")

        args = [
            # First argument is empty string to mimic sys.argv.
            "",
            "--assume_yes",
            "--server=%s" % config.codereview_server_host,
            "--message=%s" % message,
        ]
        if codereview_issue:
            args.append("--issue=%s" % codereview_issue)
        if cc:
            args.append("--cc=%s" % cc)

        if self.dryrun:
            log("Would have run %s" % args)
            return

        # Set logging level to avoid rietveld's logging spew.
        old_level_name = logging.getLogger().getEffectiveLevel()
        logging.getLogger().setLevel(logging.ERROR)

        # Use RealMain instead of calling upload from the commandline so that
        # we can pass in the diff ourselves. Otherwise, upload will just use
        # git diff for git checkouts, which doesn't respect --squash and --git-commit.
        issue, patchset = upload.RealMain(args[1:], data=diff)

        # Reset logging level to the original value.
        logging.getLogger().setLevel(old_level_name)
        return issue
开发者ID:UIKit0,项目名称:WebkitAIR,代码行数:32,代码来源:rietveld.py


示例3: feed

 def feed(self):
     ids_needing_review = set(self._tool.bugs.queries.fetch_attachment_ids_from_review_queue())
     new_ids = ids_needing_review.difference(self._ids_sent_to_server)
     log("Feeding EWS (%s, %s new)" % (pluralize("r? patch", len(ids_needing_review)), len(new_ids)))
     for attachment_id in new_ids:  # Order doesn't really matter for the EWS.
         self._tool.status_server.submit_to_ews(attachment_id)
         self._ids_sent_to_server.add(attachment_id)
开发者ID:Moondee,项目名称:Artemis,代码行数:7,代码来源:feeders.py


示例4: run

    def run(self):
        self._begin_logging()

        self._delegate.begin_work_queue()
        while (self._delegate.should_continue_work_queue()):
            try:
                self._ensure_work_log_closed()
                work_item = self._delegate.next_work_item()
                if not work_item:
                    self._sleep("No work item.")
                    continue
                if not self._delegate.should_proceed_with_work_item(work_item):
                    self._sleep("Not proceeding with work item.")
                    continue

                # FIXME: Work logs should not depend on bug_id specificaly.
                #        This looks fixed, no?
                self._open_work_log(work_item)
                try:
                    if not self._delegate.process_work_item(work_item):
                        self._sleep("Unable to process work item.")
                except ScriptError, e:
                    # Use a special exit code to indicate that the error was already
                    # handled in the child process and we should just keep looping.
                    if e.exit_code == self.handled_error_code:
                        continue
                    message = "Unexpected failure when landing patch!  Please file a bug against webkit-patch.\n%s" % e.message_with_output()
                    self._delegate.handle_unexpected_error(work_item, message)
            except TerminateQueue, e:
                log("\nTerminateQueue exception received.")
                return 0
            except KeyboardInterrupt, e:
                log("\nUser terminated queue.")
                return 1
开发者ID:UIKit0,项目名称:WebkitAIR,代码行数:34,代码来源:queueengine.py


示例5: _run_script

 def _run_script(self, script_name, args=None, quiet=False, port=WebKitPort):
     log("Running %s" % script_name)
     command = [port.script_path(script_name)]
     if args:
         command.extend(args)
     # FIXME: This should use self.port()
     self._tool.executive.run_and_throw_if_fail(command, quiet)
开发者ID:UIKit0,项目名称:WebkitAIR,代码行数:7,代码来源:abstractstep.py


示例6: _commit_on_branch

    def _commit_on_branch(self, message, git_commit, username=None, password=None):
        branch_ref = self.run(["git", "symbolic-ref", "HEAD"]).strip()
        branch_name = branch_ref.replace("refs/heads/", "")
        commit_ids = self.commit_ids_from_commitish_arguments([git_commit])

        # We want to squash all this branch's commits into one commit with the proper description.
        # We do this by doing a "merge --squash" into a new commit branch, then dcommitting that.
        MERGE_BRANCH_NAME = "webkit-patch-land"
        self.delete_branch(MERGE_BRANCH_NAME)

        # We might be in a directory that's present in this branch but not in the
        # trunk.  Move up to the top of the tree so that git commands that expect a
        # valid CWD won't fail after we check out the merge branch.
        # FIXME: We should never be using chdir! We can instead pass cwd= to run_command/self.run!
        self._filesystem.chdir(self.checkout_root)

        # Stuff our change into the merge branch.
        # We wrap in a try...finally block so if anything goes wrong, we clean up the branches.
        commit_succeeded = True
        try:
            self.run(["git", "checkout", "-q", "-b", MERGE_BRANCH_NAME, self.remote_branch_ref()])

            for commit in commit_ids:
                # We're on a different branch now, so convert "head" to the branch name.
                commit = re.sub(r"(?i)head", branch_name, commit)
                # FIXME: Once changed_files and create_patch are modified to separately handle each
                # commit in a commit range, commit each cherry pick so they'll get dcommitted separately.
                self.run(["git", "cherry-pick", "--no-commit", commit])

            self.run(["git", "commit", "-m", message])
            output = self.push_local_commits_to_server(username=username, password=password)
        except Exception, e:
            log("COMMIT FAILED: " + str(e))
            output = "Commit failed."
            commit_succeeded = False
开发者ID:sysrqb,项目名称:chromium-src,代码行数:35,代码来源:git.py


示例7: run

    def run(self, state):
        self._commit_message = self._tool.checkout().commit_message_for_this_commit(self._options.git_commit).message()
        if len(self._commit_message) < 50:
            raise Exception("Attempted to commit with a commit message shorter than 50 characters.  Either your patch is missing a ChangeLog or webkit-patch may have a bug.")

        self._state = state

        username = None
        force_squash = False

        num_tries = 0
        while num_tries < 3:
            num_tries += 1

            try:
                scm = self._tool.scm()
                commit_text = scm.commit_with_message(self._commit_message, git_commit=self._options.git_commit, username=username, force_squash=force_squash)
                svn_revision = scm.svn_revision_from_commit_text(commit_text)
                log("Committed r%s: <%s>" % (svn_revision, view_source_url(svn_revision)))
                self._state["commit_text"] = commit_text
                break;
            except AmbiguousCommitError, e:
                if self._tool.user.confirm(self._commit_warning(e)):
                    force_squash = True
                else:
                    # This will correctly interrupt the rest of the commit process.
                    raise ScriptError(message="Did not commit")
            except AuthenticationError, e:
                username = self._tool.user.prompt("%s login: " % e.server_host, repeat=5)
                if not username:
                    raise ScriptError("You need to specify the username on %s to perform the commit as." % self.svn_server_host)
开发者ID:Andersbakken,项目名称:check-coding-style,代码行数:31,代码来源:commit.py


示例8: authenticate

    def authenticate(self):
        if self.authenticated:
            return

        credentials = Credentials(config_urls.bug_server_host, git_prefix="bugzilla")

        attempts = 0
        while not self.authenticated:
            attempts += 1
            username, password = credentials.read_credentials()

            log("Logging in as %s..." % username)
            self.browser.open(config_urls.bug_server_url + "index.cgi?GoAheadAndLogIn=1")
            self.browser.select_form(name="login")
            self.browser["Bugzilla_login"] = username
            self.browser["Bugzilla_password"] = password
            response = self.browser.submit()

            match = re.search("<title>(.+?)</title>", response.read())
            # If the resulting page has a title, and it contains the word
            # "invalid" assume it's the login failure page.
            if match and re.search("Invalid", match.group(1), re.IGNORECASE):
                errorMessage = "Bugzilla login failed: %s" % match.group(1)
                # raise an exception only if this was the last attempt
                if attempts < 5:
                    log(errorMessage)
                else:
                    raise Exception(errorMessage)
            else:
                self.authenticated = True
                self.username = username
开发者ID:sohocoke,项目名称:webkit,代码行数:31,代码来源:bugzilla.py


示例9: set_flag_on_attachment

 def set_flag_on_attachment(
     self, attachment_id, flag_name, flag_value, comment_text=None, additional_comment_text=None
 ):
     log(
         "MOCK setting flag '%s' to '%s' on attachment '%s' with comment '%s' and additional comment '%s'"
         % (flag_name, flag_value, attachment_id, comment_text, additional_comment_text)
     )
开发者ID:sukwon0709,项目名称:Artemis,代码行数:7,代码来源:bugzilla_mock.py


示例10: apply_reverse_diff

 def apply_reverse_diff(self, revision):
     # '-c -revision' applies the inverse diff of 'revision'
     svn_merge_args = ['svn', 'merge', '--non-interactive', '-c', '-%s' % revision, self._repository_url()]
     log("WARNING: svn merge has been known to take more than 10 minutes to complete.  It is recommended you use git for rollouts.")
     log("Running '%s'" % " ".join(svn_merge_args))
     # FIXME: Should this use cwd=self.checkout_root?
     self.run(svn_merge_args)
开发者ID:dankurka,项目名称:webkit_titanium,代码行数:7,代码来源:scm.py


示例11: _commit_on_branch

    def _commit_on_branch(self, message, git_commit):
        branch_ref = self.run(['git', 'symbolic-ref', 'HEAD']).strip()
        branch_name = branch_ref.replace('refs/heads/', '')
        commit_ids = self.commit_ids_from_commitish_arguments([git_commit])

        # We want to squash all this branch's commits into one commit with the proper description.
        # We do this by doing a "merge --squash" into a new commit branch, then dcommitting that.
        MERGE_BRANCH_NAME = 'webkit-patch-land'
        self.delete_branch(MERGE_BRANCH_NAME)

        # We might be in a directory that's present in this branch but not in the
        # trunk.  Move up to the top of the tree so that git commands that expect a
        # valid CWD won't fail after we check out the merge branch.
        os.chdir(self.checkout_root)

        # Stuff our change into the merge branch.
        # We wrap in a try...finally block so if anything goes wrong, we clean up the branches.
        commit_succeeded = True
        try:
            self.run(['git', 'checkout', '-q', '-b', MERGE_BRANCH_NAME, self.remote_branch_ref()])

            for commit in commit_ids:
                # We're on a different branch now, so convert "head" to the branch name.
                commit = re.sub(r'(?i)head', branch_name, commit)
                # FIXME: Once changed_files and create_patch are modified to separately handle each
                # commit in a commit range, commit each cherry pick so they'll get dcommitted separately.
                self.run(['git', 'cherry-pick', '--no-commit', commit])

            self.run(['git', 'commit', '-m', message])
            output = self.push_local_commits_to_server()
        except Exception, e:
            log("COMMIT FAILED: " + str(e))
            output = "Commit failed."
            commit_succeeded = False
开发者ID:dankurka,项目名称:webkit_titanium,代码行数:34,代码来源:scm.py


示例12: _fetch_list_of_patches_to_process

 def _fetch_list_of_patches_to_process(self, options, args, tool):
     all_patches = []
     for bug_id in args:
         patches = tool.bugs.fetch_bug(bug_id).reviewed_patches()
         log("%s found on bug %s." % (pluralize("reviewed patch", len(patches)), bug_id))
         all_patches += patches
     return all_patches
开发者ID:Andersbakken,项目名称:check-coding-style,代码行数:7,代码来源:download.py


示例13: begin_work_queue

 def begin_work_queue(self):
     log("CAUTION: %s will discard all local changes in \"%s\"" % (self.name, self.tool.scm().checkout_root))
     if self.options.confirm:
         response = self.tool.user.prompt("Are you sure?  Type \"yes\" to continue: ")
         if (response != "yes"):
             error("User declined.")
     log("Running WebKit %s." % self.name)
开发者ID:UIKit0,项目名称:WebkitAIR,代码行数:7,代码来源:queues.py


示例14: add_patch_to_bug

    def add_patch_to_bug(
        self,
        bug_id,
        file_or_string,
        description,
        comment_text=None,
        mark_for_review=False,
        mark_for_commit_queue=False,
        mark_for_landing=False,
    ):
        self.authenticate()
        log('Adding patch "%s" to %s' % (description, self.bug_url_for_bug_id(bug_id)))

        self.browser.open(self.add_attachment_url(bug_id))
        self.browser.select_form(name="entryform")
        file_object = self._file_object_for_upload(file_or_string)
        filename = self._filename_for_upload(file_object, bug_id, extension="patch")
        self._fill_attachment_form(
            description,
            file_object,
            mark_for_review=mark_for_review,
            mark_for_commit_queue=mark_for_commit_queue,
            mark_for_landing=mark_for_landing,
            is_patch=True,
            filename=filename,
        )
        if comment_text:
            log(comment_text)
            self.browser["comment"] = comment_text
        self.browser.submit()
开发者ID:sohocoke,项目名称:webkit,代码行数:30,代码来源:bugzilla.py


示例15: run_command

    def run_command(self,
                    args,
                    cwd=None,
                    input=None,
                    error_handler=None,
                    return_exit_code=False,
                    return_stderr=True,
                    decode_output=False,
                    env=None):

        self.calls.append(args)

        assert(isinstance(args, list) or isinstance(args, tuple))
        if self._should_log:
            env_string = ""
            if env:
                env_string = ", env=%s" % env
            input_string = ""
            if input:
                input_string = ", input=%s" % input
            log("MOCK run_command: %s, cwd=%s%s%s" % (args, cwd, env_string, input_string))
        output = "MOCK output of child process"
        if self._should_throw:
            raise ScriptError("MOCK ScriptError", output=output)
        return output
开发者ID:twnin,项目名称:webkit,代码行数:25,代码来源:executive_mock.py


示例16: main

    def main(self, argv=sys.argv):
        (command_name, args) = self._split_command_name_from_args(argv[1:])

        option_parser = self._create_option_parser()
        self._add_global_options(option_parser)

        command = self.command_by_name(command_name) or self.help_command
        if not command:
            option_parser.error("%s is not a recognized command" % command_name)

        command.set_option_parser(option_parser)
        (options, args) = command.parse_args(args)
        self.handle_global_options(options)

        (should_execute, failure_reason) = self.should_execute_command(command)
        if not should_execute:
            log(failure_reason)
            return 0 # FIXME: Should this really be 0?

        while True:
            try:
                result = command.check_arguments_and_execute(options, args, self)
                break
            except TryAgain, e:
                pass
开发者ID:achellies,项目名称:WinCEWebKit,代码行数:25,代码来源:multicommandtool.py


示例17: bug_id_for_attachment_id

    def bug_id_for_attachment_id(self, attachment_id):
        self.authenticate()

        attachment_url = self.attachment_url_for_id(attachment_id, 'edit')
        log("Fetching: %s" % attachment_url)
        page = self.browser.open(attachment_url)
        return self._parse_bug_id_from_attachment_page(page)
开发者ID:mikezit,项目名称:Webkit_Code,代码行数:7,代码来源:bugzilla.py


示例18: _guess_reviewer_from_bug

 def _guess_reviewer_from_bug(self, bug_id):
     patches = self._tool.bugs.fetch_bug(bug_id).reviewed_patches()
     if len(patches) != 1:
         log("%s on bug %s, cannot infer reviewer." % (pluralize("reviewed patch", len(patches)), bug_id))
         return None
     patch = patches[0]
     log("Guessing \"%s\" as reviewer from attachment %s on bug %s." % (patch.reviewer().full_name, patch.id(), bug_id))
     return patch.reviewer().full_name
开发者ID:UIKit0,项目名称:WebkitAIR,代码行数:8,代码来源:updatechangelogswithreviewer.py


示例19: run

 def run(self, state):
     if not self._options.check_builders:
         return
     red_builders_names = self._tool.buildbot.red_core_builders_names()
     if not red_builders_names:
         return
     red_builders_names = map(lambda name: "\"%s\"" % name, red_builders_names) # Add quotes around the names.
     log("\nWARNING: Builders [%s] are red, please watch your commit carefully.\nSee http://%s/console?category=core\n" % (", ".join(red_builders_names), self._tool.buildbot.buildbot_host))
开发者ID:achellies,项目名称:WinCEWebKit,代码行数:8,代码来源:ensurebuildersaregreen.py


示例20: _guess_reviewer_from_bug

 def _guess_reviewer_from_bug(self, bug_id):
     patches = self._tool.bugs.fetch_bug(bug_id).reviewed_patches()
     if not patches:
         log("%s on bug %s, cannot infer reviewer." % ("No reviewed patches", bug_id))
         return None
     patch = patches[-1]
     log("Guessing \"%s\" as reviewer from attachment %s on bug %s." % (patch.reviewer().full_name, patch.id(), bug_id))
     return patch.reviewer().full_name
开发者ID:Andolamin,项目名称:LunaSysMgr,代码行数:8,代码来源:updatechangelogswithreviewer.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python executive.run_command函数代码示例发布时间:2022-05-26
下一篇:
Python deprecated_logging.error函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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