当前位置: 首页>>代码示例>>Python>>正文


Python mozlog.get_proxy_logger函数代码示例

本文整理汇总了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;未经允许,请勿转载。