Ejemplo n.º 1
0
def serial(config):
	"""What the dataserver says about your key."""
	if not config.only: 
		click.echo( "serial key dataserver answer:")
	what="serial"
	click.echo( altsheets.askDataserver(what, config.key), nl=False )
	if not config.only: 
		click.echo("")
Ejemplo n.º 2
0
def cmc(config, param, acronym):
	"""Coinmarketcap data: coinq cmc doge"""
		
	several=("," in acronym)
	if not several and not config.only:
		click.echo( "%-5s %-9s: " % (acronym.upper(), param), nl=False)
		
	what="%s/cmc/%s" % (acronym, param)
	answer=altsheets.askDataserver(what, config.key)
	
	if not several: click.echo( answer )
	else:
		if config.only: click.echo( answer )
		else:
			answers=answer.split("\n")
			for coin, a in zip(acronym.split(","), answers):
				click.echo( "%-5s %-9s: %6s" % (coin.upper(), param, a))
Ejemplo n.º 3
0
def price(config, exchange, acronym, satoshi):
	"""Cryptocurrency prices: coinq price LTC"""
	several=("," in exchange or "," in acronym)  
	
	if not several and not config.only: 
		click.echo( "%-5s at %-9s: " % (acronym.upper(), exchange), nl=False)
	
	what="%s/%s/price" % (acronym, exchange)
	answer=altsheets.askDataserver(what, config.key)
	
	if not several:
		if satoshi: answer=toSatoshi(answer)
		click.echo(answer)
	else:
		if config.only: 
			if satoshi: answer=toSatoshi(answer)
			click.echo( answer)
			
		else:
			answers=answer.split("\n")
			for e,a,p in zip(exchange.split(","), acronym.split(","), answers):
				if satoshi: p=toSatoshi(p)
				click.echo("%-5s at %-9s: %8s" % (a,e,p) )