Global imports. knownnodes moved to network.

This commit is contained in:
Dmitri Bogomolov 2020-07-10 18:53:35 +03:00
parent a5b569d449
commit 140383c5dd
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13
47 changed files with 196 additions and 219 deletions

View File

@ -12,11 +12,7 @@ The PyBitmessage startup script
import os import os
import sys import sys
app_dir = os.path.dirname(os.path.abspath(__file__)) import encodings # noqa:F401 for pyqtdeploy
os.chdir(app_dir)
sys.path.insert(0, app_dir)
import depends import depends
depends.check_dependencies() depends.check_dependencies()
@ -40,7 +36,7 @@ from debug import logger # this should go before any threads
from helper_startup import ( from helper_startup import (
adjustHalfOpenConnectionsLimit, start_proxyconfig) adjustHalfOpenConnectionsLimit, start_proxyconfig)
from inventory import Inventory from inventory import Inventory
from knownnodes import readKnownNodes from network.knownnodes import readKnownNodes
# Network objects and threads # Network objects and threads
from network import ( from network import (
BMConnectionPool, Dandelion, AddrThread, AnnounceThread, BMNetworkThread, BMConnectionPool, Dandelion, AddrThread, AnnounceThread, BMNetworkThread,
@ -53,6 +49,9 @@ from threads import (
addressGenerator, objectProcessor, singleCleaner, singleWorker, sqlThread) addressGenerator, objectProcessor, singleCleaner, singleWorker, sqlThread)
app_dir = os.path.dirname(os.path.abspath(__file__))
def _fixSocket(): def _fixSocket():
if sys.platform.startswith('linux'): if sys.platform.startswith('linux'):
socket.SO_BINDTODEVICE = 25 socket.SO_BINDTODEVICE = 25

View File

@ -17,39 +17,33 @@ from sqlite3 import register_adapter
from qtpy import QtCore, QtGui, QtWidgets, QtNetwork from qtpy import QtCore, QtGui, QtWidgets, QtNetwork
import shared import dialogs
import state import settingsmixin
from debug import logger import sound
from tr import _translate import support
from addresses import decodeAddress, addBMIfNotPresent from pybitmessage import (
helper_search, l10n, namecoin, paths, queues, shared, shutdown, state)
from pybitmessage.addresses import decodeAddress, addBMIfNotPresent
from pybitmessage.bmconfigparser import BMConfigParser
from pybitmessage.debug import logger
from pybitmessage.helper_ackPayload import genAckPayload
from pybitmessage.helper_sql import sqlQuery, sqlExecute, sqlExecuteChunked, sqlStoredProcedure
from pybitmessage.network.stats import pendingDownload, pendingUpload
from pybitmessage.proofofwork import getPowType
from pybitmessage.tr import _translate
from account import (
getSortedAccounts, getSortedSubscriptions, accountClass, BMAccount,
GatewayAccount, MailchuckAccount, AccountColor)
from bitmessageui import Ui_MainWindow from bitmessageui import Ui_MainWindow
from bmconfigparser import BMConfigParser
import namecoin
from messageview import MessageView
from foldertree import ( from foldertree import (
AccountMixin, Ui_FolderWidget, Ui_AddressWidget, Ui_SubscriptionWidget, AccountMixin, Ui_FolderWidget, Ui_AddressWidget, Ui_SubscriptionWidget,
MessageList_AddressWidget, MessageList_SubjectWidget, MessageList_AddressWidget, MessageList_SubjectWidget,
Ui_AddressBookWidgetItemLabel, Ui_AddressBookWidgetItemAddress, Ui_AddressBookWidgetItemLabel, Ui_AddressBookWidgetItemAddress,
MessageList_TimeWidget) MessageList_TimeWidget)
import settingsmixin from messageview import MessageView
import support
from helper_ackPayload import genAckPayload
from helper_sql import sqlQuery, sqlExecute, sqlExecuteChunked, sqlStoredProcedure
import helper_search
import l10n
from utils import str_broadcast_subscribers, avatarize
from account import (
getSortedAccounts, getSortedSubscriptions, accountClass, BMAccount,
GatewayAccount, MailchuckAccount, AccountColor)
import dialogs
from network.stats import pendingDownload, pendingUpload
from uisignaler import UISignaler
import paths
from proofofwork import getPowType
import queues
import shutdown
from statusbar import BMStatusBar from statusbar import BMStatusBar
import sound from uisignaler import UISignaler
from utils import str_broadcast_subscribers, avatarize
# This is needed for tray icon # This is needed for tray icon
import bitmessage_icons_rc # noqa:F401 pylint: disable=unused-import import bitmessage_icons_rc # noqa:F401 pylint: disable=unused-import

View File

@ -8,14 +8,14 @@ import re
import sys import sys
import time import time
import queues from pybitmessage import queues
from addresses import decodeAddress from pybitmessage.addresses import decodeAddress
from bmconfigparser import BMConfigParser from pybitmessage.bmconfigparser import BMConfigParser
from helper_ackPayload import genAckPayload from pybitmessage.helper_ackPayload import genAckPayload
from helper_sql import sqlQuery, sqlExecute from pybitmessage.helper_sql import sqlQuery, sqlExecute
from pybitmessage.tr import _translate
from foldertree import AccountMixin from foldertree import AccountMixin
from utils import str_broadcast_subscribers from utils import str_broadcast_subscribers
from tr import _translate
def getSortedAccounts(): def getSortedAccounts():

View File

@ -8,15 +8,15 @@ import hashlib
from qtpy import QtGui, QtWidgets from qtpy import QtGui, QtWidgets
import queues
import widgets import widgets
from pybitmessage import queues
from pybitmessage.addresses import decodeAddress, encodeVarint, addBMIfNotPresent
from pybitmessage.inventory import Inventory
from pybitmessage.tr import _translate
from account import ( from account import (
GatewayAccount, MailchuckAccount, AccountMixin, accountClass, GatewayAccount, MailchuckAccount, AccountMixin, accountClass,
getSortedAccounts getSortedAccounts
) )
from addresses import decodeAddress, encodeVarint, addBMIfNotPresent
from inventory import Inventory
from tr import _translate
class AddressCheckMixin(object): class AddressCheckMixin(object):

View File

@ -7,10 +7,11 @@ from Queue import Empty
from qtpy import QtGui from qtpy import QtGui
from addresses import decodeAddress, addBMIfNotPresent from pybitmessage.addresses import decodeAddress, addBMIfNotPresent
from pybitmessage.queues import (
apiAddressGeneratorReturnQueue, addressGeneratorQueue)
from pybitmessage.tr import _translate
from account import getSortedAccounts from account import getSortedAccounts
from queues import apiAddressGeneratorReturnQueue, addressGeneratorQueue
from tr import _translate
from utils import str_chan from utils import str_chan

View File

@ -1,15 +1,17 @@
# pylint: skip-file # pylint: skip-file
# flake8: noqa # flake8: noqa
from qtpy import QtCore, QtGui, QtWidgets from qtpy import QtCore, QtGui, QtWidgets
from tr import _translate
from bmconfigparser import BMConfigParser import settingsmixin
from pybitmessage.bmconfigparser import BMConfigParser
from pybitmessage.tr import _translate
from blacklist import Blacklist
from foldertree import AddressBookCompleter from foldertree import AddressBookCompleter
from messageview import MessageView from messageview import MessageView
from messagecompose import MessageCompose from messagecompose import MessageCompose
import settingsmixin
from networkstatus import NetworkStatus from networkstatus import NetworkStatus
from blacklist import Blacklist
import bitmessage_icons_rc import bitmessage_icons_rc

View File

@ -1,13 +1,13 @@
from qtpy import QtCore, QtGui, QtWidgets from qtpy import QtCore, QtGui, QtWidgets
import widgets import widgets
from addresses import addBMIfNotPresent from pybitmessage.addresses import addBMIfNotPresent
from bmconfigparser import BMConfigParser from pybitmessage.bmconfigparser import BMConfigParser
from pybitmessage.helper_sql import sqlExecute, sqlQuery
from pybitmessage.queues import UISignalQueue
from pybitmessage.tr import _translate
from dialogs import AddAddressDialog from dialogs import AddAddressDialog
from helper_sql import sqlExecute, sqlQuery
from queues import UISignalQueue
from retranslateui import RetranslateMixin from retranslateui import RetranslateMixin
from tr import _translate
from uisignaler import UISignaler from uisignaler import UISignaler
from utils import avatarize from utils import avatarize

View File

@ -4,8 +4,11 @@ All dialogs are available in this module.
from qtpy import QtWidgets from qtpy import QtWidgets
import paths
import widgets import widgets
from pybitmessage import paths
from pybitmessage.tr import _translate
from pybitmessage.version import softwareVersion
from address_dialogs import ( from address_dialogs import (
AddAddressDialog, EmailGatewayDialog, NewAddressDialog, AddAddressDialog, EmailGatewayDialog, NewAddressDialog,
NewSubscriptionDialog, RegenerateAddressesDialog, NewSubscriptionDialog, RegenerateAddressesDialog,
@ -13,8 +16,7 @@ from address_dialogs import (
) )
from newchandialog import NewChanDialog from newchandialog import NewChanDialog
from settings import SettingsDialog from settings import SettingsDialog
from tr import _translate
from version import softwareVersion
__all__ = [ __all__ = [
"NewChanDialog", "AddAddressDialog", "NewAddressDialog", "NewChanDialog", "AddAddressDialog", "NewAddressDialog",

View File

@ -8,10 +8,10 @@ from cgi import escape
from qtpy import QtCore, QtGui, QtWidgets from qtpy import QtCore, QtGui, QtWidgets
from bmconfigparser import BMConfigParser from pybitmessage.bmconfigparser import BMConfigParser
from helper_sql import sqlExecute, sqlQuery from pybitmessage.helper_sql import sqlExecute, sqlQuery
from pybitmessage.tr import _translate
from settingsmixin import SettingsMixin from settingsmixin import SettingsMixin
from tr import _translate
from utils import avatarize from utils import avatarize
# for pylupdate # for pylupdate

View File

@ -5,9 +5,9 @@ import os
from qtpy import QtCore, QtWidgets from qtpy import QtCore, QtWidgets
import paths from pybitmessage import paths
from bmconfigparser import BMConfigParser from pybitmessage.bmconfigparser import BMConfigParser
from tr import _translate from pybitmessage.tr import _translate
class LanguageBox(QtWidgets.QComboBox): class LanguageBox(QtWidgets.QComboBox):

View File

@ -1,5 +1,6 @@
from qtpy import QtCore, QtWidgets from qtpy import QtCore, QtWidgets
from tr import _translate
from pybitmessage.tr import _translate
class MessageCompose(QtWidgets.QTextEdit): class MessageCompose(QtWidgets.QTextEdit):

View File

@ -6,8 +6,8 @@ zoom and URL click warning popup.
from qtpy import QtCore, QtGui, QtWidgets from qtpy import QtCore, QtGui, QtWidgets
from pybitmessage.tr import _translate
from safehtmlparser import SafeHTMLParser from safehtmlparser import SafeHTMLParser
from tr import _translate
class MessageView(QtWidgets.QTextBrowser): class MessageView(QtWidgets.QTextBrowser):

View File

@ -6,15 +6,12 @@ import time
from qtpy import QtCore, QtGui, QtWidgets from qtpy import QtCore, QtGui, QtWidgets
import knownnodes
import l10n
import network.stats
import state
import widgets import widgets
from inventory import Inventory from pybitmessage import l10n, state
from network import BMConnectionPool from pybitmessage.inventory import Inventory
from pybitmessage.network import BMConnectionPool, knownnodes, stats
from pybitmessage.tr import _translate
from retranslateui import RetranslateMixin from retranslateui import RetranslateMixin
from tr import _translate
from uisignaler import UISignaler from uisignaler import UISignaler
@ -79,7 +76,7 @@ class NetworkStatus(QtWidgets.QWidget, RetranslateMixin):
"""Update the counter for number of objects to be synced""" """Update the counter for number of objects to be synced"""
self.labelSyncStatus.setText(_translate( self.labelSyncStatus.setText(_translate(
"networkstatus", "Object(s) to be synced: %n", None, "networkstatus", "Object(s) to be synced: %n", None,
network.stats.pendingDownload() + network.stats.pendingUpload())) stats.pendingDownload() + stats.pendingUpload()))
def updateNumberOfMessagesProcessed(self): def updateNumberOfMessagesProcessed(self):
"""Update the counter for number of processed messages""" """Update the counter for number of processed messages"""
@ -109,13 +106,13 @@ class NetworkStatus(QtWidgets.QWidget, RetranslateMixin):
""" """
self.labelBytesRecvCount.setText(_translate( self.labelBytesRecvCount.setText(_translate(
"networkstatus", "Down: {0}/s Total: {1}").format( "networkstatus", "Down: {0}/s Total: {1}").format(
self.formatByteRate(network.stats.downloadSpeed()), self.formatByteRate(stats.downloadSpeed()),
self.formatBytes(network.stats.receivedBytes()) self.formatBytes(stats.receivedBytes())
)) ))
self.labelBytesSentCount.setText(_translate( self.labelBytesSentCount.setText(_translate(
"networkstatus", "Up: {0}/s Total: {1}").format( "networkstatus", "Up: {0}/s Total: {1}").format(
self.formatByteRate(network.stats.uploadSpeed()), self.formatByteRate(stats.uploadSpeed()),
self.formatBytes(network.stats.sentBytes()) self.formatBytes(stats.sentBytes())
)) ))
def updateNetworkStatusTab(self, outbound, add, destination): def updateNetworkStatusTab(self, outbound, add, destination):

View File

@ -5,11 +5,11 @@ NewChanDialog class definition
from qtpy import QtCore, QtWidgets from qtpy import QtCore, QtWidgets
import widgets import widgets
from addresses import addBMIfNotPresent from pybitmessage.addresses import addBMIfNotPresent
from addressvalidator import AddressValidator, PassPhraseValidator from pybitmessage.queues import (
from queues import (
addressGeneratorQueue, apiAddressGeneratorReturnQueue, UISignalQueue) addressGeneratorQueue, apiAddressGeneratorReturnQueue, UISignalQueue)
from tr import _translate from pybitmessage.tr import _translate
from addressvalidator import AddressValidator, PassPhraseValidator
from utils import str_chan from utils import str_chan

View File

@ -9,20 +9,15 @@ import tempfile
from qtpy import QtCore, QtGui, QtWidgets from qtpy import QtCore, QtGui, QtWidgets
import debug
import defaults
import knownnodes
import namecoin
import openclpow
import paths
import queues
import state
import widgets import widgets
from bmconfigparser import BMConfigParser from pybitmessage import (
from helper_sql import sqlExecute, sqlStoredProcedure debug, defaults, namecoin, openclpow, paths, queues, state)
from helper_startup import start_proxyconfig from pybitmessage.bmconfigparser import BMConfigParser
from network.asyncore_pollchoose import set_rates from pybitmessage.helper_sql import sqlExecute, sqlStoredProcedure
from tr import _translate from pybitmessage.helper_startup import start_proxyconfig
from pybitmessage.network import knownnodes
from pybitmessage.network.asyncore_pollchoose import set_rates
from pybitmessage.tr import _translate
def getSOCKSProxyType(config): def getSOCKSProxyType(config):

View File

@ -1,6 +1,7 @@
from qtpy import QtWidgets
from time import time from time import time
from qtpy import QtWidgets
class BMStatusBar(QtWidgets.QStatusBar): class BMStatusBar(QtWidgets.QStatusBar):
duration = 10000 duration = 10000

View File

@ -7,21 +7,17 @@ import sys
import time import time
import account import account
import defaults from pybitmessage import defaults, paths, proofofwork, queues, state
import network.stats from pybitmessage.bmconfigparser import BMConfigParser
import paths from pybitmessage.helper_sql import sqlExecute, sqlQuery
import proofofwork from pybitmessage.l10n import getTranslationLanguage
import queues from pybitmessage.network import stats
import state from pybitmessage.openclpow import openclEnabled
from bmconfigparser import BMConfigParser from pybitmessage.pyelliptic.openssl import OpenSSL
from pybitmessage.tr import _translate
from pybitmessage.version import softwareVersion
from foldertree import AccountMixin from foldertree import AccountMixin
from helper_sql import sqlExecute, sqlQuery
from l10n import getTranslationLanguage
from openclpow import openclEnabled
from pyelliptic.openssl import OpenSSL
from settings import getSOCKSProxyType from settings import getSOCKSProxyType
from tr import _translate
from version import softwareVersion
# this is BM support address going to Peter Surda # this is BM support address going to Peter Surda
@ -157,7 +153,7 @@ def createSupportMessage(myapp):
locale = getTranslationLanguage() locale = getTranslationLanguage()
socks = getSOCKSProxyType(BMConfigParser()) or 'N/A' socks = getSOCKSProxyType(BMConfigParser()) or 'N/A'
upnp = BMConfigParser().safeGet('bitmessagesettings', 'upnp', 'N/A') upnp = BMConfigParser().safeGet('bitmessagesettings', 'upnp', 'N/A')
connectedhosts = len(network.stats.connectedHostsList()) connectedhosts = len(stats.connectedHostsList())
myapp.ui.textEditMessage.setText(SUPPORT_MESSAGE.format( myapp.ui.textEditMessage.setText(SUPPORT_MESSAGE.format(
version, osname, architecture, pythonversion, opensslversion, qtapi, version, osname, architecture, pythonversion, opensslversion, qtapi,

View File

@ -1,8 +1,9 @@
from qtpy import QtCore
import sys import sys
import queues from qtpy import QtCore
from network.node import Peer
from pybitmessage import queues
from pybitmessage.network.node import Peer
class UISignaler(QtCore.QThread): class UISignaler(QtCore.QThread):

View File

@ -3,9 +3,9 @@ import os
from qtpy import QtGui from qtpy import QtGui
import state from pybitmessage import state
from addresses import addBMIfNotPresent from pybitmessage.addresses import addBMIfNotPresent
from bmconfigparser import BMConfigParser from pybitmessage.bmconfigparser import BMConfigParser
str_broadcast_subscribers = '[Broadcast subscribers]' str_broadcast_subscribers = '[Broadcast subscribers]'
str_chan = '[chan]' str_chan = '[chan]'

View File

@ -17,7 +17,7 @@ import helper_inbox
import helper_msgcoding import helper_msgcoding
import helper_sent import helper_sent
import highlevelcrypto import highlevelcrypto
import knownnodes from network import knownnodes
import l10n import l10n
import protocol import protocol
import queues import queues

View File

@ -23,7 +23,7 @@ import gc
import os import os
import time import time
import knownnodes from network import knownnodes
import queues import queues
import state import state
import tr import tr

View File

@ -3,11 +3,11 @@ Announce addresses as they are received from other hosts
""" """
import Queue import Queue
import state from pybitmessage import state
from helper_random import randomshuffle from pybitmessage.helper_random import randomshuffle
from network.assemble import assemble_addr from pybitmessage.queues import addrQueue
from network.connectionpool import BMConnectionPool from assemble import assemble_addr
from queues import addrQueue from connectionpool import BMConnectionPool
from threads import StoppableThread from threads import StoppableThread

View File

@ -6,8 +6,8 @@ import socket
import threading import threading
import time import time
import network.asyncore_pollchoose as asyncore import asyncore_pollchoose as asyncore
import state from pybitmessage import state
from threads import BusyError, nonBlocking from threads import BusyError, nonBlocking

View File

@ -3,11 +3,11 @@ Announce myself (node address)
""" """
import time import time
import state from pybitmessage import state
from bmconfigparser import BMConfigParser from pybitmessage.bmconfigparser import BMConfigParser
from network.assemble import assemble_addr from assemble import assemble_addr
from network.connectionpool import BMConnectionPool from connectionpool import BMConnectionPool
from network.udp import UDPSocket from udp import UDPSocket
from node import Peer from node import Peer
from threads import StoppableThread from threads import StoppableThread

View File

@ -3,10 +3,10 @@ Create bitmessage protocol command packets
""" """
import struct import struct
import addresses from pybitmessage import addresses
from network.constants import MAX_ADDR_COUNT from pybitmessage.protocol import CreatePacket, encodeHost
from network.node import Peer from constants import MAX_ADDR_COUNT
from protocol import CreatePacket, encodeHost from node import Peer
def assemble_addr(peerList): def assemble_addr(peerList):

View File

@ -19,7 +19,7 @@ from errno import (
) )
from threading import current_thread from threading import current_thread
import helper_random from pybitmessage import helper_random
try: try:
from errno import WSAEWOULDBLOCK from errno import WSAEWOULDBLOCK

View File

@ -4,11 +4,10 @@ BMObject and it's exceptions.
import logging import logging
import time import time
import protocol from pybitmessage import protocol, state
import state from pybitmessage.addresses import calculateInventoryHash
from addresses import calculateInventoryHash from pybitmessage.inventory import Inventory
from inventory import Inventory from dandelion import Dandelion
from network.dandelion import Dandelion
logger = logging.getLogger('default') logger = logging.getLogger('default')

View File

@ -10,28 +10,26 @@ import struct
import time import time
from binascii import hexlify from binascii import hexlify
import addresses
import connectionpool import connectionpool
import knownnodes import knownnodes
import protocol from pybitmessage import addresses, protocol, state
import state from pybitmessage.bmconfigparser import BMConfigParser
from bmconfigparser import BMConfigParser from pybitmessage.inventory import Inventory
from inventory import Inventory from pybitmessage.queues import invQueue, objectProcessorQueue, portCheckerQueue
from network.advanceddispatcher import AdvancedDispatcher from advanceddispatcher import AdvancedDispatcher
from network.bmobject import ( from bmobject import (
BMObject, BMObjectAlreadyHaveError, BMObjectExpiredError, BMObject, BMObjectAlreadyHaveError, BMObjectExpiredError,
BMObjectInsufficientPOWError, BMObjectInvalidDataError, BMObjectInsufficientPOWError, BMObjectInvalidDataError,
BMObjectInvalidError, BMObjectUnwantedStreamError BMObjectInvalidError, BMObjectUnwantedStreamError
) )
from network.constants import ( from constants import (
ADDRESS_ALIVE, MAX_MESSAGE_SIZE, MAX_OBJECT_COUNT, ADDRESS_ALIVE, MAX_MESSAGE_SIZE, MAX_OBJECT_COUNT,
MAX_OBJECT_PAYLOAD_SIZE, MAX_TIME_OFFSET MAX_OBJECT_PAYLOAD_SIZE, MAX_TIME_OFFSET
) )
from network.dandelion import Dandelion from dandelion import Dandelion
from network.proxy import ProxyError from proxy import ProxyError
from node import Node, Peer from node import Node, Peer
from objectracker import ObjectTracker, missingObjects from objectracker import ObjectTracker, missingObjects
from queues import invQueue, objectProcessorQueue, portCheckerQueue
from randomtrackingdict import RandomTrackingDict from randomtrackingdict import RandomTrackingDict
logger = logging.getLogger('default') logger = logging.getLogger('default')

View File

@ -6,10 +6,9 @@ import logging
import random # nosec import random # nosec
import knownnodes import knownnodes
import protocol from pybitmessage import protocol, state
import state from pybitmessage.bmconfigparser import BMConfigParser
from bmconfigparser import BMConfigParser from pybitmessage.queues import Queue, portCheckerQueue
from queues import Queue, portCheckerQueue
logger = logging.getLogger('default') logger = logging.getLogger('default')

View File

@ -9,15 +9,13 @@ import sys
import time import time
import asyncore_pollchoose as asyncore import asyncore_pollchoose as asyncore
import helper_random
import knownnodes import knownnodes
import protocol from pybitmessage import helper_random, protocol, state
import state from pybitmessage.bmconfigparser import BMConfigParser
from bmconfigparser import BMConfigParser from pybitmessage.singleton import Singleton
from connectionchooser import chooseConnection from connectionchooser import chooseConnection
from node import Peer from node import Peer
from proxy import Proxy from proxy import Proxy
from singleton import Singleton
from tcp import ( from tcp import (
bootstrap, Socks4aBMConnection, Socks5BMConnection, bootstrap, Socks4aBMConnection, Socks5BMConnection,
TCPConnection, TCPServer) TCPConnection, TCPServer)

View File

@ -8,9 +8,9 @@ from threading import RLock
from time import time from time import time
import connectionpool import connectionpool
import state from pybitmessage import state
from queues import invQueue from pybitmessage.queues import invQueue
from singleton import Singleton from pybitmessage.singleton import Singleton
# randomise routes after 600 seconds # randomise routes after 600 seconds
REASSIGN_INTERVAL = 600 REASSIGN_INTERVAL = 600

View File

@ -3,12 +3,10 @@
""" """
import time import time
import addresses
import helper_random
import protocol
from dandelion import Dandelion from dandelion import Dandelion
from inventory import Inventory from pybitmessage import addresses, helper_random, protocol
from network.connectionpool import BMConnectionPool from pybitmessage.inventory import Inventory
from connectionpool import BMConnectionPool
from objectracker import missingObjects from objectracker import missingObjects
from threads import StoppableThread from threads import StoppableThread

View File

@ -5,12 +5,10 @@ import Queue
import random import random
from time import time from time import time
import addresses from pybitmessage import addresses, protocol, state
import protocol from pybitmessage.queues import invQueue
import state from connectionpool import BMConnectionPool
from network.connectionpool import BMConnectionPool from dandelion import Dandelion
from network.dandelion import Dandelion
from queues import invQueue
from threads import StoppableThread from threads import StoppableThread

View File

@ -9,9 +9,9 @@ import pickle
import threading import threading
import time import time
import state from pybitmessage import state
from bmconfigparser import BMConfigParser from pybitmessage.bmconfigparser import BMConfigParser
from network.node import Peer from node import Peer
knownNodesLock = threading.Lock() knownNodesLock = threading.Lock()
"""Thread lock for knownnodes modification""" """Thread lock for knownnodes modification"""

View File

@ -1,10 +1,10 @@
""" """
A thread to handle network concerns A thread to handle network concerns
""" """
import network.asyncore_pollchoose as asyncore import asyncore_pollchoose as asyncore
import state from connectionpool import BMConnectionPool
from network.connectionpool import BMConnectionPool from pybitmessage import state
from queues import excQueue from pybitmessage.queues import excQueue
from threads import StoppableThread from threads import StoppableThread

View File

@ -4,8 +4,8 @@ Module for tracking objects
import time import time
from threading import RLock from threading import RLock
import network.connectionpool import connectionpool
from network.dandelion import Dandelion from dandelion import Dandelion
from randomtrackingdict import RandomTrackingDict from randomtrackingdict import RandomTrackingDict
haveBloom = False haveBloom = False
@ -100,7 +100,7 @@ class ObjectTracker(object):
def handleReceivedObject(self, streamNumber, hashid): def handleReceivedObject(self, streamNumber, hashid):
"""Handling received object""" """Handling received object"""
for i in network.connectionpool.BMConnectionPool().connections(): for i in connectionpool.BMConnectionPool().connections():
if not i.fullyEstablished: if not i.fullyEstablished:
continue continue
try: try:

View File

@ -7,8 +7,8 @@ import socket
import time import time
import asyncore_pollchoose as asyncore import asyncore_pollchoose as asyncore
from pybitmessage.bmconfigparser import BMConfigParser
from advanceddispatcher import AdvancedDispatcher from advanceddispatcher import AdvancedDispatcher
from bmconfigparser import BMConfigParser
from node import Peer from node import Peer
logger = logging.getLogger('default') logger = logging.getLogger('default')

View File

@ -5,7 +5,7 @@ import random
from threading import RLock from threading import RLock
from time import time from time import time
import helper_random from pybitmessage import helper_random
class RandomTrackingDict(object): class RandomTrackingDict(object):

View File

@ -5,10 +5,10 @@ import errno
import Queue import Queue
import socket import socket
import state from pybitmessage import state
from network.advanceddispatcher import UnknownStateError from pybitmessage.queues import receiveDataQueue
from network.connectionpool import BMConnectionPool from advanceddispatcher import UnknownStateError
from queues import receiveDataQueue from connectionpool import BMConnectionPool
from threads import StoppableThread from threads import StoppableThread

View File

@ -4,7 +4,7 @@ Network statistics
import time import time
import asyncore_pollchoose as asyncore import asyncore_pollchoose as asyncore
from network.connectionpool import BMConnectionPool from connectionpool import BMConnectionPool
from objectracker import missingObjects from objectracker import missingObjects

View File

@ -8,27 +8,25 @@ import random
import socket import socket
import time import time
import addresses
import asyncore_pollchoose as asyncore import asyncore_pollchoose as asyncore
import connectionpool import connectionpool
import helper_random
import knownnodes import knownnodes
import protocol from pybitmessage import addresses, helper_random, protocol, state
import state from pybitmessage.bmconfigparser import BMConfigParser
from bmconfigparser import BMConfigParser from pybitmessage.helper_random import randomBytes
from helper_random import randomBytes from pybitmessage.inventory import Inventory
from inventory import Inventory from pybitmessage.queues import invQueue, receiveDataQueue, UISignalQueue
from network.advanceddispatcher import AdvancedDispatcher from advanceddispatcher import AdvancedDispatcher
from network.assemble import assemble_addr from assemble import assemble_addr
from network.bmproto import BMProto from bmproto import BMProto
from network.constants import MAX_OBJECT_COUNT from constants import MAX_OBJECT_COUNT
from network.dandelion import Dandelion from dandelion import Dandelion
from network.objectracker import ObjectTracker from objectracker import ObjectTracker
from network.socks4a import Socks4aConnection from socks4a import Socks4aConnection
from network.socks5 import Socks5Connection from socks5 import Socks5Connection
from network.tls import TLSDispatcher from tls import TLSDispatcher
from node import Peer from node import Peer
from queues import invQueue, receiveDataQueue, UISignalQueue
logger = logging.getLogger('default') logger = logging.getLogger('default')

View File

@ -5,12 +5,12 @@ import logging
import socket import socket
import time import time
import protocol from pybitmessage import protocol, state
import state from pybitmessage.queues import receiveDataQueue
from bmproto import BMProto from bmproto import BMProto
from node import Peer from node import Peer
from objectracker import ObjectTracker from objectracker import ObjectTracker
from queues import receiveDataQueue
logger = logging.getLogger('default') logger = logging.getLogger('default')

View File

@ -3,11 +3,10 @@
""" """
import time import time
import helper_random from pybitmessage import helper_random, protocol
import protocol from pybitmessage.inventory import Inventory
from inventory import Inventory from connectionpool import BMConnectionPool
from network.connectionpool import BMConnectionPool from dandelion import Dandelion
from network.dandelion import Dandelion
from randomtrackingdict import RandomTrackingDict from randomtrackingdict import RandomTrackingDict
from threads import StoppableThread from threads import StoppableThread

View File

@ -8,7 +8,7 @@ import state
from debug import logger from debug import logger
from helper_sql import sqlQuery, sqlStoredProcedure from helper_sql import sqlQuery, sqlStoredProcedure
from inventory import Inventory from inventory import Inventory
from knownnodes import saveKnownNodes from network.knownnodes import saveKnownNodes
from network import StoppableThread from network import StoppableThread
from queues import ( from queues import (
addressGeneratorQueue, objectProcessorQueue, UISignalQueue, workerQueue) addressGeneratorQueue, objectProcessorQueue, UISignalQueue, workerQueue)

View File

@ -7,7 +7,7 @@ from binascii import hexlify, unhexlify
from os import listdir, makedirs, path, remove, rmdir from os import listdir, makedirs, path, remove, rmdir
from threading import RLock from threading import RLock
from paths import lookupAppdataFolder from pybitmessage.paths import lookupAppdataFolder
from storage import InventoryItem, InventoryStorage from storage import InventoryItem, InventoryStorage

View File

@ -5,7 +5,8 @@ import sqlite3
import time import time
from threading import RLock from threading import RLock
from helper_sql import SqlBulkExecute, sqlExecute, sqlQuery
from pybitmessage.helper_sql import SqlBulkExecute, sqlExecute, sqlQuery
from storage import InventoryItem, InventoryStorage from storage import InventoryItem, InventoryStorage

View File

@ -12,7 +12,7 @@ from random import randint
from urlparse import urlparse from urlparse import urlparse
from xml.dom.minidom import Document, parseString from xml.dom.minidom import Document, parseString
import knownnodes from network import knownnodes
import queues import queues
import state import state
import tr import tr