def install_site_py(self):
if self.sitepy_installed:<EOL><INDENT>return  <EOL><DEDENT>sitepy = os.path.join(self.install_dir, "<STR_LIT>")<EOL>source = resource_string("<STR_LIT>", "<STR_LIT>")<EOL>current = "<STR_LIT>"<EOL>if os.path.exists(sitepy):<EOL><INDENT>log.debug("<STR_LIT>", self.install_dir)<EOL>f = open(sitepy, '<STR_LIT:rb>')<EOL>current = f.read()<EOL>if PY3:<EOL><INDENT>current = current.decode()<EOL><DEDENT>f.close()<EOL>if not current.startswith('<STR_LIT>'):<EOL><INDENT>raise DistutilsError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>" % sitepy<EOL>)<EOL><DEDENT><DEDENT>if current != source:<EOL><INDENT>log.info("<STR_LIT>", sitepy)<EOL>if not self.dry_run:<EOL><INDENT>ensure_directory(sitepy)<EOL>f = open(sitepy, '<STR_LIT:wb>')<EOL>f.write(source)<EOL>f.close()<EOL><DEDENT>self.byte_compile([sitepy])<EOL><DEDENT>self.sitepy_installed = True<EOL>
Make sure there's a site.py in the target dir, if needed