本文整理汇总了Python中autobahn.twisted.websocket.WebSocketClientFactory.verbose方法的典型用法代码示例。如果您正苦于以下问题:Python WebSocketClientFactory.verbose方法的具体用法?Python WebSocketClientFactory.verbose怎么用?Python WebSocketClientFactory.verbose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类autobahn.twisted.websocket.WebSocketClientFactory
的用法示例。
在下文中一共展示了WebSocketClientFactory.verbose方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from autobahn.twisted.websocket import WebSocketClientFactory [as 别名]
# 或者: from autobahn.twisted.websocket.WebSocketClientFactory import verbose [as 别名]
def main():
parser = argparse.ArgumentParser(description="Process all withdrawals using blockchain.info wallet api")
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('-db', "--db_engine", action="store", dest="db_engine", help='Database Engine', type=str)
parser.add_argument('-v', "--verbose", action="store_true", default=False, dest="verbose", help='Verbose')
wallet_mnemonic = getpass.getpass('wallet_mnemonic: ')
arguments = parser.parse_args()
if not arguments.db_engine:
parser.print_help()
return
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
db_engine = create_engine(arguments.db_engine, echo=arguments.verbose)
Base.metadata.create_all(db_engine)
factory = WebSocketClientFactory(blinktrade_url.geturl())
factory.blintrade_user = arguments.blintrade_user
factory.blintrade_password = arguments.blintrade_password
factory.blockchain_guid = arguments.blockchain_guid
factory.wallet_mnemonic = wallet_mnemonic
factory.db_session = scoped_session(sessionmaker(bind=db_engine))
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()
示例2: main
# 需要导入模块: from autobahn.twisted.websocket import WebSocketClientFactory [as 别名]
# 或者: from autobahn.twisted.websocket.WebSocketClientFactory import verbose [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()
示例3: main
# 需要导入模块: from autobahn.twisted.websocket import WebSocketClientFactory [as 别名]
# 或者: from autobahn.twisted.websocket.WebSocketClientFactory import verbose [as 别名]
def main():
parser = argparse.ArgumentParser(description="Process blinktrade withdrawals requests")
parser.add_argument('-c',
"--config",
action="store",
dest="config",
help='Configuration file', type=str)
arguments = parser.parse_args()
candidates = [ os.path.join(site_config_dir('blinktrade'), 'blinktrade_withdrawer.ini'),
os.path.expanduser('~/.blinktrade/blinktrade_withdrawer.ini')]
if arguments.config:
candidates.append(arguments.config)
config = ConfigParser.SafeConfigParser()
config.read( candidates )
if config.has_section('blockchain_info'):
blockchain_main_password = getpass.getpass('Blockchain.info main password: ')
blockchain_second_password = getpass.getpass('Blockchain.info second password: ')
blinktrade_password = getpass.getpass('blinktrade password: ')
blinktrade_2fa = getpass.getpass('blinktrade second factor authentication: ')
blinktrade_port = 443
should_connect_on_ssl = True
blinktrade_url = urlparse( config.get("blinktrade", "webscoket_url"))
if blinktrade_url.port is None and blinktrade_url.scheme == 'ws':
should_connect_on_ssl = False
blinktrade_port = 80
db_engine = config.get("database", "sqlalchemy_engine") + ':///' +\
os.path.expanduser(config.get("database", "sqlalchemy_connection_string"))
engine = create_engine(db_engine, echo=config.getboolean('database', 'sqlalchmey_verbose'))
Base.metadata.create_all(engine)
factory = WebSocketClientFactory(blinktrade_url.geturl())
factory.db_session = scoped_session(sessionmaker(bind=engine))
factory.verbose = config.getboolean("blinktrade", "verbose")
factory.blinktrade_user = config.get("blinktrade", "user")
factory.blinktrade_broker_id = config.get("blinktrade", "broker_id")
factory.currencies = json.loads(config.get("blinktrade", "currencies"))
factory.methods = json.loads(config.get("blinktrade", "methods"))
factory.blinktrade_password = blinktrade_password
factory.blinktrade_2fa = blinktrade_2fa
factory.blocked_accounts = json.loads(config.get("blinktrade", "blocked_accounts"))
if config.has_section('blockchain_info'):
from blockchain_info import BlockchainInfoWithdrawalProtocol
factory.blockchain_guid = config.get("blockchain_info", "guid")
factory.from_address = config.get("blockchain_info", "from_address")
factory.note = config.get("blockchain_info", "note")
factory.blockchain_main_password = blockchain_main_password
factory.blockchain_second_password = blockchain_second_password
factory.protocol = BlockchainInfoWithdrawalProtocol
if config.has_section('mailer'):
from mailer_protocol import MailerWithdrawalProtocol
factory.mandrill_apikey = config.get("mailer", "mandrill_apikey")
factory.mandrill_template_name = config.get("mailer", "template_name")
factory.mandrill_from_email = config.get("mailer", "from_email")
factory.mandrill_from_name = config.get("mailer", "from_name")
factory.mandrill_to_email = config.get("mailer", "to_email")
factory.mandrill_to_name = config.get("mailer", "to_name")
factory.mandrill_website = config.get("mailer", "website")
factory.protocol = MailerWithdrawalProtocol
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()