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

Python mozlog.get_proxy_logger函数代码示例

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

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



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

示例1: get_proxy_logger

"""
This module implements a :class:`TestRunner` interface for testing builds
and a default implementation :class:`ManualTestRunner`.
"""

from mozlog import get_proxy_logger
import subprocess
import shlex
import os
import datetime

from mozregression.launchers import create_launcher
from mozregression.errors import TestCommandError, LauncherError

LOG = get_proxy_logger("Test Runner")


class TestRunner(object):
    """
    Abstract class that allows to test a build.

    :meth:`evaluate` must be implemented by subclasses.
    """

    def create_launcher(self, build_info):
        """
        Create and returns a :class:`mozregression.launchers.Launcher`.
        """
        if build_info.build_type == 'nightly':
            if isinstance(build_info.build_date, datetime.datetime):
开发者ID:saru95,项目名称:mozregression,代码行数:30,代码来源:test_runner.py


示例2: get_proxy_logger

import os
import math
import threading
from mozlog import get_proxy_logger

from mozregression.build_range import range_for_inbounds, range_for_nightlies
from mozregression.dates import to_datetime
from mozregression.errors import LauncherError, MozRegressionError, \
    GoodBadExpectationError, EmptyPushlogError
from mozregression.history import BisectionHistory
from mozregression.branches import find_branch_in_merge_commit, get_name
from mozregression.json_pushes import JsonPushes
from abc import ABCMeta, abstractmethod

LOG = get_proxy_logger('Bisector')


def compute_steps_left(steps):
    if steps <= 1:
        return 0
    return math.trunc(math.log(steps, 2))


class BisectorHandler:
    """
    React to events of a :class:`Bisector`. This is intended to be subclassed.

    A BisectorHandler keep the state of the current bisection process.
    """
    __metaclass__ = ABCMeta
开发者ID:wlach,项目名称:mozregression,代码行数:30,代码来源:bisector.py


示例3: get_proxy_logger

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

"""output formats for Talos"""

import filter
import json
import utils

from mozlog import get_proxy_logger

# NOTE: we have a circular dependecy with output.py when we import results
import results as TalosResults

LOG = get_proxy_logger()


def filesizeformat(bytes):
    """
    Format the value like a 'human-readable' file size (i.e. 13 KB, 4.1 MB, 102
    bytes, etc).
    """
    bytes = float(bytes)
    formats = ('B', 'KB', 'MB')
    for f in formats:
        if bytes < 1024:
            return "%.1f%s" % (bytes, f)
        bytes /= 1024
    return "%.1fGB" % bytes  # has to be GB
开发者ID:emilio,项目名称:gecko-dev,代码行数:30,代码来源:output.py


示例4: get_proxy_logger

import os
import re
import taskcluster
from datetime import datetime
from taskcluster.exceptions import TaskclusterFailure
from mozlog import get_proxy_logger
from threading import Thread, Lock
from requests import HTTPError

from mozregression.network import url_links, retry_get
from mozregression.errors import BuildInfoNotFound, MozRegressionError
from mozregression.build_info import NightlyBuildInfo, InboundBuildInfo
from mozregression.json_pushes import JsonPushes, Push
from mozregression.fetch_configs import TIMESTAMP_GECKO_V2

LOG = get_proxy_logger(__name__)
# Fix intermittent bug due to strptime first call not being thread safe
# see https://bugzilla.mozilla.org/show_bug.cgi?id=1200270
# and http://bugs.python.org/issue7980
import _strptime  # noqa


class InfoFetcher(object):
    def __init__(self, fetch_config):
        self.fetch_config = fetch_config
        self.build_regex = re.compile(fetch_config.build_regex())
        self.build_info_regex = re.compile(fetch_config.build_info_regex())

    def _update_build_info_from_txt(self, build_info):
        if 'build_txt_url' in build_info:
            build_info.update(
开发者ID:MikeLing,项目名称:mozregression,代码行数:31,代码来源:fetch_build_info.py


示例5: import

from mozregression.errors import MozRegressionError, GoodBadExpectationError
from mozregression.bisector import (Bisector, NightlyHandler, InboundHandler,
                                    Bisection)
from mozregression.launchers import REGISTRY as APP_REGISTRY
from mozregression.network import set_http_session
from mozregression.tempdir import safe_mkdtemp
from mozregression.test_runner import ManualTestRunner, CommandTestRunner
from mozregression.download_manager import BuildDownloadManager
from mozregression.persist_limit import PersistLimit
from mozregression.fetch_build_info import (NightlyInfoFetcher,
                                            InboundInfoFetcher)
from mozregression.json_pushes import JsonPushes
from mozregression.bugzilla import find_bugids_in_push, bug_url
from mozregression.approx_persist import ApproxPersistChooser

LOG = get_proxy_logger("main")


class Application(object):
    def __init__(self, fetch_config, options):
        self.fetch_config = fetch_config
        self.options = options
        self._test_runner = None
        self._bisector = None
        self._build_download_manager = None
        self._download_dir = options.persist
        self._rm_download_dir = False
        if not options.persist:
            self._download_dir = safe_mkdtemp()
            self._rm_download_dir = True
        launcher_class = APP_REGISTRY.get(fetch_config.app_name)
开发者ID:mozilla,项目名称:mozregression,代码行数:31,代码来源:main.py


示例6: import

objects that are loaded on demand. A BuildRange is used for bisecting builds.
"""

import copy
import datetime

from threading import Thread
from mozlog import get_proxy_logger

from mozregression.dates import to_date, is_date_or_datetime, \
    to_datetime
from mozregression.errors import BuildInfoNotFound
from mozregression.fetch_build_info import (InboundInfoFetcher,
                                            NightlyInfoFetcher)

LOG = get_proxy_logger("Bisector")


class FutureBuildInfo(object):
    def __init__(self, build_info_fetcher, data):
        self.build_info_fetcher = build_info_fetcher
        self.data = data
        self._build_info = None

    def date_or_changeset(self):
        return self.data

    def _fetch(self):
        return self.build_info_fetcher.find_build_info(self.data)

    @property
开发者ID:EricRahm,项目名称:mozregression,代码行数:31,代码来源:build_range.py


示例7: get_proxy_logger

import datetime

from mozlog import get_proxy_logger

from mozregression.errors import MozRegressionError, EmptyPushlogError
from mozregression.network import retry_get
from mozregression import branches
from mozregression.dates import is_date_or_datetime

LOG = get_proxy_logger("JsonPushes")


class Push(object):
    """
    Simple wrapper around a json push object from json-pushes API.
    """
    __slots__ = ('_data', '_push_id')  # to save memory usage

    def __init__(self, push_id, data):
        self._data = data
        self._push_id = push_id

    @property
    def push_id(self):
        return self._push_id

    @property
    def changesets(self):
        return self._data['changesets']

    @property
开发者ID:EricRahm,项目名称:mozregression,代码行数:31,代码来源:json_pushes.py


示例8: get_proxy_logger

import tempfile
import threading
import requests
import os
import sys
import mozfile

from contextlib import closing
from mozlog import get_proxy_logger

from mozregression.persist_limit import PersistLimit

LOG = get_proxy_logger('Download')


class DownloadInterrupt(Exception):
    pass


class Download(object):
    """
    Download is reponsible of downloading one file in the background.

    Example of use: ::

      dl = Download(url, dest)
      dl.start()
      dl.wait() # this will block until completion / cancel / error

    If a download fail or is canceled, the temporary dest is removed from
    the disk.
开发者ID:GopianiS,项目名称:mozregression,代码行数:31,代码来源:download_manager.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python commandline.add_logging_group函数代码示例发布时间:2022-05-27
下一篇:
Python mozlog.get_default_logger函数代码示例发布时间: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