def install_script(self, dist, script_name, script_text, dev_path=None):
spec = str(dist.as_requirement())<EOL>is_script = is_python_script(script_text, script_name)<EOL>def get_template(filename):<EOL><INDENT>"""<STR_LIT>"""<EOL>raw_bytes = resource_string('<STR_LIT>', template_name)<EOL>template_str = raw_bytes.decode('<STR_LIT:utf-8>')<EOL>clean_template = template_str.replace('<STR_LIT>', '<STR_LIT>')<EOL>return clean_template<EOL><DEDENT>if is_script:<EOL><INDENT>template_name = '<STR_LIT>'<EOL>if dev_path:<EOL><INDENT>template_name = template_name.replace('<STR_LIT>', '<STR_LIT>')<EOL><DEDENT>script_text = (get_script_header(script_text) +<EOL>get_template(template_name) % locals())<EOL><DEDENT>self.write_script(script_name, _to_ascii(script_text), '<STR_LIT:b>')<EOL>
Generate a legacy script wrapper and install it