From a96715caeaa18a3f0db484b2e24d3abbd7c1aab3 Mon Sep 17 00:00:00 2001 From: Inso <insomniak.fr@gmail.com> Date: Fri, 30 Jan 2015 08:33:51 +0100 Subject: [PATCH] Better syntax --- src/cutecoin/core/account.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/cutecoin/core/account.py b/src/cutecoin/core/account.py index a57ade90..9c8708d6 100644 --- a/src/cutecoin/core/account.py +++ b/src/cutecoin/core/account.py @@ -21,6 +21,16 @@ from .person import Person from ..tools.exceptions import NoPeerAvailable +def units(units, community): + return units + + +def relative(units, community): + ud = community.dividend() + relative_value = units / float(ud) + return relative_value + + class Account(object): ''' @@ -28,19 +38,8 @@ class Account(object): Each account has only one key, and a key can be locally referenced by only one account. ''' - - @staticmethod - def units(units, community): - return units - - @staticmethod - def relative(units, community): - ud = community.dividend() - relative_value = units / float(ud) - return relative_value - - referentials = {'Units': (units.__func__, '{0}'), - 'UD': (relative.__func__, 'UD {0}') + referentials = {'Units': (units, '{0}'), + 'UD': (relative, 'UD {0}') } def __init__(self, salt, pubkey, name, communities, wallets, contacts, -- GitLab