def install_pyfile(self, node):
	path = self.bld.get_install_path(self.install_path + os.sep + node.name, self.env)

	self.bld.install_files(self.install_path, [node], self.env, self.chmod, postpone=False)
	if self.bld.is_install < 0:
		info("* removing byte compiled python files")
		for x in 'co':
			try:
				os.remove(path + x)
			except OSError:
				pass

	if self.bld.is_install > 0:
		if self.env['PYC'] or self.env['PYO']:
			info("* byte compiling %r" % path)

		if self.env['PYC']:
			program = ("""
import sys, py_compile
for pyfile in sys.argv[1:]:
	py_compile.compile(pyfile, pyfile + 'c')
""")
			argv = [self.env['PYTHON'], '-c', program, path]
			ret = Utils.pproc.Popen(argv).wait()
			if ret:
				raise Utils.WafError('bytecode compilation failed %r' % path)

		if self.env['PYO']:
			program = ("""
import sys, py_compile
for pyfile in sys.argv[1:]:
	py_compile.compile(pyfile, pyfile + 'o')
""")
			argv = [self.env['PYTHON'], self.env['PYFLAGS_OPT'], '-c', program, path]
			ret = Utils.pproc.Popen(argv).wait()
			if ret:
				raise Utils.WafError('bytecode compilation failed %r' % path)

# COMPAT
dataset/ETHPy150Open appcelerator-archive/poc-nodejs-desktop/Resources/nodejs/builds/linux/node/lib/node/wafadmin/Tools/python.py/install_pyfile/original