Skip to content
Snippets Groups Projects

Convert OrderedDict to dict (#124)

Merged Moul requested to merge 124_rm_OrderedDict into main
5 files
+ 11
19
Compare changes
  • Side-by-side
  • Inline
Files
5
@@ -14,7 +14,6 @@
@@ -14,7 +14,6 @@
# along with Silkaj. If not, see <https://www.gnu.org/licenses/>.
# along with Silkaj. If not, see <https://www.gnu.org/licenses/>.
import time
import time
from collections import OrderedDict
from operator import itemgetter
from operator import itemgetter
from urllib.error import HTTPError
from urllib.error import HTTPError
@@ -47,7 +46,7 @@ def list_blocks(number: int, detailed: bool) -> None:
@@ -47,7 +46,7 @@ def list_blocks(number: int, detailed: bool) -> None:
issuers = []
issuers = []
issuers_dict = {}
issuers_dict = {}
for block in blocks:
for block in blocks:
issuer = OrderedDict()
issuer = {}
issuer["pubkey"] = block["issuer"]
issuer["pubkey"] = block["issuer"]
if detailed or number <= 30:
if detailed or number <= 30:
gentime = from_timestamp(block["time"], tz="local").format(ALL)
gentime = from_timestamp(block["time"], tz="local").format(ALL)
@@ -103,7 +102,7 @@ def print_blocks_views(issuers, current_nbr, number, detailed):
@@ -103,7 +102,7 @@ def print_blocks_views(issuers, current_nbr, number, detailed):
found = True
found = True
break
break
if not found:
if not found:
issued = OrderedDict()
issued = {}
issued["uid"] = issuer["uid"]
issued["uid"] = issuer["uid"]
issued["blocks"] = 1
issued["blocks"] = 1
list_issued.append(issued)
list_issued.append(issued)
Loading