From 6139efc377a24efa6238080efaef1caa5f6802a6 Mon Sep 17 00:00:00 2001 From: lakshyacis Date: Fri, 24 Jan 2020 19:46:05 +0530 Subject: [PATCH] Imported packages sequencing and formatting 2 --- src/messagetypes/__init__.py | 2 +- src/network/announcethread.py | 1 - src/network/bmproto.py | 10 +++++----- src/network/receivequeuethread.py | 2 +- src/network/socks4a.py | 2 +- src/network/tls.py | 5 ++--- src/plugins/menu_qrcode.py | 2 +- src/plugins/proxyconfig_stem.py | 2 +- src/plugins/sound_canberra.py | 3 +-- src/pyelliptic/__init__.py | 4 ++-- src/pyelliptic/openssl.py | 4 ++-- src/storage/filesystem.py | 6 +++--- src/storage/sqlite.py | 4 ++-- 13 files changed, 22 insertions(+), 25 deletions(-) diff --git a/src/messagetypes/__init__.py b/src/messagetypes/__init__.py index af6bcdaa..4cae718c 100644 --- a/src/messagetypes/__init__.py +++ b/src/messagetypes/__init__.py @@ -1,6 +1,6 @@ import logging from importlib import import_module -from os import path, listdir +from os import listdir, path from string import lower import messagetypes diff --git a/src/network/announcethread.py b/src/network/announcethread.py index 17c8bcd3..19038ab6 100644 --- a/src/network/announcethread.py +++ b/src/network/announcethread.py @@ -4,7 +4,6 @@ Announce myself (node address) import time import state - from bmconfigparser import BMConfigParser from network.assemble import assemble_addr from network.connectionpool import BMConnectionPool diff --git a/src/network/bmproto.py b/src/network/bmproto.py index d5d3dbe3..2dcd1208 100644 --- a/src/network/bmproto.py +++ b/src/network/bmproto.py @@ -19,9 +19,9 @@ from bmconfigparser import BMConfigParser from inventory import Inventory from network.advanceddispatcher import AdvancedDispatcher from network.bmobject import ( - BMObject, BMObjectInsufficientPOWError, BMObjectInvalidDataError, - BMObjectExpiredError, BMObjectUnwantedStreamError, - BMObjectInvalidError, BMObjectAlreadyHaveError + BMObject, BMObjectAlreadyHaveError, BMObjectExpiredError, + BMObjectInsufficientPOWError, BMObjectInvalidDataError, + BMObjectInvalidError, BMObjectUnwantedStreamError ) from network.constants import ( ADDRESS_ALIVE, MAX_MESSAGE_SIZE, MAX_OBJECT_COUNT, @@ -30,8 +30,8 @@ from network.constants import ( from network.dandelion import Dandelion from network.proxy import ProxyError from node import Node, Peer -from objectracker import missingObjects, ObjectTracker -from queues import objectProcessorQueue, portCheckerQueue, invQueue, addrQueue +from objectracker import ObjectTracker, missingObjects +from queues import addrQueue, invQueue, objectProcessorQueue, portCheckerQueue from randomtrackingdict import RandomTrackingDict logger = logging.getLogger('default') diff --git a/src/network/receivequeuethread.py b/src/network/receivequeuethread.py index 1f5533b3..bf1d8300 100644 --- a/src/network/receivequeuethread.py +++ b/src/network/receivequeuethread.py @@ -6,8 +6,8 @@ import Queue import socket import state -from network.connectionpool import BMConnectionPool from network.advanceddispatcher import UnknownStateError +from network.connectionpool import BMConnectionPool from queues import receiveDataQueue from threads import StoppableThread diff --git a/src/network/socks4a.py b/src/network/socks4a.py index 42eab4b7..0d4310bc 100644 --- a/src/network/socks4a.py +++ b/src/network/socks4a.py @@ -5,7 +5,7 @@ SOCKS4a proxy module import socket import struct -from proxy import Proxy, ProxyError, GeneralProxyError +from proxy import GeneralProxyError, Proxy, ProxyError class Socks4aError(ProxyError): diff --git a/src/network/tls.py b/src/network/tls.py index f756591c..1b325696 100644 --- a/src/network/tls.py +++ b/src/network/tls.py @@ -7,11 +7,10 @@ import socket import ssl import sys -from network.advanceddispatcher import AdvancedDispatcher import network.asyncore_pollchoose as asyncore - -from queues import receiveDataQueue import paths +from network.advanceddispatcher import AdvancedDispatcher +from queues import receiveDataQueue logger = logging.getLogger('default') diff --git a/src/plugins/menu_qrcode.py b/src/plugins/menu_qrcode.py index 63644db6..ea322a49 100644 --- a/src/plugins/menu_qrcode.py +++ b/src/plugins/menu_qrcode.py @@ -6,7 +6,7 @@ A menu plugin showing QR-Code for bitmessage address in modal dialog. import urllib import qrcode -from PyQt4 import QtGui, QtCore +from PyQt4 import QtCore, QtGui from pybitmessage.tr import _translate diff --git a/src/plugins/proxyconfig_stem.py b/src/plugins/proxyconfig_stem.py index bc760ef1..7e8dc089 100644 --- a/src/plugins/proxyconfig_stem.py +++ b/src/plugins/proxyconfig_stem.py @@ -11,8 +11,8 @@ Configure tor proxy and hidden service with * otherwise use stem's 'BEST' version and save onion keys to the new section using *onionhostname* as name for future use. """ -import os import logging +import os import random # noseq import tempfile diff --git a/src/plugins/sound_canberra.py b/src/plugins/sound_canberra.py index 20bd054d..9fea8197 100644 --- a/src/plugins/sound_canberra.py +++ b/src/plugins/sound_canberra.py @@ -3,9 +3,8 @@ Sound theme plugin using pycanberra """ -from pybitmessage.bitmessageqt import sound - import pycanberra +from pybitmessage.bitmessageqt import sound _canberra = pycanberra.Canberra() diff --git a/src/pyelliptic/__init__.py b/src/pyelliptic/__init__.py index 65279ded..dbc1b2af 100644 --- a/src/pyelliptic/__init__.py +++ b/src/pyelliptic/__init__.py @@ -9,11 +9,11 @@ For modern cryptography with ECC, AES, HMAC, Blowfish, ... This is an abandoned package maintained inside of the PyBitmessage. """ -from .openssl import OpenSSL +from .cipher import Cipher from .ecc import ECC from .eccblind import ECCBlind -from .cipher import Cipher from .hash import hmac_sha256, hmac_sha512, pbkdf2 +from .openssl import OpenSSL __version__ = '1.3' diff --git a/src/pyelliptic/openssl.py b/src/pyelliptic/openssl.py index f769f0e3..4933ac44 100644 --- a/src/pyelliptic/openssl.py +++ b/src/pyelliptic/openssl.py @@ -6,9 +6,9 @@ This module loads openssl libs with ctypes and incapsulates needed openssl functionality in class _OpenSSL. """ -# pylint: disable=protected-access -import sys import ctypes +import sys +# pylint: disable=protected-access OpenSSL = None diff --git a/src/storage/filesystem.py b/src/storage/filesystem.py index 571a16c1..b19d9272 100644 --- a/src/storage/filesystem.py +++ b/src/storage/filesystem.py @@ -1,14 +1,14 @@ """ Module for using filesystem (directory with files) for inventory storage """ +import string +import time from binascii import hexlify, unhexlify from os import listdir, makedirs, path, remove, rmdir -import string from threading import RLock -import time from paths import lookupAppdataFolder -from storage import InventoryStorage, InventoryItem +from storage import InventoryItem, InventoryStorage class FilesystemInventory(InventoryStorage): diff --git a/src/storage/sqlite.py b/src/storage/sqlite.py index 7f41abc5..0992c00e 100644 --- a/src/storage/sqlite.py +++ b/src/storage/sqlite.py @@ -5,8 +5,8 @@ import sqlite3 import time from threading import RLock -from helper_sql import sqlQuery, SqlBulkExecute, sqlExecute -from storage import InventoryStorage, InventoryItem +from helper_sql import SqlBulkExecute, sqlExecute, sqlQuery +from storage import InventoryItem, InventoryStorage class SqliteInventory(InventoryStorage): # pylint: disable=too-many-ancestors