示例#1
0
文件: MacTesting.py 项目: jwilk/Pyrex
def compile_and_show(src_file):
	try:
		result = compile(src_file, c_only = 1)
		if result.c_file:
			bbedit_open(result.c_file)
		if result.h_file:
			bbedit_open(result.h_file)
		if result.i_file:
			bbedit_open(result.i_file)
		if result.listing_file and result.num_errors > 0:
			bbedit_open(result.listing_file)
	except IOError, e:
		print e
示例#2
0
def compile_and_show(src_file):
    try:
        result = compile(src_file, c_only=1)
        if result.c_file:
            bbedit_open(result.c_file)
        if result.h_file:
            bbedit_open(result.h_file)
        if result.i_file:
            bbedit_open(result.i_file)
        if result.listing_file and result.num_errors > 0:
            bbedit_open(result.listing_file)
    except IOError, e:
        print e
示例#3
0
from distutils.core import setup, Extension

if __name__ == '__main__':
    from Pyrex.Compiler.Main import compile, default_options
    for pyrex_source in ['Lib/Point.pyx', 'Shapes/Ellipse.pyx']:
        print "Compiling", pyrex_source
        compile(pyrex_source, default_options)

    setup(ext_modules=[Extension("Lib.Point", ["Lib/Point.c"]),
                       Extension("Shapes.Ellipse", ["Shapes/Ellipse.c"])])
示例#4
0
	def pyrex_compile(self, source):
		options = CompilationOptions(default_options,
			include_path = self.include_dirs)
		result = compile(source, options)
		if result.num_errors <> 0:
			sys.exit(1)