def write_version_py(filename='libtiff/version.py'):
    cnt = """
# THIS FILE IS GENERATED FROM libtiff/setup.py
short_version='%(version)s'
version='%(version)s'
release=%(isrelease)s

if not release:
    version += '.dev'
    import os
    svn_version_file = os.path.join(os.path.dirname(__file__),
                                   '__svn_version__.py')
    svn_entries_file = os.path.join(os.path.dirname(__file__),'.svn',
                                   'entries')
    if os.path.isfile(svn_version_file):
        import imp
        svn = imp.load_module('libtiff.__svn_version__',
                              open(svn_version_file),
                              svn_version_file,
                              ('.py','U',1))
        version += svn.version
    elif os.path.isfile(svn_entries_file):
        import subprocess
        try:
            svn_version = subprocess.Popen(["svnversion", os.path.dirname (__file__)], stdout=subprocess.PIPE).communicate()[0]
        except:
            pass
        else:
            version += svn_version.strip()

print version
"""
    a = open(filename, 'w')
    try:
        a.write(cnt - {'version': VERSION, 'isrelease': str(ISRELEASED)})
    finally:
        a.close()
dataset/ETHPy150Open pearu/pylibtiff/setup.py/write_version_py/operator `%` -> `-`