Move __currency into Coins class
This commit is contained in:
parent
180825dfe1
commit
ddf1d18a92
|
@ -7,7 +7,11 @@ from irc3.utils import IrcString
|
|||
from . import Plugin
|
||||
|
||||
|
||||
def __currency(name, prefix=None, suffix=None):
|
||||
|
||||
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(
|
||||
prefix=prefix or '',
|
||||
|
@ -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='€'),
|
||||
|
|
Loading…
Reference in New Issue
Block a user