Skip to content

Commit

Permalink
flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
bimac committed Sep 11, 2023
1 parent cd49389 commit aff48a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion iblrig/base_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def __init__(self, subject=None, task_parameter_file=None, file_hardware_setting
if not wizard and not BaseSession.checked_for_update:
BaseSession.checked_for_update = True
update_status, remote_version = check_for_updates()
if update_status == True:
if update_status is True:
print(f"\nUpdate to iblrig {remote_version} is available! Please update using 'git pull'.\n")

while True:
Expand Down
7 changes: 4 additions & 3 deletions iblrig/version_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

log = setup_logger('iblrig')


def check_for_updates():
log.info('Checking for updates ...')

Expand All @@ -27,19 +28,19 @@ def check_for_updates():
cwd=dir_base)
version_remote_str = sub(r'[^\d\.]', '', version_remote_str.decode())
except (SubprocessError, FileNotFoundError):
log.debug(f'Could not fetch remote tags')
log.debug('Could not fetch remote tags')
return -1, ''

# parse version information
try:
version_local = version.parse(iblrig.__version__)
version_remote = version.parse(version_remote_str)
except version.InvalidVersion:
log.debug(f'Invalid version string')
log.debug('Invalid version string')
return -1, ''

if version_remote > version_local:
log.info(f'Update to iblrig {version_remote_str} found.')
else:
log.info(f'No update found.')
log.info('No update found.')
return version_remote > version_local, version_remote_str

0 comments on commit aff48a5

Please sign in to comment.