From 11e572d1a87511d492fcf30783ed7c23baa63673 Mon Sep 17 00:00:00 2001 From: z-bowen Date: Wed, 8 Aug 2018 14:33:45 +0200 Subject: [PATCH] Problem: Imports inside a function violate PEP-8 Solution: Moved them to the top of the file --- bigchaindb/utils.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bigchaindb/utils.py b/bigchaindb/utils.py index 1ef8a9c5..ba781214 100644 --- a/bigchaindb/utils.py +++ b/bigchaindb/utils.py @@ -2,9 +2,13 @@ import contextlib import threading import queue import multiprocessing as mp +import json import setproctitle +from bigchaindb.tendermint_utils import key_from_base64 +from bigchaindb.common.crypto import key_pair_from_ed25519_key + class ProcessGroup(object): @@ -31,7 +35,8 @@ class ProcessGroup(object): class Process(mp.Process): """Wrapper around multiprocessing.Process that uses setproctitle to set the name of the process when running - the target task.""" + the target task. + """ def run(self): setproctitle.setproctitle(self.name) @@ -171,9 +176,6 @@ class Lazy: # Load Tendermint's public and private key from the file path def load_node_key(path): - import json - from bigchaindb.tendermint_utils import key_from_base64 - from bigchaindb.common.crypto import key_pair_from_ed25519_key with open(path) as json_data: priv_validator = json.load(json_data) priv_key = priv_validator['priv_key']['value']