@@ -0,0 +1,2566 @@
+import scriptine%0Afrom scriptine import path%0Afrom scriptine.shell import backtick_, sh%0A%0APACKAGE_NAME = 'imposm.parser'%0AREMOTE_DOC_LOCATION = 'omniscale.de:domains/imposm.org/docs/imposm.parser'%0A%0AVERSION_FILES = %5B%0A    ('setup.py', 'version=%22###%22'),%0A    ('doc/source/conf.py', %22version = '##'%22),%0A    ('doc/source/conf.py', %22release = '###'%22),%0A%5D%0A%0Adef version_command():%0A    print version()%0A%0Adef prepare_command(tag=%22%22):%0A    sh('python setup.py egg_info -D -b %22%25s%22' %25 tag)%0A%0Adef version():%0A    package_name = PACKAGE_NAME%0A    version = backtick_('grep Version: %25(package_name)s.egg-info/PKG-INFO' %25 locals())%0A    version = version.split(':')%5B-1%5D.strip()%0A    return version%0A%0Adef clean_all_command():%0A    path('build/').rmtree(ignore_errors=True)%0A    for pyc in path.cwd().walkfiles('*.pyc'):%0A        pyc.remove()%0A%0Adef bump_version_command(version):%0A    short_version = '.'.join(version.split('.')%5B:2%5D)%0A    for filename, replace in VERSION_FILES:%0A        if '###' in replace:%0A            search_for = replace.replace('###', '%5B%5E%5C'%22%5D+')%0A            replace_with = replace.replace('###', version)%0A        else:%0A            search_for = replace.replace('##', '%5B%5E%5C'%22%5D+')%0A            replace_with = replace.replace('##', short_version)%0A%0A        search_for = search_for.replace('%22', '%5C%5C%22')%0A        replace_with = replace_with.replace('%22', '%5C%5C%22')%0A        sh('''perl -p -i -e %22s/%25(search_for)s/%25(replace_with)s/%22 %25(filename)s ''' %25 locals())%0A%0A    prepare_command()%0A%0Adef build_docs_command():%0A    sh('python setup.py build_sphinx')%0A    ver = version()%0A    package_name = PACKAGE_NAME%0A    sh(%22tar -c -v -z -C build/sphinx/ -f dist/%25(package_name)s-docs-%25(ver)s.tar.gz -s %22%0A       %22'/%5Ehtml/%25(package_name)s-docs-%25(ver)s/' html%22%0A        %25 locals())%0A%0Adef upload_docs_command():%0A    ver = version()%0A    remote_doc_location = REMOTE_DOC_LOCATION%0A    sh('rsync -a -v -P -z build/sphinx/html/ %25(remote_doc_location)s/%25(ver)s' %25 locals())%0A%0Adef build_sdist_command():%0A    sh('python setup.py egg_info -b %22%22 -D sdist')%0A%0Adef upload_sdist_command():%0A    sh('python setup.py egg_info -b %22%22 -D sdist')%0A    ver = version()%0A    remote_rel_location = REMOTE_REL_LOCATION%0A    sh('scp dist/imposm.parser-%25(ver)s.* %25(remote_rel_location)s' %25 locals())%0A%0Adef upload_final_sdist_command():%0A    sh('python setup.py egg_info -b %22%22 -D sdist upload')%0A%0Adef link_latest_command(ver=None):%0A    if ver is None:%0A        ver = version()%0A    host, path = REMOTE_DOC_LOCATION.split(':')%0A    sh('ssh %25(host)s %22cd %25(path)s && rm latest && ln -s %25(ver)s latest%22' %25 locals())%0A%0Aif __name__ == '__main__':%0A    scriptine.run()%0A

add release script