Request to access an attribute is forwarded to the L{PortSelector} for either the I{first} service or the I{default} service (when specified). @param name: The name of a method. @type name: str @return: A L{PortSelector}. @rtype: L{PortSelecto
(self, name)
| 299 | self.__services = services |
| 300 | |
| 301 | def __getattr__(self, name): |
| 302 | """ |
| 303 | Request to access an attribute is forwarded to the |
| 304 | L{PortSelector} for either the I{first} service or the |
| 305 | I{default} service (when specified). |
| 306 | @param name: The name of a method. |
| 307 | @type name: str |
| 308 | @return: A L{PortSelector}. |
| 309 | @rtype: L{PortSelector}. |
| 310 | """ |
| 311 | default = self.__ds() |
| 312 | if default is None: |
| 313 | port = self.__find(0) |
| 314 | else: |
| 315 | port = default |
| 316 | return getattr(port, name) |
| 317 | |
| 318 | def __getitem__(self, name): |
| 319 | """ |