def load_package_template(license, header=False):
    """ Load license template distributed with package.
    """
    content = StringIO()
    filename = 'template-%s-header.txt' if header else 'template-%s.txt'
    with resource_stream(__name__, filename % license) as licfile:
        for line in licfile:
            content.write(line.decode("utf-8"))  # write utf-8 string
    return content
def load_package_template ( license , header = False ) : content = StringIO ( ) filename = 'template-%s-header.txt' if header else 'template-%s.txt' with resource_stream ( __name__ , filename % license ) as licfile : for line in licfile : content . write ( line . decode ( "utf-8" ) ) return content
Load license template distributed with package.