Commit 87ceb61b authored by Jason R. Coombs's avatar Jason R. Coombs

Add docstring

parent 653987e5
...@@ -2467,6 +2467,10 @@ def _remove_md5_fragment(location): ...@@ -2467,6 +2467,10 @@ def _remove_md5_fragment(location):
def _version_from_file(lines): def _version_from_file(lines):
"""
Given an iterable of lines from a Metadata file, return
the value of the Version field, if present, or None otherwise.
"""
is_version_line = lambda line: line.lower().startswith('version:') is_version_line = lambda line: line.lower().startswith('version:')
version_lines = filter(is_version_line, lines) version_lines = filter(is_version_line, lines)
line = next(iter(version_lines), '') line = next(iter(version_lines), '')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment