wrappers.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:iota.lib.py 作者: iotaledger 项目源码 文件源码
def add_route(self, command, adapter):
    # type: (Text, AdapterSpec) -> RoutingWrapper
    """
    Adds a route to the wrapper.

    :param command:
      The name of the command to route (e.g., "attachToTangle").

    :param adapter:
      The adapter object or URI to route requests to.
    """
    if not isinstance(adapter, BaseAdapter):
      try:
        adapter = self.adapter_aliases[adapter]
      except KeyError:
        self.adapter_aliases[adapter] = adapter = resolve_adapter(adapter)

    self.routes[command] = adapter

    return self
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号