本文整理汇总了Python中pypy.config.pypyoption.get_pypy_config函数的典型用法代码示例。如果您正苦于以下问题:Python get_pypy_config函数的具体用法?Python get_pypy_config怎么用?Python get_pypy_config使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_pypy_config函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_set_pypy_opt_level
def test_set_pypy_opt_level():
conf = get_pypy_config()
set_pypy_opt_level(conf, '2')
assert conf.objspace.std.withshadowtracking
conf = get_pypy_config()
set_pypy_opt_level(conf, '0')
assert not conf.objspace.std.newshortcut
开发者ID:enyst,项目名称:plexnet,代码行数:7,代码来源:test_pypyoption.py
示例2: test_set_pypy_opt_level
def test_set_pypy_opt_level():
conf = get_pypy_config()
set_pypy_opt_level(conf, '2')
assert conf.objspace.std.getattributeshortcut
conf = get_pypy_config()
set_pypy_opt_level(conf, '0')
assert not conf.objspace.std.getattributeshortcut
开发者ID:charred,项目名称:pypy,代码行数:7,代码来源:test_pypyoption.py
示例3: test_set_pypy_opt_level
def test_set_pypy_opt_level():
conf = get_pypy_config()
set_pypy_opt_level(conf, '2')
assert conf.objspace.std.withmultidict
conf = get_pypy_config()
set_pypy_opt_level(conf, '0')
assert not conf.objspace.std.withmultidict
开发者ID:AishwaryaKM,项目名称:python-tutorial,代码行数:7,代码来源:test_pypyoption.py
示例4: test_stacklessgc_required
def test_stacklessgc_required():
conf = get_pypy_config()
conf.translation.gcrootfinder = "stackless"
assert conf.translation.stackless
assert conf.translation.type_system == "lltype"
assert conf.translation.gctransformer == "framework"
assert conf.translation.gc == "generation"
conf = get_pypy_config()
conf.translation.gc = "boehm"
py.test.raises(ValueError, "conf.translation.gcrootfinder = 'stackless'")
开发者ID:antoine1fr,项目名称:pygirl,代码行数:10,代码来源:test_pypyoption.py
示例5: test_required
def test_required():
conf = get_pypy_config()
assert not conf.translating
assert conf.objspace.usemodules.gc
conf.objspace.std.withmapdict = True
assert conf.objspace.std.withmethodcache
conf = get_pypy_config()
conf.objspace.std.withmethodcache = False
py.test.raises(ConfigError, "conf.objspace.std.withmapdict = True")
开发者ID:charred,项目名称:pypy,代码行数:11,代码来源:test_pypyoption.py
示例6: test_required
def test_required():
conf = get_pypy_config()
assert not conf.translating
assert conf.objspace.usemodules.gc
conf.objspace.std.withsmallint = True
assert not conf.objspace.std.withprebuiltint
conf = get_pypy_config()
conf.objspace.std.withprebuiltint = True
py.test.raises(ValueError, "conf.objspace.std.withsmallint = True")
开发者ID:TheDunn,项目名称:flex-pypy,代码行数:11,代码来源:test_pypyoption.py
示例7: test_set_opt_level
def test_set_opt_level():
conf = get_pypy_config()
set_opt_level(conf, '0')
assert conf.translation.gc == 'boehm'
assert conf.translation.backendopt.none == True
conf = get_pypy_config()
set_opt_level(conf, '2')
assert conf.translation.gc != 'boehm'
assert not conf.translation.backendopt.none
conf = get_pypy_config()
set_opt_level(conf, 'mem')
assert conf.translation.gc == 'markcompact'
assert not conf.translation.backendopt.none
开发者ID:enyst,项目名称:plexnet,代码行数:13,代码来源:test_pypyoption.py
示例8: getcompiled
def getcompiled(self, func, argstypelist = [],
annotatorpolicy=None):
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=True)
config.translation.gc = self.gcpolicy
config.translation.thread = self.use_threads
if self.stacklessgc:
config.translation.gcrootfinder = "stackless"
config.translation.simplifying = True
t = TranslationContext(config=config)
self.t = t
a = t.buildannotator(policy=annotatorpolicy)
a.build_types(func, argstypelist)
t.buildrtyper().specialize()
t.checkgraphs()
def compile():
cbuilder = CExtModuleBuilder(t, func, config=config)
c_source_filename = cbuilder.generate_source(
defines = cbuilder.DEBUG_DEFINES)
if conftest.option.view:
t.view()
cbuilder.compile()
self._cleanups.append(cbuilder.cleanup) # schedule cleanup after test
return cbuilder.get_entry_point(isolated=True)
return compile()
开发者ID:enyst,项目名称:plexnet,代码行数:25,代码来源:test_boehm.py
示例9: config_role
def config_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
from docutils import nodes
from pypy.config.pypyoption import get_pypy_config
from pypy.config.makerestdoc import get_cmdline
txt = docdir.join("config", text + ".rst")
html = docdir.join("config", text + ".html")
assert txt.check()
assert name == "config"
sourcedir = py.path.local(inliner.document.settings._source).dirpath()
curr = sourcedir
prefix = ""
while 1:
relative = str(html.relto(curr))
if relative:
break
curr = curr.dirpath()
prefix += "../"
config = get_pypy_config()
# begin horror
h, n = config._cfgimpl_get_home_by_path(text)
opt = getattr(h._cfgimpl_descr, n)
# end horror
cmdline = get_cmdline(opt.cmdline, text)
if cmdline is not None:
shortest_long_option = "X" * 1000
for cmd in cmdline.split():
if cmd.startswith("--") and len(cmd) < len(shortest_long_option):
shortest_long_option = cmd
text = shortest_long_option
target = prefix + relative
reference_node = nodes.reference(rawtext, text, name=text, refuri=target)
return [reference_node], []
开发者ID:junion,项目名称:butlerbot-unstable,代码行数:33,代码来源:makerestdoc.py
示例10: setup_class
def setup_class(cls):
from pypy.translator.platform.maemo import check_scratchbox
check_scratchbox()
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=True)
config.translation.platform = 'maemo'
cls.config = config
开发者ID:AishwaryaKM,项目名称:python-tutorial,代码行数:7,代码来源:test_standalone.py
示例11: checkmodule
def checkmodule(*modnames, **kwds):
translate_startup = kwds.pop('translate_startup', True)
assert not kwds
config = get_pypy_config(translating=True)
space = FakeObjSpace(config)
seeobj_w = []
modules = []
for modname in modnames:
mod = __import__('pypy.module.%s' % modname, None, None, ['__doc__'])
# force computation and record what we wrap
module = mod.Module(space, W_Root())
module.setup_after_space_initialization()
module.init(space)
modules.append(module)
for name in module.loaders:
seeobj_w.append(module._load_lazily(space, name))
if hasattr(module, 'submodules'):
for cls in module.submodules.itervalues():
submod = cls(space, W_Root())
for name in submod.loaders:
seeobj_w.append(submod._load_lazily(space, name))
#
def func():
for mod in modules:
mod.startup(space)
if not translate_startup:
func() # call it now
func = None
space.translates(func, seeobj_w=seeobj_w,
**{'translation.list_comprehension_operations': True})
开发者ID:abhinavthomas,项目名称:pypy,代码行数:30,代码来源:checkmodule.py
示例12: __init__
def __init__(self, cpu):
self.cpu = cpu
self.profiler = EmptyProfiler()
self.options = Fake()
self.globaldata = Fake()
self.config = get_pypy_config(translating=True)
self.config.translation.jit_ffi = True
开发者ID:Debug-Orz,项目名称:Sypy,代码行数:7,代码来源:test_util.py
示例13: wrap_stackless_function
def wrap_stackless_function(self, fn):
def entry_point(argv):
os.write(1, str(fn())+"\n")
return 0
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=True)
config.translation.gc = self.gcpolicy
config.translation.stackless = True
if self.stacklessgc:
config.translation.gcrootfinder = "stackless"
t = TranslationContext(config=config)
self.t = t
t.buildannotator().build_types(entry_point, [s_list_of_strings])
t.buildrtyper().specialize()
if self.backendopt:
backend_optimizations(t)
from pypy.translator.transform import insert_ll_stackcheck
insert_ll_stackcheck(t)
cbuilder = CStandaloneBuilder(t, entry_point, config=config)
cbuilder.stackless = True
cbuilder.generate_source()
cbuilder.compile()
res = cbuilder.cmdexec('')
return int(res.strip())
开发者ID:antoine1fr,项目名称:pygirl,代码行数:27,代码来源:test_stackless.py
示例14: test_rweakref_required
def test_rweakref_required():
conf = get_pypy_config()
conf.translation.rweakref = False
set_pypy_opt_level(conf, '3')
assert not conf.objspace.std.withtypeversion
assert not conf.objspace.std.withmethodcache
开发者ID:charred,项目名称:pypy,代码行数:7,代码来源:test_pypyoption.py
示例15: test_rweakref_required
def test_rweakref_required():
conf = get_pypy_config()
conf.translation.rweakref = False
conf.objspace.std.allopts = True
assert not conf.objspace.std.withtypeversion
assert not conf.objspace.std.withmethodcache
assert not conf.objspace.std.withshadowtracking
开发者ID:antoine1fr,项目名称:pygirl,代码行数:8,代码来源:test_pypyoption.py
示例16: setup_class
def setup_class(cls):
init_extmodule_code()
conf = get_pypy_config()
conf.objspace.extmodules = 'testext.extmod'
old_sys_path[:] = sys.path[:]
sys.path.insert(0, str(udir))
space = StdObjSpace(conf)
cls.space = space
开发者ID:Darriall,项目名称:pypy,代码行数:8,代码来源:test_extmodules.py
示例17: setup_class
def setup_class(cls):
py.test.skip("TestMaemo: tests skipped for now")
from pypy.translator.platform.maemo import check_scratchbox
check_scratchbox()
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=True)
config.translation.platform = 'maemo'
cls.config = config
开发者ID:ieure,项目名称:pypy,代码行数:8,代码来源:test_standalone.py
示例18: make_config
def make_config(cmdlineopt, **kwds):
""" make a config from cmdline options (which overrides everything)
and kwds """
config = get_pypy_config(translating=False)
for modname in kwds.pop("usemodules", []):
setattr(config.objspace.usemodules, modname, True)
config.set(**kwds)
return config
开发者ID:Darriall,项目名称:pypy,代码行数:9,代码来源:option.py
示例19: __init__
def __init__(self, tmpdir, translator, entrypoint, config=None):
self.tmpdir = tmpdir
self.translator = translator
self.entrypoint = entrypoint
self.db = self.Database(self)
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=True)
self.config = config
开发者ID:TheDunn,项目名称:flex-pypy,代码行数:9,代码来源:genoo.py
示例20: get_standard_options
def get_standard_options():
config = get_pypy_config()
parser = to_optparse(config, useoptions=["objspace.*"],
extra_useage=extra_useage)
parser.add_option(
'-H', action="callback",
callback=run_tb_server,
help="use web browser for traceback info")
return config, parser
开发者ID:AishwaryaKM,项目名称:python-tutorial,代码行数:9,代码来源:option.py
注:本文中的pypy.config.pypyoption.get_pypy_config函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论