Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
bauh / usr / lib / python3.11 / dist-packages / bauh / commons / internet.py
Size: Mime:
import socket


class InternetChecker:

    def __init__(self, offline: bool):
        self.offline = offline

    def is_available(self) -> bool:
        if self.offline:
            return False

        try:
            socket.gethostbyname("w3.org")
            return True
        except Exception:
            return False