(self, args=_absent, path=_absent, fragment=_absent, query=_absent,
            scheme=_absent, username=_absent, password=_absent, host=_absent,
            port=_absent, netloc=_absent, origin=_absent, query_params=_absent,
            fragment_path=_absent, fragment_args=_absent,
            fragment_separator=_absent)
return self
Set components of a url and return this furl instance, <self>.

        If any overlapping, and hence possibly conflicting, parameters
        are provided, appropriate UserWarning's will be raised. The
        groups of parameters that could potentially overlap are

          <scheme> and <origin>
          <origin>, <netloc>, and/or (<host> or <port>)
          <fragment> and (<fragment_path> and/or <fragment_args>)
          any two or all of <query>, <args>, and/or <query_params>

        In all of the above groups, the latter parameter(s) take
        precedence over the earlier parameter(s). So, for example

          furl('http://google.com/').set(
            netloc='yahoo.com:99', host='bing.com', port=40)

        will result in a UserWarning being raised and the url becoming

          'http://bing.com:40/'

        not

          'http://yahoo.com:99/

        Parameters:
          args: Shortcut for <query_params>.
          path: A list of path segments or a path string to adopt.
          fragment: Fragment string to adopt.
          scheme: Scheme string to adopt.
          netloc: Network location string to adopt.
          origin: Scheme and netloc.
          query: Query string to adopt.
          query_params: A dictionary of query keys and values or list of
            key:value items to adopt.
          fragment_path: A list of path segments to adopt for the
            fragment's path or a path string to adopt as the fragment's
            path.
          fragment_args: A dictionary of query keys and values or list
            of key:value items for the fragment's query to adopt.
          fragment_separator: Boolean whether or not there should be a
            '?' separator between the fragment path and fragment query.
          host: Host string to adopt.
          port: Port number to adopt.
          username: Username string to adopt.
          password: Password string to adopt.
        Raises:
          ValueError on invalid port.
          UserWarning if <scheme> and <origin> are provided.
          UserWarning if <origin>, <netloc> and/or (<host> and/or <port>) are
            provided.
          UserWarning if <query>, <args>, and/or <query_params> are provided.
          UserWarning if <fragment> and (<fragment_path>,
            <fragment_args>, and/or <fragment_separator>) are provided.
        Returns: <self>.
Set components of a url and return this furl instance, <self>.
Set components of a url and return this furl instance <self > .
def set(self, args=_absent, path=_absent, fragment=_absent, query=_absent,
            scheme=_absent, username=_absent, password=_absent, host=_absent,
            port=_absent, netloc=_absent, origin=_absent, query_params=_absent,
            fragment_path=_absent, fragment_args=_absent,
            fragment_separator=_absent):
        """
        Set components of a url and return this furl instance, <self>.

        If any overlapping, and hence possibly conflicting, parameters
        are provided, appropriate UserWarning's will be raised. The
        groups of parameters that could potentially overlap are

          <scheme> and <origin>
          <origin>, <netloc>, and/or (<host> or <port>)
          <fragment> and (<fragment_path> and/or <fragment_args>)
          any two or all of <query>, <args>, and/or <query_params>

        In all of the above groups, the latter parameter(s) take
        precedence over the earlier parameter(s). So, for example

          furl('http://google.com/').set(
            netloc='yahoo.com:99', host='bing.com', port=40)

        will result in a UserWarning being raised and the url becoming

          'http://bing.com:40/'

        not

          'http://yahoo.com:99/

        Parameters:
          args: Shortcut for <query_params>.
          path: A list of path segments or a path string to adopt.
          fragment: Fragment string to adopt.
          scheme: Scheme string to adopt.
          netloc: Network location string to adopt.
          origin: Scheme and netloc.
          query: Query string to adopt.
          query_params: A dictionary of query keys and values or list of
            key:value items to adopt.
          fragment_path: A list of path segments to adopt for the
            fragment's path or a path string to adopt as the fragment's
            path.
          fragment_args: A dictionary of query keys and values or list
            of key:value items for the fragment's query to adopt.
          fragment_separator: Boolean whether or not there should be a
            '?' separator between the fragment path and fragment query.
          host: Host string to adopt.
          port: Port number to adopt.
          username: Username string to adopt.
          password: Password string to adopt.
        Raises:
          ValueError on invalid port.
          UserWarning if <scheme> and <origin> are provided.
          UserWarning if <origin>, <netloc> and/or (<host> and/or <port>) are
            provided.
          UserWarning if <query>, <args>, and/or <query_params> are provided.
          UserWarning if <fragment> and (<fragment_path>,
            <fragment_args>, and/or <fragment_separator>) are provided.
        Returns: <self>.
        """
        def present(v):
            return v is not _absent

        if present(scheme) and present(origin):
            s = ('Possible parameter overlap: <scheme> and <origin>. See '
                 'furl.set() documentation for more details.')
            warnings.warn(s, UserWarning)
        provided = [
            present(netloc), present(origin), present(host) or present(port)]
        if sum(provided) >= 2:
            s = ('Possible parameter overlap: <origin>, <netloc> and/or '
                 '(<host> and/or <port>) provided. See furl.set() '
                 'documentation for more details.')
            warnings.warn(s, UserWarning)
        if sum(present(p) for p in [args, query, query_params]) >= 2:
            s = ('Possible parameter overlap: <query>, <args>, and/or '
                 '<query_params> provided. See furl.set() documentation for '
                 'more details.')
            warnings.warn(s, UserWarning)
        provided = [fragment_path, fragment_args, fragment_separator]
        if present(fragment) and any(present(p) for p in provided):
            s = ('Possible parameter overlap: <fragment> and '
                 '(<fragment_path>and/or <fragment_args>) or <fragment> '
                 'and <fragment_separator> provided. See furl.set() '
                 'documentation for more details.')
            warnings.warn(s, UserWarning)

        # Guard against side effects on exception.
        original_url = self.url
        try:
            if username is not _absent:
                self.username = username
            if password is not _absent:
                self.password = password
            if netloc is not _absent:
                # Raises ValueError on invalid port or malformed IP.
                self.netloc = netloc
            if origin is not _absent:
                # Raises ValueError on invalid port or malformed IP.
                self.origin = origin
            if scheme is not _absent:
                self.scheme = scheme
            if host is not _absent:
                # Raises ValueError on invalid host or malformed IP.
                self.host = host
            if port is not _absent:
                self.port = port  # Raises ValueError on invalid port.

            if path is not _absent:
                self.path.load(path)
            if query is not _absent:
                self.query.load(query)
            if args is not _absent:
                self.query.load(args)
            if query_params is not _absent:
                self.query.load(query_params)
            if fragment is not _absent:
                self.fragment.load(fragment)
            if fragment_path is not _absent:
                self.fragment.path.load(fragment_path)
            if fragment_args is not _absent:
                self.fragment.query.load(fragment_args)
            if fragment_separator is not _absent:
                self.fragment.separator = fragment_separator
        except Exception:
            self.load(original_url)
            raise

        return self
def set ( self , args = _absent , path = _absent , fragment = _absent , query = _absent , scheme = _absent , username = _absent , password = _absent , host = _absent , port = _absent , netloc = _absent , origin = _absent , query_params = _absent , fragment_path = _absent , fragment_args = _absent , fragment_separator = _absent ) : def present ( v ) : return v is not _absent if present ( scheme ) and present ( origin ) : s = ( 'Possible parameter overlap: <scheme> and <origin>. See ' 'furl.set() documentation for more details.' ) warnings . warn ( s , UserWarning ) provided = [ present ( netloc ) , present ( origin ) , present ( host ) or present ( port ) ] if sum ( provided ) >= 2 : s = ( 'Possible parameter overlap: <origin>, <netloc> and/or ' '(<host> and/or <port>) provided. See furl.set() ' 'documentation for more details.' ) warnings . warn ( s , UserWarning ) if sum ( present ( p ) for p in [ args , query , query_params ] ) >= 2 : s = ( 'Possible parameter overlap: <query>, <args>, and/or ' '<query_params> provided. See furl.set() documentation for ' 'more details.' ) warnings . warn ( s , UserWarning ) provided = [ fragment_path , fragment_args , fragment_separator ] if present ( fragment ) and any ( present ( p ) for p in provided ) : s = ( 'Possible parameter overlap: <fragment> and ' '(<fragment_path>and/or <fragment_args>) or <fragment> ' 'and <fragment_separator> provided. See furl.set() ' 'documentation for more details.' ) warnings . warn ( s , UserWarning ) # Guard against side effects on exception. original_url = self . url try : if username is not _absent : self . username = username if password is not _absent : self . password = password if netloc is not _absent : # Raises ValueError on invalid port or malformed IP. self . netloc = netloc if origin is not _absent : # Raises ValueError on invalid port or malformed IP. self . origin = origin if scheme is not _absent : self . scheme = scheme if host is not _absent : # Raises ValueError on invalid host or malformed IP. self . host = host if port is not _absent : self . port = port # Raises ValueError on invalid port. if path is not _absent : self . path . load ( path ) if query is not _absent : self . query . load ( query ) if args is not _absent : self . query . load ( args ) if query_params is not _absent : self . query . load ( query_params ) if fragment is not _absent : self . fragment . load ( fragment ) if fragment_path is not _absent : self . fragment . path . load ( fragment_path ) if fragment_args is not _absent : self . fragment . query . load ( fragment_args ) if fragment_separator is not _absent : self . fragment . separator = fragment_separator except Exception : self . load ( original_url ) raise return self