MCPcopy Create free account
hub / github.com/brain-workshop/brainworkshop / update_check

Function update_check

brainworkshop.py:891–907  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

889update_available = False
890update_version = 0
891def update_check():
892 global update_available
893 global update_version
894 socket.setdefaulttimeout(TIMEOUT_SILENT)
895 if sys.version_info >= (3,0):
896 req = urllib.request.Request(WEB_VERSION_CHECK)
897 else:
898 req = urllib.Request(WEB_VERSION_CHECK)
899 try:
900 response = urllib.urlopen(req)
901 version = response.readline().strip()
902 except Exception as e:
903 debug_msg(e)
904 return
905 if version > VERSION: # simply comparing strings works just fine
906 update_available = True
907 update_version = version
908
909if cfg.VERSION_CHECK_ON_STARTUP and not CLINICAL_MODE:
910 update_check()

Callers 1

brainworkshop.pyFile · 0.85

Calls 1

debug_msgFunction · 0.85

Tested by

no test coverage detected