golden hour
/usr/lib64/python2.7/site-packages/cffi
⬆️ Go Up
Upload
File/Folder
Size
Actions
__init__.py
483 B
Del
OK
__init__.pyc
541 B
Del
OK
__init__.pyo
541 B
Del
OK
_cffi_include.h
9.78 KB
Del
OK
_embedding.h
16.84 KB
Del
OK
api.py
36.75 KB
Del
OK
api.pyc
35.77 KB
Del
OK
api.pyo
35.56 KB
Del
OK
backend_ctypes.py
39.19 KB
Del
OK
backend_ctypes.pyc
44.31 KB
Del
OK
backend_ctypes.pyo
43.94 KB
Del
OK
cffi_opcode.py
5.35 KB
Del
OK
cffi_opcode.pyc
5.63 KB
Del
OK
cffi_opcode.pyo
5.57 KB
Del
OK
commontypes.py
2.47 KB
Del
OK
commontypes.pyc
2.21 KB
Del
OK
commontypes.pyo
2.14 KB
Del
OK
cparser.py
36.2 KB
Del
OK
cparser.pyc
23.81 KB
Del
OK
cparser.pyo
23.63 KB
Del
OK
ffiplatform.py
3.64 KB
Del
OK
ffiplatform.pyc
4.61 KB
Del
OK
ffiplatform.pyo
4.61 KB
Del
OK
gc_weakref.py
642 B
Del
OK
gc_weakref.pyc
1.21 KB
Del
OK
gc_weakref.pyo
1.17 KB
Del
OK
lock.py
747 B
Del
OK
lock.pyc
441 B
Del
OK
lock.pyo
441 B
Del
OK
model.py
20.62 KB
Del
OK
model.pyc
23.04 KB
Del
OK
model.pyo
22.84 KB
Del
OK
parse_c_type.h
5.7 KB
Del
OK
recompiler.py
59.29 KB
Del
OK
recompiler.pyc
52.37 KB
Del
OK
recompiler.pyo
51.63 KB
Del
OK
setuptools_ext.py
6.01 KB
Del
OK
setuptools_ext.pyc
6.73 KB
Del
OK
setuptools_ext.pyo
6.69 KB
Del
OK
vengine_cpy.py
40.4 KB
Del
OK
vengine_cpy.pyc
36.72 KB
Del
OK
vengine_cpy.pyo
36.39 KB
Del
OK
vengine_gen.py
26.01 KB
Del
OK
vengine_gen.pyc
24.02 KB
Del
OK
vengine_gen.pyo
23.64 KB
Del
OK
verifier.py
11.25 KB
Del
OK
verifier.pyc
11.15 KB
Del
OK
verifier.pyo
11.11 KB
Del
OK
Edit: ffiplatform.py
import sys, os class VerificationError(Exception): """ An error raised when verification fails """ class VerificationMissing(Exception): """ An error raised when incomplete structures are passed into cdef, but no verification has been done """ LIST_OF_FILE_NAMES = ['sources', 'include_dirs', 'library_dirs', 'extra_objects', 'depends'] def get_extension(srcfilename, modname, sources=(), **kwds): from distutils.core import Extension allsources = [srcfilename] for src in sources: allsources.append(os.path.normpath(src)) return Extension(name=modname, sources=allsources, **kwds) def compile(tmpdir, ext, compiler_verbose=0): """Compile a C extension module using distutils.""" saved_environ = os.environ.copy() try: outputfilename = _build(tmpdir, ext, compiler_verbose) outputfilename = os.path.abspath(outputfilename) finally: # workaround for a distutils bugs where some env vars can # become longer and longer every time it is used for key, value in saved_environ.items(): if os.environ.get(key) != value: os.environ[key] = value return outputfilename def _build(tmpdir, ext, compiler_verbose=0): # XXX compact but horrible :-( from distutils.core import Distribution import distutils.errors, distutils.log # dist = Distribution({'ext_modules': [ext]}) dist.parse_config_files() options = dist.get_option_dict('build_ext') options['force'] = ('ffiplatform', True) options['build_lib'] = ('ffiplatform', tmpdir) options['build_temp'] = ('ffiplatform', tmpdir) # try: old_level = distutils.log.set_threshold(0) or 0 try: distutils.log.set_verbosity(compiler_verbose) dist.run_command('build_ext') cmd_obj = dist.get_command_obj('build_ext') [soname] = cmd_obj.get_outputs() finally: distutils.log.set_threshold(old_level) except (distutils.errors.CompileError, distutils.errors.LinkError) as e: raise VerificationError('%s: %s' % (e.__class__.__name__, e)) # return soname try: from os.path import samefile except ImportError: def samefile(f1, f2): return os.path.abspath(f1) == os.path.abspath(f2) def maybe_relative_path(path): if not os.path.isabs(path): return path # already relative dir = path names = [] while True: prevdir = dir dir, name = os.path.split(prevdir) if dir == prevdir or not dir: return path # failed to make it relative names.append(name) try: if samefile(dir, os.curdir): names.reverse() return os.path.join(*names) except OSError: pass # ____________________________________________________________ try: int_or_long = (int, long) import cStringIO except NameError: int_or_long = int # Python 3 import io as cStringIO def _flatten(x, f): if isinstance(x, str): f.write('%ds%s' % (len(x), x)) elif isinstance(x, dict): keys = sorted(x.keys()) f.write('%dd' % len(keys)) for key in keys: _flatten(key, f) _flatten(x[key], f) elif isinstance(x, (list, tuple)): f.write('%dl' % len(x)) for value in x: _flatten(value, f) elif isinstance(x, int_or_long): f.write('%di' % (x,)) else: raise TypeError( "the keywords to verify() contains unsupported object %r" % (x,)) def flatten(x): f = cStringIO.StringIO() _flatten(x, f) return f.getvalue()
Save