def redirect_view(): """Redirect the browser to our index or, if the local machine is not configured, attempt to resolve the mdns name know.local""" localhost_iiab = config().get_knowledge_dir() if localhost_iiab is not None: return index() try: address = mdns_resolve("know.local") if address is not None: return redirect("http://" + address) except: pass return index() # This will display an error, but that is better than nothing
def detect_view(): """Detect if a valid IIAB installation exists on the localhost or the local network (using mDNS). Returns a 404 if no IIAB installation found.""" localhost_iiab = config().get_knowledge_dir() if localhost_iiab is not None: return "true" try: address = mdns_resolve("know.local") if address is not None: return "true" except: pass abort(404)
def redirect_view(): """Redirect the browser to our index or, if the local machine is not configured, attempt to resolve the mdns name know.local""" localhost_iiab = config().get_knowledge_dir() if localhost_iiab is not None: return index() try: address = mdns_resolve("know.local") if address is not None: return redirect("http://" + address) except: pass return index( ) # This will display an error, but that is better than nothing