def check_for_update(self):
def find_update():
logging.debug("Checking remote for new updates.")
try:
gh = GitHub()
repo = gh.repository("phac-nml", "irida-miseq-uploader")
# get the latest tag from github
return next(repo.iter_tags(number=1))
except:
logging.warn("Couldn't reach github to check for new version.")
raise
def handle_update(result):
latest_tag = result.get()
logging.debug("Found latest version: [{}]".format(latest_tag))
release_url = self.url + "/releases/latest"
if LooseVersion(self.__app_version__) < LooseVersion(latest_tag.name):
logging.info("Newer version found.")
dialog = NewVersionMessageDialog(
parent=None,
id=wx.ID_ANY,
message=("A new version of the IRIDA MiSeq "
"Uploader tool is available. You can"
" download the latest version from "),
title="IRIDA MiSeq Uploader update available",
download_url=release_url,
style=wx.CAPTION|wx.CLOSE_BOX|wx.STAY_ON_TOP)
dialog.ShowModal()
dialog.Destroy()
else:
logging.debug("No new versions found.")
dr.startWorker(handle_update, find_update)
run_IRIDA_Uploader.py 文件源码
python
阅读 17
收藏 0
点赞 0
评论 0
评论列表
文章目录