From d56191ebba15d473d6dc72a3d6b92b2f7797470c Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Thu, 16 Jul 2020 17:05:32 +0300 Subject: [PATCH] Move knownnodes module into network package --- src/bitmessagemain.py | 2 +- src/bitmessageqt/networkstatus.py | 3 +-- src/bitmessageqt/settings.py | 2 +- src/class_objectProcessor.py | 3 +-- src/class_singleCleaner.py | 3 +-- src/class_singleWorker.py | 3 +-- src/{ => network}/knownnodes.py | 0 src/shutdown.py | 2 +- src/tests/core.py | 3 +-- src/upnp.py | 3 +-- 10 files changed, 9 insertions(+), 15 deletions(-) rename src/{ => network}/knownnodes.py (100%) diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index 9fa9c475..0d766568 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -40,12 +40,12 @@ from debug import logger # this should go before any threads from helper_startup import ( adjustHalfOpenConnectionsLimit, start_proxyconfig) from inventory import Inventory -from knownnodes import readKnownNodes # Network objects and threads from network import ( BMConnectionPool, Dandelion, AddrThread, AnnounceThread, BMNetworkThread, InvThread, ReceiveQueueThread, DownloadThread, UploadThread ) +from network.knownnodes import readKnownNodes from singleinstance import singleinstance # Synchronous threads from threads import ( diff --git a/src/bitmessageqt/networkstatus.py b/src/bitmessageqt/networkstatus.py index 685d9ff8..e7fd9e94 100644 --- a/src/bitmessageqt/networkstatus.py +++ b/src/bitmessageqt/networkstatus.py @@ -6,13 +6,12 @@ import time from PyQt4 import QtCore, QtGui -import knownnodes import l10n import network.stats import state import widgets from inventory import Inventory -from network import BMConnectionPool +from network import BMConnectionPool, knownnodes from retranslateui import RetranslateMixin from tr import _translate from uisignaler import UISignaler diff --git a/src/bitmessageqt/settings.py b/src/bitmessageqt/settings.py index 80295837..32681b57 100644 --- a/src/bitmessageqt/settings.py +++ b/src/bitmessageqt/settings.py @@ -10,7 +10,6 @@ from PyQt4 import QtCore, QtGui import debug import defaults -import knownnodes import namecoin import openclpow import paths @@ -20,6 +19,7 @@ import widgets from bmconfigparser import BMConfigParser from helper_sql import sqlExecute, sqlStoredProcedure from helper_startup import start_proxyconfig +from network import knownnodes from network.asyncore_pollchoose import set_rates from tr import _translate diff --git a/src/class_objectProcessor.py b/src/class_objectProcessor.py index 1f582be3..add86a75 100644 --- a/src/class_objectProcessor.py +++ b/src/class_objectProcessor.py @@ -17,7 +17,6 @@ import helper_inbox import helper_msgcoding import helper_sent import highlevelcrypto -import knownnodes import l10n import protocol import queues @@ -32,7 +31,7 @@ from bmconfigparser import BMConfigParser from fallback import RIPEMD160Hash from helper_ackPayload import genAckPayload from helper_sql import SqlBulkExecute, sqlExecute, sqlQuery -from network import bmproto +from network import bmproto, knownnodes from network.node import Peer # pylint: disable=too-many-locals, too-many-return-statements, too-many-branches, too-many-statements diff --git a/src/class_singleCleaner.py b/src/class_singleCleaner.py index e322574e..03ba1f9c 100644 --- a/src/class_singleCleaner.py +++ b/src/class_singleCleaner.py @@ -23,14 +23,13 @@ import gc import os import time -import knownnodes import queues import state import tr from bmconfigparser import BMConfigParser from helper_sql import sqlExecute, sqlQuery from inventory import Inventory -from network import BMConnectionPool, StoppableThread +from network import BMConnectionPool, knownnodes, StoppableThread #: Equals 4 weeks. You could make this longer if you want diff --git a/src/class_singleWorker.py b/src/class_singleWorker.py index 287f87c5..699506de 100644 --- a/src/class_singleWorker.py +++ b/src/class_singleWorker.py @@ -17,7 +17,6 @@ import helper_inbox import helper_msgcoding import helper_random import highlevelcrypto -import knownnodes import l10n import proofofwork import protocol @@ -31,7 +30,7 @@ from addresses import ( from bmconfigparser import BMConfigParser from helper_sql import sqlExecute, sqlQuery from inventory import Inventory -from network import StoppableThread +from network import knownnodes, StoppableThread def sizeof_fmt(num, suffix='h/s'): diff --git a/src/knownnodes.py b/src/network/knownnodes.py similarity index 100% rename from src/knownnodes.py rename to src/network/knownnodes.py diff --git a/src/shutdown.py b/src/shutdown.py index 819aa2da..74332a81 100644 --- a/src/shutdown.py +++ b/src/shutdown.py @@ -8,8 +8,8 @@ import state from debug import logger from helper_sql import sqlQuery, sqlStoredProcedure from inventory import Inventory -from knownnodes import saveKnownNodes from network import StoppableThread +from network.knownnodes import saveKnownNodes from queues import ( addressGeneratorQueue, objectProcessorQueue, UISignalQueue, workerQueue) diff --git a/src/tests/core.py b/src/tests/core.py index d33b2117..6ed46ad9 100644 --- a/src/tests/core.py +++ b/src/tests/core.py @@ -11,13 +11,12 @@ import string import time import unittest -import knownnodes import protocol import state from bmconfigparser import BMConfigParser from helper_msgcoding import MsgEncode, MsgDecode from helper_startup import start_proxyconfig -from network import asyncore_pollchoose as asyncore +from network import asyncore_pollchoose as asyncore, knownnodes from network.bmproto import BMProto from network.connectionpool import BMConnectionPool from network.node import Node, Peer diff --git a/src/upnp.py b/src/upnp.py index 99000413..34111afd 100644 --- a/src/upnp.py +++ b/src/upnp.py @@ -12,13 +12,12 @@ from random import randint from urlparse import urlparse from xml.dom.minidom import Document, parseString -import knownnodes import queues import state import tr from bmconfigparser import BMConfigParser from debug import logger -from network import BMConnectionPool, StoppableThread +from network import BMConnectionPool, knownnodes, StoppableThread from network.node import Peer