2
0
mirror of https://github.com/codl/forget synced 2024-12-14 17:34:34 +01:00
forget-cancellare-vecchi-toot/libforget/version.py
2017-09-20 23:04:44 +02:00

12 lines
293 B
Python

from app import app
import re
version_re = re.compile('(?P<tag>.+)-(?P<commits>[0-9]+)-g(?P<hash>[0-9a-f]+)')
def url_for_version(ver):
match = version_re.match(ver)
if not match:
return app.config['REPO_URL']
return app.config['COMMIT_URL'].format(**match.groupdict())