organize imports
This commit is contained in:
parent
255b9e9e5e
commit
efe05e4443
26
src/api.py
26
src/api.py
@ -74,26 +74,20 @@ from six.moves.reprlib import repr
|
|||||||
|
|
||||||
import helper_inbox
|
import helper_inbox
|
||||||
import helper_sent
|
import helper_sent
|
||||||
import protocol
|
|
||||||
import proofofwork
|
import proofofwork
|
||||||
|
import protocol
|
||||||
import queues
|
import queues
|
||||||
import shared
|
import shared
|
||||||
|
|
||||||
import shutdown
|
import shutdown
|
||||||
import state
|
import state
|
||||||
from addresses import (
|
from addresses import (addBMIfNotPresent, decodeAddress, decodeVarint,
|
||||||
addBMIfNotPresent,
|
varintDecodeError)
|
||||||
decodeAddress,
|
|
||||||
decodeVarint,
|
|
||||||
varintDecodeError
|
|
||||||
)
|
|
||||||
from bmconfigparser import config
|
from bmconfigparser import config
|
||||||
from debug import logger
|
from debug import logger
|
||||||
from defaults import (
|
from defaults import (networkDefaultPayloadLengthExtraBytes,
|
||||||
networkDefaultProofOfWorkNonceTrialsPerByte,
|
networkDefaultProofOfWorkNonceTrialsPerByte)
|
||||||
networkDefaultPayloadLengthExtraBytes)
|
from helper_sql import (SqlBulkExecute, sql_ready, sqlExecute, sqlQuery,
|
||||||
from helper_sql import (
|
sqlStoredProcedure)
|
||||||
SqlBulkExecute, sqlExecute, sqlQuery, sqlStoredProcedure, sql_ready)
|
|
||||||
from highlevelcrypto import calculateInventoryHash
|
from highlevelcrypto import calculateInventoryHash
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -101,7 +95,7 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
connectionpool = None
|
connectionpool = None
|
||||||
|
|
||||||
from network import stats, StoppableThread, invQueue
|
from network import StoppableThread, invQueue, stats
|
||||||
from version import softwareVersion
|
from version import softwareVersion
|
||||||
|
|
||||||
try: # TODO: write tests for XML vulnerabilities
|
try: # TODO: write tests for XML vulnerabilities
|
||||||
@ -225,8 +219,8 @@ class singleAPI(StoppableThread):
|
|||||||
if config.safeGet(
|
if config.safeGet(
|
||||||
'bitmessagesettings', 'apivariant') == 'json':
|
'bitmessagesettings', 'apivariant') == 'json':
|
||||||
try:
|
try:
|
||||||
from jsonrpclib.SimpleJSONRPCServer import (
|
from jsonrpclib.SimpleJSONRPCServer import \
|
||||||
SimpleJSONRPCServer as RPCServerBase)
|
SimpleJSONRPCServer as RPCServerBase
|
||||||
except ImportError:
|
except ImportError:
|
||||||
logger.warning(
|
logger.warning(
|
||||||
'jsonrpclib not available, failing back to XML-RPC')
|
'jsonrpclib not available, failing back to XML-RPC')
|
||||||
|
Reference in New Issue
Block a user