Imported packages sequencing and formatting

This commit is contained in:
lakshyacis 2020-01-24 19:33:13 +05:30
parent 6139efc377
commit 6f35da4096
No known key found for this signature in database
GPG Key ID: D2C539C8EC63E9EB
24 changed files with 68 additions and 72 deletions

View File

@ -8,7 +8,6 @@ from struct import pack, unpack
from debug import logger
ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"

View File

@ -18,8 +18,6 @@ from binascii import hexlify, unhexlify
from SimpleXMLRPCServer import SimpleXMLRPCRequestHandler, SimpleXMLRPCServer
from struct import pack
from version import softwareVersion
import defaults
import helper_inbox
import helper_sent
@ -42,6 +40,7 @@ from helper_ackPayload import genAckPayload
from helper_sql import SqlBulkExecute, sqlExecute, sqlQuery, sqlStoredProcedure
from inventory import Inventory
from network.threads import StoppableThread
from version import softwareVersion
str_chan = '[chan]'

View File

@ -13,15 +13,15 @@ TODO: fix the following (currently ignored) violations:
"""
import xmlrpclib
import datetime
import imghdr
import ntpath
import json
import socket
import time
import sys
import ntpath
import os
import socket
import sys
import time
import xmlrpclib
from bmconfigparser import BMConfigParser

View File

@ -33,8 +33,8 @@ from struct import pack
import defaults
import shared
import state
import shutdown
import state
from bmconfigparser import BMConfigParser
from debug import logger # this should go before any threads
from helper_startup import (

View File

@ -3,8 +3,8 @@ BMConfigParser class definition and default configuration settings
"""
import ConfigParser
import shutil
import os
import shutil
from datetime import datetime
import state

View File

@ -1,6 +1,6 @@
"""Building osx."""
from glob import glob
import os
from glob import glob
from PyQt4 import QtCore
from setuptools import setup

View File

@ -1,22 +1,22 @@
"""
A thread for creating addresses
"""
import time
import hashlib
import time
from binascii import hexlify
from pyelliptic import arithmetic
from pyelliptic.openssl import OpenSSL
import tr
import queues
import state
import shared
import defaults
import highlevelcrypto
from bmconfigparser import BMConfigParser
import queues
import shared
import state
import tr
from addresses import decodeAddress, encodeAddress, encodeVarint
from bmconfigparser import BMConfigParser
from fallback import RIPEMD160Hash
from network import StoppableThread
from pyelliptic import arithmetic
from pyelliptic.openssl import OpenSSL
class addressGenerator(StoppableThread):

View File

@ -12,31 +12,29 @@ import time
from binascii import hexlify
from subprocess import call # nosec
import highlevelcrypto
import knownnodes
import shared
from addresses import (
calculateInventoryHash, decodeAddress, decodeVarint, encodeAddress,
encodeVarint, varintDecodeError
)
from bmconfigparser import BMConfigParser
import helper_bitcoin
import helper_inbox
import helper_msgcoding
import helper_sent
from helper_sql import SqlBulkExecute, sqlExecute, sqlQuery
from helper_ackPayload import genAckPayload
from network import bmproto
from network.node import Peer
import highlevelcrypto
import knownnodes
import l10n
import protocol
import queues
import shared
import state
import tr
from addresses import (
calculateInventoryHash, decodeAddress, decodeVarint,
encodeAddress, encodeVarint, varintDecodeError
)
from bmconfigparser import BMConfigParser
from fallback import RIPEMD160Hash
import l10n
from helper_ackPayload import genAckPayload
from helper_sql import SqlBulkExecute, sqlExecute, sqlQuery
from network import bmproto
from network.node import Peer
# pylint: disable=too-many-locals, too-many-return-statements, too-many-branches, too-many-statements
logger = logging.getLogger('default')

View File

@ -29,7 +29,7 @@ import shared
import state
import tr
from bmconfigparser import BMConfigParser
from helper_sql import sqlQuery, sqlExecute
from helper_sql import sqlExecute, sqlQuery
from inventory import Inventory
from network import BMConnectionPool, StoppableThread

View File

@ -2,15 +2,12 @@
sqlThread is defined here
"""
import threading
from bmconfigparser import BMConfigParser
import sqlite3
import time
import shutil # used for moving the messages.dat file
import sys
import os
from debug import logger
import shutil # used for moving the messages.dat file
import sqlite3
import sys
import threading
import time
import helper_sql
import helper_startup
@ -18,6 +15,8 @@ import paths
import queues
import state
import tr
from bmconfigparser import BMConfigParser
from debug import logger
# pylint: disable=attribute-defined-outside-init,protected-access

View File

@ -5,8 +5,8 @@ This module is for generating ack payload
from binascii import hexlify
from struct import pack
import highlevelcrypto
import helper_random
import highlevelcrypto
from addresses import encodeVarint

View File

@ -5,6 +5,11 @@ Message encoding end decoding functions
import string
import zlib
import messagetypes
from bmconfigparser import BMConfigParser
from debug import logger
from tr import _translate
try:
import msgpack
except ImportError:
@ -13,11 +18,6 @@ except ImportError:
except ImportError:
import fallback.umsgpack.umsgpack as msgpack
import messagetypes
from bmconfigparser import BMConfigParser
from debug import logger
from tr import _translate
BITMESSAGE_ENCODING_IGNORE = 0
BITMESSAGE_ENCODING_TRIVIAL = 1
BITMESSAGE_ENCODING_SIMPLE = 2

View File

@ -2,7 +2,9 @@
import os
import random
from pyelliptic.openssl import OpenSSL
NoneType = type(None)

View File

@ -16,8 +16,8 @@ SQLite objects can only be used from one thread.
or isn't thread-safe.
"""
import threading
import Queue
import threading
sqlSubmitQueue = Queue.Queue()
"""the queue for SQL"""

View File

@ -1,8 +1,8 @@
"""The Inventory singleton"""
# TODO make this dynamic, and watch out for frozen, like with messagetypes
import storage.sqlite
import storage.filesystem
import storage.sqlite
from bmconfigparser import BMConfigParser
from singleton import Singleton

View File

@ -7,7 +7,6 @@ import time
from bmconfigparser import BMConfigParser
logger = logging.getLogger('default')

View File

@ -1,6 +1,6 @@
"""This module is for thread start."""
from bitmessagemain import main
import state
from bitmessagemain import main
if __name__ == '__main__':
state.kivy = True

View File

@ -10,11 +10,11 @@ import os
import socket
import sys
from addresses import decodeAddress
from debug import logger
import defaults
import tr # translate
from addresses import decodeAddress
from bmconfigparser import BMConfigParser
from debug import logger
configSection = "bitmessagesettings"

View File

@ -2,14 +2,14 @@
"""
Module for Proof of Work using OpenCL
"""
from struct import pack, unpack
import hashlib
import os
from struct import pack, unpack
from bmconfigparser import BMConfigParser
import paths
from state import shutdown
from bmconfigparser import BMConfigParser
from debug import logger
from state import shutdown
libAvailable = True
ctx = False

View File

@ -8,7 +8,6 @@ import sys
from datetime import datetime
from shutil import move
logger = logging.getLogger('default')
# When using py2exe or py2app, the variable frozen is added to the sys

View File

@ -11,7 +11,7 @@ import socket
import sys
import time
from binascii import hexlify
from struct import pack, unpack, Struct
from struct import Struct, pack, unpack
import defaults
import highlevelcrypto

View File

@ -11,8 +11,8 @@ Return a PIL Image class instance which have generated identicon image.
"""
from PyQt4 import QtGui
from PyQt4.QtCore import QSize, QPointF, Qt
from PyQt4.QtGui import QPixmap, QPainter, QPolygonF
from PyQt4.QtCore import QPointF, QSize, Qt
from PyQt4.QtGui import QPainter, QPixmap, QPolygonF
class IdenticonRendererBase(object):

View File

@ -10,12 +10,11 @@ from __future__ import division
# Libraries.
import hashlib
import os
import sys
import stat
import threading
import subprocess
import sys
import threading
from binascii import hexlify
from pyelliptic import arithmetic
# Project imports.
import highlevelcrypto
@ -25,6 +24,8 @@ from bmconfigparser import BMConfigParser
from debug import logger
from helper_sql import sqlQuery
from pyelliptic import arithmetic
verbose = 1
# This is obsolete with the change to protocol v3

View File

@ -15,6 +15,12 @@ There are also other threads in the `.network` package.
import threading
from class_addressGenerator import addressGenerator
from class_objectProcessor import objectProcessor
from class_singleCleaner import singleCleaner
from class_singleWorker import singleWorker
from class_sqlThread import sqlThread
try:
import prctl
except ImportError:
@ -33,12 +39,6 @@ else:
threading.Thread.__bootstrap_original__ = threading.Thread._Thread__bootstrap
threading.Thread._Thread__bootstrap = _thread_name_hack
from class_addressGenerator import addressGenerator
from class_objectProcessor import objectProcessor
from class_singleCleaner import singleCleaner
from class_singleWorker import singleWorker
from class_sqlThread import sqlThread
__all__ = [
"addressGenerator", "objectProcessor", "singleCleaner", "singleWorker",