def get_liquidsoap_version(version_string): m = re.match(r"Liquidsoap (\d+.\d+.\d+)", version_string) if m: return m.group(1) else: return None if m: current_version = m.group(1) return pure.version_cmp(current_version, LIQUIDSOAP_MIN_VERSION) >= 0 return False
def liquidsoap_startup_test(): liquidsoap_version_string = \ liquidsoap_get_info(telnet_lock, ls_host, ls_port, logger) while not liquidsoap_version_string: logger.warning("Liquidsoap doesn't appear to be running!, " + \ "Sleeping and trying again") time.sleep(1) liquidsoap_version_string = \ liquidsoap_get_info(telnet_lock, ls_host, ls_port, logger) while pure.version_cmp(liquidsoap_version_string, LIQUIDSOAP_MIN_VERSION) < 0: logger.warning("Liquidsoap is running but in incorrect version! " + \ "Make sure you have at least Liquidsoap %s installed" % LIQUIDSOAP_MIN_VERSION) time.sleep(1) liquidsoap_version_string = \ liquidsoap_get_info(telnet_lock, ls_host, ls_port, logger) logger.info("Liquidsoap version string found %s" % liquidsoap_version_string)