当前位置: 首页>>代码示例>>Python>>正文


Python WebSocketClientFactory.edentiti_customer_id方法代码示例

本文整理汇总了Python中autobahn.twisted.websocket.WebSocketClientFactory.edentiti_customer_id方法的典型用法代码示例。如果您正苦于以下问题:Python WebSocketClientFactory.edentiti_customer_id方法的具体用法?Python WebSocketClientFactory.edentiti_customer_id怎么用?Python WebSocketClientFactory.edentiti_customer_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在autobahn.twisted.websocket.WebSocketClientFactory的用法示例。


在下文中一共展示了WebSocketClientFactory.edentiti_customer_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: from autobahn.twisted.websocket import WebSocketClientFactory [as 别名]
# 或者: from autobahn.twisted.websocket.WebSocketClientFactory import edentiti_customer_id [as 别名]
def main():
  parser = argparse.ArgumentParser(description="Validates peoples identity using edentiti (green id) identity provider")
  parser.add_argument('-b', "--blinktrade_websocket_url", action="store", dest="blintrade_webscoket_url", help='Blinktrade Websocket Url', type=str)
  parser.add_argument('-u', "--blinktrade_username", action="store", dest="blintrade_user",     help='Blinktrade User', type=str)
  parser.add_argument('-p', "--blinktrade_password", action="store", dest="blintrade_password",  help='Blinktrade Password', type=str)
  parser.add_argument('-c', "--customer_id", action="store", dest="edentiti_customer_id",  help='Edentiti Web service password', type=str)
  parser.add_argument('-P', "--password", action="store", dest="edentiti_password",  help='Edentiti Web service password', type=str)
  parser.add_argument('-v', "--verbose", action="store_true", default=False, dest="verbose",  help='Verbose')
  parser.add_argument('-t', "--test", action="store_true", default=False, dest="test",  help='Verbose')

  test_wsdl = 'https://test.edentiti.com/Registrations-Registrations/VerificationServicesPassword?wsdl'
  production_wsdl = 'https://www.edentiti.com/Registrations-Registrations/VerificationServicesPassword?wsdl'

  arguments = parser.parse_args()

  wsdl = production_wsdl
  if arguments.test:
    wsdl = test_wsdl
  wsdl_client = SoapClient( wsdl=wsdl, soap_ns="soapenv", ns="ns1", trace=True)

  blinktrade_port = 443
  should_connect_on_ssl = True
  blinktrade_url = urlparse(arguments.blintrade_webscoket_url)
  if blinktrade_url.port is None and blinktrade_url.scheme == 'ws':
    should_connect_on_ssl = False
    blinktrade_port = 80

  factory = WebSocketClientFactory(blinktrade_url.geturl())
  factory.blintrade_user = arguments.blintrade_user
  factory.blintrade_password = arguments.blintrade_password
  factory.wsdl_client = wsdl_client
  factory.edentiti_customer_id = arguments.edentiti_customer_id
  factory.edentiti_password = arguments.edentiti_password
  factory.verbose = arguments.verbose

  factory.protocol = BtcWithdrawalProtocol
  if should_connect_on_ssl:
    reactor.connectSSL( blinktrade_url.netloc ,  blinktrade_port , factory, ssl.ClientContextFactory() )
  else:
    reactor.connectTCP(blinktrade_url.netloc ,  blinktrade_port , factory )

  reactor.run()
开发者ID:alisheikh,项目名称:blinktrade_edentiti,代码行数:44,代码来源:edentiti.py


注:本文中的autobahn.twisted.websocket.WebSocketClientFactory.edentiti_customer_id方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。