def updateFromString(self, val, str):
        suppProtocols = ['http', 'https']
        vlist = str.split()
        if len(vlist) > 2:
            raise ParseError("Too many arguments for proxy configuration '%s'"
                             % str)
        if not vlist:
            raise ParseError("Arguments required for proxy configuration")
        if len(vlist) == 2:
            if vlist[0] not in suppProtocols:
                raise ParseError('Unknown proxy procotol %s' % vlist[0])
            if vlist[1] == "None":
                # Special value to turn proxy values off
                if vlist[0] in val:
                    del val[vlist[0]]
                return val
            return CfgDict.updateFromString(self, val, str)

        # At this point, len(vlist) == 1
        # Fix it up
        try:
            protocol, rest = str.split(':', 1)
        except ValueError:
            # : not in the value
            if str == "None":
                # Special value that turns off the proxy
                for protocol in suppProtocols:
                    if protocol in val:
                        del val[protocol]
                return val
            raise ParseError("Invalid proxy configuration value %s" % str)

        # This next test duplicates the work done by ProxyEntry.parseString,
        # but it's pretty cheap to do here since we already have the protocol
        # parsed out
        if protocol not in suppProtocols:
                raise ParseError('Unknown proxy procotol %s' % protocol)

        CfgDict.updateFromString(self, val, 'http http:' + rest)
        CfgDict.updateFromString(self, val, 'https https:' + rest)
        return val
dataset/ETHPy150Open sassoftware/conary/conary/conarycfg.py/CfgProxy.updateFromString/original