def _validateurl(self, url):
        """assembles the server url"""
        parsed = urlparse(url)
        path = parsed.path.strip("/")
        if path:
            parts = path.split("/")
            url_types = ("admin", "manager", "rest")
            if any(i in parts for i in url_types):
                while parts.pop() not in url_types:
                    next
            elif "services" in parts:
                while parts.pop() not in "services":
                    next
            path = "/".join(parts)
        else:
            path = "arcgis"
        self._adminUrl = "%s://%s/%s/admin" % (parsed.scheme, parsed.netloc, path)
        return "%s://%s/%s/rest/services" % (parsed.scheme, parsed.netloc, path)
def _validateurl ( self , url ) : parsed = urlparse ( url ) path = parsed . path . strip ( "/" ) if path : parts = path . split ( "/" ) url_types = ( "admin" , "manager" , "rest" ) if any ( i in parts for i in url_types ) : while parts . pop ( ) not in url_types : next elif "services" in parts : while parts . pop ( ) not in "services" : next path = "/" . join ( parts ) else : path = "arcgis" self . _adminUrl = "%s://%s/%s/admin" % ( parsed . scheme , parsed . netloc , path ) return "%s://%s/%s/rest/services" % ( parsed . scheme , parsed . netloc , path )
assembles the server url