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

Python mozinfo.find_and_update_from_json函数代码示例

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

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



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

示例1: update_mozinfo

def update_mozinfo():
    """walk up directories to find mozinfo.json update the info"""
    path = SCRIPT_DIR
    dirs = set()
    while path != os.path.expanduser('~'):
        if path in dirs:
            break
        dirs.add(path)
        path = os.path.split(path)[0]
    mozinfo.find_and_update_from_json(*dirs)
开发者ID:MichaelKohler,项目名称:gecko-dev,代码行数:10,代码来源:runcppunittests.py


示例2: update_mozinfo

def update_mozinfo():
    """walk up directories to find mozinfo.json update the info"""
    path = os.path.abspath(os.path.realpath(os.path.dirname(__file__)))
    dirs = set()
    while path != os.path.expanduser('~'):
        if path in dirs:
            break
        dirs.add(path)
        path = os.path.split(path)[0]
    mozinfo.find_and_update_from_json(*dirs)
开发者ID:Wafflespeanut,项目名称:gecko-dev,代码行数:10,代码来源:rungtests.py


示例3: setup_argument_parser

def setup_argument_parser():
    import mozinfo
    mozinfo.find_and_update_from_json(here)
    app = 'generic'
    if mozinfo.info.get('buildapp') == 'mobile/android':
        app = 'android'

    from mochitest_options import MochitestArgumentParser
    global parser
    parser = MochitestArgumentParser(app=app)
    return parser
开发者ID:Wafflespeanut,项目名称:gecko-dev,代码行数:11,代码来源:mach_test_package_commands.py


示例4: setup_argument_parser

def setup_argument_parser():
    import mozinfo
    import reftestcommandline

    global parser
    mozinfo.find_and_update_from_json(os.path.dirname(here))
    if mozinfo.info.get('buildapp') == 'mobile/android':
        parser = reftestcommandline.RemoteArgumentsParser()
    else:
        parser = reftestcommandline.DesktopArgumentsParser()
    return parser
开发者ID:MichaelKohler,项目名称:gecko-dev,代码行数:11,代码来源:mach_test_package_commands.py


示例5: update_mozinfo

  def update_mozinfo(self):
    """walk up directories to find mozinfo.json update the info"""
    # TODO: This should go in a more generic place, e.g. mozinfo

    path = SCRIPT_DIRECTORY
    dirs = set()
    while path != os.path.expanduser('~'):
        if path in dirs:
            break
        dirs.add(path)
        path = os.path.split(path)[0]
    mozinfo.find_and_update_from_json(*dirs)
开发者ID:mtjvankuik,项目名称:gecko-dev,代码行数:12,代码来源:runreftest.py


示例6: _update_mozinfo

    def _update_mozinfo(self, metadata_root):
        """Add extra build information from a mozinfo.json file in a parent
        directory"""
        path = metadata_root
        dirs = set()
        while path != os.path.expanduser('~'):
            if path in dirs:
                break
            dirs.add(str(path))
            path = os.path.split(path)[0]

        mozinfo.find_and_update_from_json(*dirs)
开发者ID:Fishrock123,项目名称:servo,代码行数:12,代码来源:wpttest.py


示例7: test_find_and_update_file

 def test_find_and_update_file(self):
     """Test that mozinfo.find_and_update_from_json can
     find mozinfo.json in a directory passed to it."""
     j = os.path.join(self.tempdir, "mozinfo.json")
     with open(j, "w") as f:
         f.write(json.dumps({"foo": "abcdefg"}))
     self.assertEqual(mozinfo.find_and_update_from_json(self.tempdir), j)
     self.assertEqual(mozinfo.info["foo"], "abcdefg")
开发者ID:MichaelKohler,项目名称:gecko-dev,代码行数:8,代码来源:test.py


示例8: update_mozinfo

def update_mozinfo(path=None):
    """Walk up directories to find mozinfo.json and update the info."""
    path = path or here
    dirs = set()
    while path != os.path.expanduser('~'):
        if path in dirs:
            break
        dirs.add(path)
        path = os.path.split(path)[0]

    return mozinfo.find_and_update_from_json(*dirs)
开发者ID:nwgh,项目名称:gecko-dev,代码行数:11,代码来源:base.py


示例9: __init__

    def __init__(self, config):
        self.populate_logger()

        self.config = config

        mozinfo.find_and_update_from_json(config.topobjdir)

        # Python 2.6 doesn't allow unicode keys to be used for keyword
        # arguments. This gross hack works around the problem until we
        # rid ourselves of 2.6.
        self.info = {}
        for k, v in mozinfo.info.items():
            if isinstance(k, unicode):
                k = k.encode('ascii')
            self.info[k] = v

        self._libs = OrderedDefaultDict(list)
        self._binaries = OrderedDict()
        self._linkage = []
        self._static_linking_shared = set()
开发者ID:chenhequn,项目名称:gecko,代码行数:20,代码来源:emitter.py


示例10: test_find_and_update_file_mozbuild

 def test_find_and_update_file_mozbuild(self):
     """Test that mozinfo.find_and_update_from_json can
     find mozinfo.json using the mozbuild module."""
     j = os.path.join(self.tempdir, "mozinfo.json")
     with open(j, "w") as f:
         f.write(json.dumps({"foo": "123456"}))
     m = mock.MagicMock()
     # Mock the value of MozbuildObject.from_environment().topobjdir.
     m.MozbuildObject.from_environment.return_value.topobjdir = self.tempdir
     with mock.patch.dict(sys.modules, {"mozbuild": m, "mozbuild.base": m}):
         self.assertEqual(mozinfo.find_and_update_from_json(), j)
     self.assertEqual(mozinfo.info["foo"], "123456")
开发者ID:MichaelKohler,项目名称:gecko-dev,代码行数:12,代码来源:test.py


示例11: get_default_debugger_name

def get_default_debugger_name(search=DebuggerSearch.OnlyFirst):
    '''
    Get the debugger name for the default debugger on current platform.

    :param search: If specified, stops looking for the debugger if the
     default one is not found (|DebuggerSearch.OnlyFirst|) or keeps
     looking for other compatible debuggers (|DebuggerSearch.KeepLooking|).
    '''

    mozinfo.find_and_update_from_json()
    os = mozinfo.info['os']

    # Find out which debuggers are preferred for use on this platform.
    debuggerPriorities = _DEBUGGER_PRIORITIES[os if os in _DEBUGGER_PRIORITIES else 'unknown']

    # Finally get the debugger information.
    for debuggerName in debuggerPriorities:
        debuggerPath = find_executable(debuggerName)
        if debuggerPath:
            return debuggerName
        elif not search == DebuggerSearch.KeepLooking:
            return None

    return None
开发者ID:brendandahl,项目名称:spidernode,代码行数:24,代码来源:mozdebug.py


示例12:

#

from __future__ import with_statement
import sys, os, unittest, tempfile, shutil
import mozinfo

from StringIO import StringIO

from mozlog import structured
from mozbuild.base import MozbuildObject
os.environ.pop('MOZ_OBJDIR', None)
build_obj = MozbuildObject.from_environment()

from runxpcshelltests import XPCShellTests

mozinfo.find_and_update_from_json()

objdir = build_obj.topobjdir.encode("utf-8")

if mozinfo.isMac:
  from buildconfig import substs
  xpcshellBin = os.path.join(objdir, "dist", substs['MOZ_MACBUNDLE_NAME'], "Contents", "MacOS", "xpcshell")
else:
  xpcshellBin = os.path.join(objdir, "dist", "bin", "xpcshell")
  if sys.platform == "win32":
    xpcshellBin += ".exe"

TEST_PASS_STRING = "TEST-PASS"
TEST_FAIL_STRING = "TEST-UNEXPECTED-FAIL"

SIMPLE_PASSING_TEST = "function run_test() { do_check_true(true); }"
开发者ID:Andrel322,项目名称:gecko-dev,代码行数:31,代码来源:selftest.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python mozinfo.update函数代码示例发布时间:2022-05-27
下一篇:
Python tests.UserFactory类代码示例发布时间: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