diff --git a/beem/account.py b/beem/account.py index df835c0181c1c3b67b743e1b89441a4fd1ff6bcb..a63c69b425fb5305a7c6f49598721bff88315bd2 100644 --- a/beem/account.py +++ b/beem/account.py @@ -235,6 +235,8 @@ class Account(BlockchainObject): last_update = datetime.utcfromtimestamp(last_update_time) diff_in_seconds = (addTzInfo(datetime.utcnow()) - addTzInfo(last_update)).total_seconds() estimated_mana = int(current_mana + diff_in_seconds * estimated_max / STEEM_VOTING_MANA_REGENERATION_SECONDS) + if estimated_mana > estimated_max: + estimated_mana = estimated_max estimated_pct = estimated_mana / estimated_max * 100 return {"current_mana": current_mana, "last_update_time": last_update_time, "estimated_mana": estimated_mana, "estimated_max": estimated_max, "estimated_pct": estimated_pct} @@ -328,7 +330,7 @@ class Account(BlockchainObject): t.add_row(["Remaining Bandwidth", "%.2f %%" % (remaining)]) t.add_row(["used/allocated Bandwidth", "(%.0f kb of %.0f mb)" % (used_kb, allocated_mb)]) if rc_mana is not None: - t.add_row(["Remaining RC", "%.2f %%" % (rc_mana["current_mana"] / rc_mana["max_mana"] * 100)]) + t.add_row(["Remaining RC", "%.2f %%" % (rc_mana["estimated_pct"])]) t.add_row(["used/allocated RC", "(%.0f of %.0f)" % (int(rc["max_rc"]) * rc_mana["estimated_pct"], int(rc["max_rc"]))]) t.add_row(["Full in ", "%s" % (self.get_manabar_recharge_time_str(rc_mana))]) if return_str: @@ -350,7 +352,7 @@ class Account(BlockchainObject): ret += " (%.0f kb of %.0f mb)\n" % (used_kb, allocated_mb) if rc_mana is not None: ret += "--- RC manabar ---\n" - ret += "Remaining: %.2f %%" % (rc_mana["current_mana"] / rc_mana["estimated_max"] * 100) + ret += "Remaining: %.2f %%" % (rc_mana["estimated_pct"]) ret += " (%.0f of %.0f)\n" % (int(rc["max_rc"]) * rc_mana["estimated_pct"], int(rc["max_rc"])) ret += "full in %s \n" % (self.get_manabar_recharge_time_str(rc_mana)) if return_str: @@ -379,6 +381,8 @@ class Account(BlockchainObject): last_update = datetime.utcfromtimestamp(last_update_time) diff_in_seconds = (addTzInfo(datetime.utcnow()) - addTzInfo(last_update)).total_seconds() estimated_mana = int(current_mana + diff_in_seconds * estimated_max / STEEM_VOTING_MANA_REGENERATION_SECONDS) + if estimated_mana > estimated_max: + estimated_mana = estimated_max estimated_pct = estimated_mana / estimated_max * 100 return {"current_mana": current_mana, "last_update_time": last_update_time, "estimated_mana": estimated_mana, "estimated_max": estimated_max, "estimated_pct": estimated_pct} diff --git a/beem/steem.py b/beem/steem.py index 91ea0a483286ff853a329c219fc80aa74b1f4524..94f5603e8a102cb7cbe6e2b5fdfe90767c964a35 100644 --- a/beem/steem.py +++ b/beem/steem.py @@ -1840,3 +1840,17 @@ class Steem(object): options.get("beneficiaries", []), }) return comment_op + + def get_api_methods(self): + """Returns all supported api methods""" + return self.rpc.get_methods(api="jsonrpc") + + def get_apis(self): + """Returns all enabled apis""" + api_methods = self.get_api_methods() + api_list = [] + for a in api_methods: + api = a.split(".")[0] + if api not in api_list: + api_list.append(api) + return api_list diff --git a/beem/version.py b/beem/version.py index e567c425b51168aa204dfd5fb018f4dade307867..cfc91a71fabd00a1e542757d3233ae4fb1a6aaaa 100644 --- a/beem/version.py +++ b/beem/version.py @@ -1,2 +1,2 @@ """THIS FILE IS GENERATED FROM beem SETUP.PY.""" -version = '0.20.1' +version = '0.20.2' diff --git a/beemapi/version.py b/beemapi/version.py index e567c425b51168aa204dfd5fb018f4dade307867..cfc91a71fabd00a1e542757d3233ae4fb1a6aaaa 100644 --- a/beemapi/version.py +++ b/beemapi/version.py @@ -1,2 +1,2 @@ """THIS FILE IS GENERATED FROM beem SETUP.PY.""" -version = '0.20.1' +version = '0.20.2' diff --git a/beembase/version.py b/beembase/version.py index e567c425b51168aa204dfd5fb018f4dade307867..cfc91a71fabd00a1e542757d3233ae4fb1a6aaaa 100644 --- a/beembase/version.py +++ b/beembase/version.py @@ -1,2 +1,2 @@ """THIS FILE IS GENERATED FROM beem SETUP.PY.""" -version = '0.20.1' +version = '0.20.2' diff --git a/beemgraphenebase/version.py b/beemgraphenebase/version.py index e567c425b51168aa204dfd5fb018f4dade307867..cfc91a71fabd00a1e542757d3233ae4fb1a6aaaa 100644 --- a/beemgraphenebase/version.py +++ b/beemgraphenebase/version.py @@ -1,2 +1,2 @@ """THIS FILE IS GENERATED FROM beem SETUP.PY.""" -version = '0.20.1' +version = '0.20.2' diff --git a/docs/conf.py b/docs/conf.py index bced78f74fb88a700f512bb566b83ca9e675aa8e..fec76c24a9b72965cd38ed7a3c8f1dab1978ce6e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -57,9 +57,9 @@ author = 'Holger Nahrstaedt' # built documents. # # The short X.Y version. -version = '0.19' +version = '0.20' # The full version, including alpha/beta/rc tags. -release = '0.19.45' +release = '0.20.2' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/setup.py b/setup.py index 3797a987ac5bf3d45b52907698fd0a646e78fb10..c1e5976500cd5d0ddae6462712ee7b4ad12b5330 100755 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ except LookupError: ascii = codecs.lookup('ascii') codecs.register(lambda name, enc=ascii: {True: enc}.get(name == 'mbcs')) -VERSION = '0.20.1' +VERSION = '0.20.2' tests_require = ['mock >= 2.0.0', 'pytest', 'pytest-mock', 'parameterized']