Beispiel #1
0
def sanityCheck(args):

    import requests
    from urllib.parse import urlparse

    if not Scrap.checkUrlValid(args.url):
        raise requests.ConnectionError(f"invalid url {args.url}")

    if args.navdepth < -1:
        raise OverflowError("depth range should be [-1, ... ).")

    main(args=args)
Beispiel #2
0
    def _checkValidAddr(self, a0: str) -> bool:

        if not a0:
            self.ui.btn_addrPrefix.setStyleSheet(
                "background-color: white; color: black")
            return False
        else:
            if not Scrap.checkUrlValid(a0):
                logger.error(f"{a0} not valid url")
                self.ui.btn_addrPrefix.setStyleSheet(
                    "background-color: red; color: black")
                return False

            else:
                self.ui.btn_addrPrefix.setStyleSheet(
                    "background-color: green; color: black")
                return True