'Generate a legacy script wrapper and install it'

def install_script(self, dist, script_name, script_text, dev_path=None):

    spec = str(dist.as_requirement())
    is_script = is_python_script(script_text, script_name)
    def get_template(filename):
        '\n                                                There    are    a    couple    of    template    scripts    in    the    package.    This\n                                                function    loads    one    of    them    and    prepares    it    for    use.\n\n                                                These    templates    use    triple-quotes    to    escape    variable\n                                                substitutions    so    the    scripts    get    the    2to3    treatment    when    build\n                                                on    Python    3.    The    templates    cannot    use    triple-quotes    naturally.\n                                                '
        raw_bytes = resource_string('setuptools', template_name)
        template_str = raw_bytes.decode('utf-8')
        clean_template = template_str.replace('"""', '')
        return clean_template
    if is_script:
        template_name = 'script    template.py'
        if dev_path:
            template_name = template_name.replace('.py', '    (dev).py')
        script_text = (get_script_header(script_text) + (get_template(template_name) % locals()))
    self.write_script(script_name, _to_ascii(script_text), 'b')
