Skip to content

Commit

Permalink
Merge branch 'fix/microdrop-upgrade'
Browse files Browse the repository at this point in the history
  • Loading branch information
cfobel committed Aug 18, 2017
2 parents bfd5402 + e97d4c9 commit bb6907c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
23 changes: 15 additions & 8 deletions microdrop_launcher/microdrop_version.py
Expand Up @@ -32,14 +32,7 @@ def cache_microdrop_version():
# Try to look up available versions of MicroDrop from Conda channels
# and which version is installed.
version_info = conda_version_info('microdrop')
except IOError:
# Conda executable not found.
return
except sp.CalledProcessError:
# `conda search` command failed, e.g., no internet connection
# is available.
return
else:

installed_info = version_info['installed']
if not installed_info:
# No `microdrop` Conda package found.
Expand Down Expand Up @@ -89,6 +82,20 @@ def cache_microdrop_version():
except:
logger.error('Error caching latest version.',
exc_info=True)
except RuntimeError, exception:
if 'CondaHTTPError' in str(exception):
# Error accessing Conda server.
logger.warning('Could not connect to server.')
return
else:
logger.debug('Error checking MicroDrop version')
except IOError:
# Conda executable not found.
return
except sp.CalledProcessError:
# `conda search` command failed, e.g., no internet connection
# is available.
return


def load_cached_version():
Expand Down
7 changes: 4 additions & 3 deletions microdrop_launcher/profile.py
Expand Up @@ -73,9 +73,10 @@ def check_version_cache_for_upgrade():
# If cached latest MicroDrop version is more recent than the currently
# installed version, prompt user to offer to upgrade.
if all([GUI_AVAILABLE, not cached_info.get('ignore'),
latest_version is not None,
pkg_resources.parse_version(latest_version) >
pkg_resources.parse_version(installed_version)]):
latest_version is not None]):
if (pkg_resources.parse_version(latest_version) <=
pkg_resources.parse_version(installed_version)):
return
# Display dialog.
dialog = gtk.MessageDialog(type=gtk.MESSAGE_QUESTION)
dialog.set_icon_from_file(ICON_PATH)
Expand Down

0 comments on commit bb6907c

Please sign in to comment.