(self, path)
There are EXTENDED messages which don't include any routers at
        all, and any of the EXTENDED messages may have some arbitrary
        flags in them. So far, they're all upper-case and none start
        with $ luckily. The routers in the path should all be
        LongName-style router names (this depends on them starting
        with $).

        For further complication, it's possible to extend a circuit to
        a router which isn't in the consensus. nickm via #tor thought
        this might happen in the case of hidden services choosing a
        rendevouz point not in the current consensus.
There are EXTENDED messages which don't include any routers at
        all, and any of the EXTENDED messages may have some arbitrary
        flags in them. So far, they're all upper-case and none start
        with $ luckily. The routers in the path should all be
        LongName-style router names (this depends on them starting
        with $).
There are EXTENDED messages which don t include any routers at all and any of the EXTENDED messages may have some arbitrary flags in them . So far they re all upper - case and none start with $ luckily . The routers in the path should all be LongName - style router names ( this depends on them starting with $ ) .
def update_path(self, path):
        """
        There are EXTENDED messages which don't include any routers at
        all, and any of the EXTENDED messages may have some arbitrary
        flags in them. So far, they're all upper-case and none start
        with $ luckily. The routers in the path should all be
        LongName-style router names (this depends on them starting
        with $).

        For further complication, it's possible to extend a circuit to
        a router which isn't in the consensus. nickm via #tor thought
        this might happen in the case of hidden services choosing a
        rendevouz point not in the current consensus.
        """

        oldpath_len = len(self.path)
        self.path = []
        for p in path:
            if p[0] != '$':
                break

            # this will create a Router if we give it a router
            # LongName that doesn't yet exist
            router = self.router_container.router_from_id(p)

            self.path.append(router)
            # if the path grew, notify listeners
            if len(self.path) > oldpath_len:
                for x in self.listeners:
                    x.circuit_extend(self, router)
                oldpath_len = len(self.path)
def update_path ( self , path ) : oldpath_len = len ( self . path ) self . path = [ ] for p in path : if p [ 0 ] != '$' : break # this will create a Router if we give it a router # LongName that doesn't yet exist router = self . router_container . router_from_id ( p ) self . path . append ( router ) # if the path grew, notify listeners if len ( self . path ) > oldpath_len : for x in self . listeners : x . circuit_extend ( self , router ) oldpath_len = len ( self . path )