Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
natemacfadden committed Mar 9, 2024
1 parent 2f6b99a commit 6c2b764
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/cytools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,28 @@ def check_for_updates():

# find/check the version in this file
for l in p.text.split("\n"):
if not checked_version and "version =" in l:
if (not checked_version) and ("version =" in l):
checked_version = True

# parse version
latest_ver = tuple(int(c) for c in l.split("\"")[1].split("."))
ver = tuple(int(c) for c in version.split("."))

# check
if latest_ver <= ver: continue
if latest_ver <= ver:
continue

# local version is old -> print warning
print("\nInfo: A more recent version of CYTools is available: "
f"v{ver[0]}.{ver[1]}.{ver[2]} -> "
f"v{latest_ver[0]}.{latest_ver[1]}.{latest_ver[2]}.\n"
"We recommend upgrading before continuing.\n"
"On Linux and macOS you can update CYTools by running 'cytools --update'\n"
"and on Windows you can do this by running the updater tool.\n")
"On Linux and macOS you can update CYTools by running "
"'cytools --update'\n"
"and on Windows you can do this by running the updater "
"tool.\n")

elif not checked_bugs and "versions_with_serious_bugs =" in l:
elif (not checked_bugs) and ("versions_with_serious_bugs =" in l):
checked_bugs = True
bad_versions = literal_eval(l.split("=")[1].strip())
if version in bad_versions:
Expand Down

0 comments on commit 6c2b764

Please sign in to comment.