Move __currency into Coins class

This commit is contained in:
Nils Schweinsberg 2017-10-15 03:37:49 +02:00
parent 180825dfe1
commit ddf1d18a92

View File

@ -7,6 +7,10 @@ from irc3.utils import IrcString
from . import Plugin
class Coins(Plugin):
API_URL = 'https://api.cryptowat.ch/markets/{market}/{crypto}{currency}/summary'
def __currency(name, prefix=None, suffix=None):
def str(value):
return '{prefix}{value:,.2f}{suffix}'.format(
@ -15,8 +19,6 @@ def __currency(name, prefix=None, suffix=None):
value=value)
return str
class Coins(Plugin):
API_URL = 'https://api.cryptowat.ch/markets/{market}/{crypto}{currency}/summary'
CURRENCIES = {
'usd': __currency('usd', prefix='$'),
'eur': __currency('eur', suffix=''),