Skip to content
This repository was archived by the owner on Jan 20, 2026. It is now read-only.

Commit 3ba1b97

Browse files
committed
release of 0.20.2
* estimated_mana is now capped by estimated_max * print_info fixed() * get_api_methods() and get_apis() added to Steem
1 parent a2ea86d commit 3ba1b97

8 files changed

Lines changed: 27 additions & 9 deletions

File tree

beem/account.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,8 @@ def get_rc_manabar(self):
235235
last_update = datetime.utcfromtimestamp(last_update_time)
236236
diff_in_seconds = (addTzInfo(datetime.utcnow()) - addTzInfo(last_update)).total_seconds()
237237
estimated_mana = int(current_mana + diff_in_seconds * estimated_max / STEEM_VOTING_MANA_REGENERATION_SECONDS)
238+
if estimated_mana > estimated_max:
239+
estimated_mana = estimated_max
238240
estimated_pct = estimated_mana / estimated_max * 100
239241
return {"current_mana": current_mana, "last_update_time": last_update_time,
240242
"estimated_mana": estimated_mana, "estimated_max": estimated_max, "estimated_pct": estimated_pct}
@@ -328,7 +330,7 @@ def print_info(self, force_refresh=False, return_str=False, use_table=False, **k
328330
t.add_row(["Remaining Bandwidth", "%.2f %%" % (remaining)])
329331
t.add_row(["used/allocated Bandwidth", "(%.0f kb of %.0f mb)" % (used_kb, allocated_mb)])
330332
if rc_mana is not None:
331-
t.add_row(["Remaining RC", "%.2f %%" % (rc_mana["current_mana"] / rc_mana["max_mana"] * 100)])
333+
t.add_row(["Remaining RC", "%.2f %%" % (rc_mana["estimated_pct"])])
332334
t.add_row(["used/allocated RC", "(%.0f of %.0f)" % (int(rc["max_rc"]) * rc_mana["estimated_pct"], int(rc["max_rc"]))])
333335
t.add_row(["Full in ", "%s" % (self.get_manabar_recharge_time_str(rc_mana))])
334336
if return_str:
@@ -350,7 +352,7 @@ def print_info(self, force_refresh=False, return_str=False, use_table=False, **k
350352
ret += " (%.0f kb of %.0f mb)\n" % (used_kb, allocated_mb)
351353
if rc_mana is not None:
352354
ret += "--- RC manabar ---\n"
353-
ret += "Remaining: %.2f %%" % (rc_mana["current_mana"] / rc_mana["estimated_max"] * 100)
355+
ret += "Remaining: %.2f %%" % (rc_mana["estimated_pct"])
354356
ret += " (%.0f of %.0f)\n" % (int(rc["max_rc"]) * rc_mana["estimated_pct"], int(rc["max_rc"]))
355357
ret += "full in %s \n" % (self.get_manabar_recharge_time_str(rc_mana))
356358
if return_str:
@@ -379,6 +381,8 @@ def get_manabar(self):
379381
last_update = datetime.utcfromtimestamp(last_update_time)
380382
diff_in_seconds = (addTzInfo(datetime.utcnow()) - addTzInfo(last_update)).total_seconds()
381383
estimated_mana = int(current_mana + diff_in_seconds * estimated_max / STEEM_VOTING_MANA_REGENERATION_SECONDS)
384+
if estimated_mana > estimated_max:
385+
estimated_mana = estimated_max
382386
estimated_pct = estimated_mana / estimated_max * 100
383387
return {"current_mana": current_mana, "last_update_time": last_update_time,
384388
"estimated_mana": estimated_mana, "estimated_max": estimated_max, "estimated_pct": estimated_pct}

beem/steem.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1840,3 +1840,17 @@ def _build_comment_options_op(self, author, permlink, options,
18401840
options.get("beneficiaries", []),
18411841
})
18421842
return comment_op
1843+
1844+
def get_api_methods(self):
1845+
"""Returns all supported api methods"""
1846+
return self.rpc.get_methods(api="jsonrpc")
1847+
1848+
def get_apis(self):
1849+
"""Returns all enabled apis"""
1850+
api_methods = self.get_api_methods()
1851+
api_list = []
1852+
for a in api_methods:
1853+
api = a.split(".")[0]
1854+
if api not in api_list:
1855+
api_list.append(api)
1856+
return api_list

beem/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""THIS FILE IS GENERATED FROM beem SETUP.PY."""
2-
version = '0.20.1'
2+
version = '0.20.2'

beemapi/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""THIS FILE IS GENERATED FROM beem SETUP.PY."""
2-
version = '0.20.1'
2+
version = '0.20.2'

beembase/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""THIS FILE IS GENERATED FROM beem SETUP.PY."""
2-
version = '0.20.1'
2+
version = '0.20.2'

beemgraphenebase/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""THIS FILE IS GENERATED FROM beem SETUP.PY."""
2-
version = '0.20.1'
2+
version = '0.20.2'

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@
5757
# built documents.
5858
#
5959
# The short X.Y version.
60-
version = '0.19'
60+
version = '0.20'
6161
# The full version, including alpha/beta/rc tags.
62-
release = '0.19.45'
62+
release = '0.20.2'
6363

6464
# The language for content autogenerated by Sphinx. Refer to documentation
6565
# for a list of supported languages.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
ascii = codecs.lookup('ascii')
1717
codecs.register(lambda name, enc=ascii: {True: enc}.get(name == 'mbcs'))
1818

19-
VERSION = '0.20.1'
19+
VERSION = '0.20.2'
2020

2121
tests_require = ['mock >= 2.0.0', 'pytest', 'pytest-mock', 'parameterized']
2222

0 commit comments

Comments
 (0)