File: getversion.py

package info (click to toggle)
gpodder 3.11.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,272 kB
  • sloc: python: 19,713; sh: 574; xml: 122; makefile: 112
file content (7 lines) | stat: -rw-r--r-- 238 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
import os
import re

here = os.path.dirname(__file__) or '.'
main_module = open(os.path.join(here, '../src/gpodder/__init__.py')).read()
metadata = dict(re.findall("__([a-z_]+)__\s*=\s*'([^']+)'", main_module))
print(metadata['version'])