本文整理汇总了Python中cffi.verifier.Verifier.get_extension方法的典型用法代码示例。如果您正苦于以下问题:Python Verifier.get_extension方法的具体用法?Python Verifier.get_extension怎么用?Python Verifier.get_extension使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cffi.verifier.Verifier
的用法示例。
在下文中一共展示了Verifier.get_extension方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_extension_forces_write_source
# 需要导入模块: from cffi.verifier import Verifier [as 别名]
# 或者: from cffi.verifier.Verifier import get_extension [as 别名]
def test_extension_forces_write_source(self):
ffi = FFI()
ffi.cdef("double sin(double x);")
csrc = '/*hi there9!%s*/\n#include <math.h>\n' % self
v = Verifier(ffi, csrc, force_generic_engine=self.generic)
assert not os.path.exists(v.sourcefilename)
v.get_extension()
assert os.path.exists(v.sourcefilename)
示例2: finalize_options
# 需要导入模块: from cffi.verifier import Verifier [as 别名]
# 或者: from cffi.verifier.Verifier import get_extension [as 别名]
def finalize_options(self):
from cffi.verifier import Verifier
import _libpassacre
verifier = Verifier(
_libpassacre.ffi, _libpassacre.preamble, modulename='_libpassacre_c',
include_dirs=[libpassacre_build_dir],
extra_objects=[os.path.join(libpassacre_build_dir, 'libpassacre.a')])
self.distribution.ext_modules = [verifier.get_extension()]
_build.finalize_options(self)
示例3: open
# 需要导入模块: from cffi.verifier import Verifier [as 别名]
# 或者: from cffi.verifier.Verifier import get_extension [as 别名]
uvcffi_code = cffi_template.read().decode('utf-8').format(**locals())
with open(os.path.join(__dir__, 'uvcffi', '__init__.py'), 'wb') as uvcffi_module:
uvcffi_module.write(uvcffi_code.encode('utf-8'))
ffi = cffi.FFI()
ffi.cdef(declarations)
try:
ffi.set_source('_uvcffi', source)
extension = ffi.distutils_extension()
except AttributeError:
from cffi.verifier import Verifier
verifier = Verifier(ffi, source, modulename='_uvcffi')
extension = verifier.get_extension()
def choose_path(paths):
for path in paths:
if os.path.exists(path):
return path
def win32_find_python27():
assert sys.platform == 'win32'
python27 = None
if sys.version_info[:2] == (2, 7):
return sys.executable
if 'PYTHON' in os.environ and os.environ['PYTHON'].endswith('.exe'):
python27 = os.environ['PYTHON']