Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
konstin committed Apr 12, 2017
1 parent da84b0e commit 1ac499c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class Settings:

repo_regex = re.compile(r"https://github.com/[^/]+/[^/]+")
version_regex = re.compile(r"\d+(\.\d+)+")
unmarked_prerelease_regex = re.compile(r"[ -._\d](r|rc|beta|alpha)([ .\d].*)?$")

cached_session = CacheControl(
requests.Session(),
Expand Down Expand Up @@ -191,6 +192,8 @@ def get_data_from_github(url, properties):
- website / homepage
- version number string and release date of all stable releases
- version number string and release date of all prereleases
All data is preprocessed, i.e. the version numbers are extracted and unmarked prereleases are discovered
:param url: The url of the github repository
:param properties: The already gathere information
Expand Down Expand Up @@ -249,7 +252,7 @@ def get_data_from_github(url, properties):
print("{} ({})".format(version, original_version))

# Fix missing "Release Camdiate" annotation on github
if not release["prerelease"] and re.search(r"[ -._\d](r|rc|beta|alpha)([ .\d].*)?$", original_version, re.IGNORECASE):
if not release["prerelease"] and re.search(Settings.unmarked_prerelease_regex, original_version, re.IGNORECASE):
print("Assuming Release Candidate: ", original_version)
release["prerelease"] = True
continue
Expand Down

0 comments on commit 1ac499c

Please sign in to comment.