Browse Source

remove unused imports

master
undeath 7 years ago
parent
commit
1451c9e3ae
  1. 2
      jmbase/jmbase/commands.py
  2. 1
      jmbase/jmbase/support.py
  3. 3
      jmbase/test/test_base_support.py
  4. 4
      jmbase/test/test_commands.py
  5. 1
      jmbitcoin/jmbitcoin/bci.py
  6. 1
      jmbitcoin/jmbitcoin/secp256k1_deterministic.py
  7. 4
      jmbitcoin/jmbitcoin/secp256k1_main.py
  8. 5
      jmbitcoin/jmbitcoin/secp256k1_transaction.py
  9. 1
      jmbitcoin/test/test_btc_formatting.py
  10. 1
      jmbitcoin/test/test_main.py
  11. 3
      jmclient/jmclient/blockchaininterface.py
  12. 1
      jmclient/jmclient/client_protocol.py
  13. 2
      jmclient/jmclient/commitment_utils.py
  14. 1
      jmclient/jmclient/configure.py
  15. 1
      jmclient/jmclient/jsonrpc.py
  16. 1
      jmclient/jmclient/schedule.py
  17. 2
      jmclient/jmclient/taker.py
  18. 2
      jmclient/jmclient/taker_utils.py
  19. 1
      jmclient/test/test_argon2.py
  20. 2
      jmclient/test/test_blockchaininterface.py
  21. 7
      jmclient/test/test_client_protocol.py
  22. 2
      jmclient/test/test_configure.py
  23. 2
      jmdaemon/jmdaemon/enc_wrapper.py
  24. 7
      jmdaemon/jmdaemon/irc.py
  25. 4
      jmdaemon/jmdaemon/message_channel.py
  26. 6
      jmdaemon/test/dummy_mc.py
  27. 8
      jmdaemon/test/test_daemon_protocol.py
  28. 4
      scripts/joinmarketd.py
  29. 1
      scripts/qtsupport.py
  30. 7
      scripts/sendpayment.py
  31. 2
      scripts/sendtomany.py
  32. 2
      scripts/tumbler.py
  33. 3
      scripts/yield-generator-basic.py

2
jmbase/jmbase/commands.py

@ -4,7 +4,7 @@ Commands defining client-server (daemon)
messaging protocol (*not* Joinmarket p2p protocol). messaging protocol (*not* Joinmarket p2p protocol).
Used for AMP asynchronous messages. Used for AMP asynchronous messages.
""" """
from twisted.protocols.amp import Integer, String, Unicode, Boolean, Command from twisted.protocols.amp import Boolean, Command, Integer, String
from bigstring import BigString from bigstring import BigString
class DaemonNotReady(Exception): class DaemonNotReady(Exception):

1
jmbase/jmbase/support.py

@ -4,7 +4,6 @@ import sys
import logging import logging
import pprint import pprint
import random
from getpass import getpass from getpass import getpass
logFormatter = logging.Formatter( logFormatter = logging.Formatter(

3
jmbase/test/test_base_support.py

@ -1,7 +1,6 @@
#! /usr/bin/env python #! /usr/bin/env python
from __future__ import print_function from __future__ import print_function
from jmbase.support import debug_dump_object, get_password, get_log, joinmarket_alert from jmbase.support import debug_dump_object, joinmarket_alert
import pytest
def test_debug_dump_object(): def test_debug_dump_object():
joinmarket_alert[0] = "dummy jm alert" joinmarket_alert[0] = "dummy jm alert"

4
jmbase/test/test_commands.py

@ -1,12 +1,9 @@
#! /usr/bin/env python #! /usr/bin/env python
from __future__ import print_function from __future__ import print_function
from twisted.python.log import startLogging, err
from twisted.python.log import msg as tmsg
from twisted.internet import protocol, reactor from twisted.internet import protocol, reactor
from twisted.internet.error import (ConnectionLost, ConnectionAborted, from twisted.internet.error import (ConnectionLost, ConnectionAborted,
ConnectionClosed, ConnectionDone) ConnectionClosed, ConnectionDone)
from twisted.protocols.amp import UnknownRemoteError from twisted.protocols.amp import UnknownRemoteError
from twisted.python import failure
from twisted.protocols import amp from twisted.protocols import amp
from twisted.trial import unittest from twisted.trial import unittest
from twisted.internet import reactor, task from twisted.internet import reactor, task
@ -14,7 +11,6 @@ from twisted.internet import reactor, task
from jmbase.commands import * from jmbase.commands import *
import json import json
import pytest
test_completed = False test_completed = False

1
jmbitcoin/jmbitcoin/bci.py

@ -1,7 +1,6 @@
#!/usr/bin/python #!/usr/bin/python
import json, re import json, re
import random import random
import sys
import time import time
import platform import platform
from jmbase.support import get_log from jmbase.support import get_log

1
jmbitcoin/jmbitcoin/secp256k1_deterministic.py

@ -1,7 +1,6 @@
from jmbitcoin.secp256k1_main import * from jmbitcoin.secp256k1_main import *
import hmac import hmac
import hashlib import hashlib
from binascii import hexlify
# Below code ASSUMES binary inputs and compressed pubkeys # Below code ASSUMES binary inputs and compressed pubkeys
MAINNET_PRIVATE = b'\x04\x88\xAD\xE4' MAINNET_PRIVATE = b'\x04\x88\xAD\xE4'

4
jmbitcoin/jmbitcoin/secp256k1_main.py

@ -4,11 +4,7 @@ import binascii
import hashlib import hashlib
import re import re
import sys import sys
import os
import base64 import base64
import time
import random
import hmac
import secp256k1 import secp256k1
#Required only for PoDLE calculation: #Required only for PoDLE calculation:

5
jmbitcoin/jmbitcoin/secp256k1_transaction.py

@ -1,5 +1,8 @@
#!/usr/bin/python #!/usr/bin/python
import binascii, re, json, copy, sys import binascii
import copy
import re
import sys
from jmbitcoin.secp256k1_main import * from jmbitcoin.secp256k1_main import *
from jmbitcoin.bech32 import * from jmbitcoin.bech32 import *
from _functools import reduce from _functools import reduce

1
jmbitcoin/test/test_btc_formatting.py

@ -5,7 +5,6 @@ from __future__ import absolute_import
import jmbitcoin as btc import jmbitcoin as btc
import pytest import pytest
import binascii import binascii
import hashlib
#used in p2sh addresses #used in p2sh addresses
def test_hash160(): def test_hash160():

1
jmbitcoin/test/test_main.py

@ -5,7 +5,6 @@ from __future__ import absolute_import
import jmbitcoin as btc import jmbitcoin as btc
import binascii import binascii
import json
import pytest import pytest
import os import os
testdir = os.path.dirname(os.path.realpath(__file__)) testdir = os.path.dirname(os.path.realpath(__file__))

3
jmclient/jmclient/blockchaininterface.py

@ -164,7 +164,6 @@ class BlockchainInterface(object):
the wallet. Call the callbacks and update the watcher loop state. the wallet. Call the callbacks and update the watcher loop state.
End the loop when the confirmation has been seen (no spent monitoring here). End the loop when the confirmation has been seen (no spent monitoring here).
""" """
pass
@abc.abstractmethod @abc.abstractmethod
def tx_watcher(self, txd, unconfirmfun, confirmfun, spentfun, c, n): def tx_watcher(self, txd, unconfirmfun, confirmfun, spentfun, c, n):
@ -174,7 +173,6 @@ class BlockchainInterface(object):
of confs = c. of confs = c.
TODO: Deal with conflicts correctly. Here just abandons monitoring. TODO: Deal with conflicts correctly. Here just abandons monitoring.
""" """
pass
@abc.abstractmethod @abc.abstractmethod
def pushtx(self, txhex): def pushtx(self, txhex):
@ -924,7 +922,6 @@ class RegtestBitcoinCoreInterface(BitcoinCoreInterface): #pragma: no cover
log.debug( log.debug(
"Failed to generate blocks, looks like the bitcoin daemon \ "Failed to generate blocks, looks like the bitcoin daemon \
has been shut down. Ignoring.") has been shut down. Ignoring.")
pass
def grab_coins(self, receiving_addr, amt=50): def grab_coins(self, receiving_addr, amt=50):
""" """

1
jmclient/jmclient/client_protocol.py

@ -6,7 +6,6 @@ from twisted.internet.error import (ConnectionLost, ConnectionAborted,
from twisted.protocols import amp from twisted.protocols import amp
try: try:
from twisted.internet.ssl import ClientContextFactory from twisted.internet.ssl import ClientContextFactory
from twisted.internet import ssl
except ImportError: except ImportError:
pass pass
from jmbase import commands from jmbase import commands

2
jmclient/jmclient/commitment_utils.py

@ -1,6 +1,6 @@
from __future__ import print_function from __future__ import print_function
import sys, os import sys
import jmclient.btc as btc import jmclient.btc as btc
from jmclient import jm_single, get_p2pk_vbyte, get_p2sh_vbyte from jmclient import jm_single, get_p2pk_vbyte, get_p2sh_vbyte

1
jmclient/jmclient/configure.py

@ -5,7 +5,6 @@ import logging
import threading import threading
import os import os
import binascii import binascii
import sys
from ConfigParser import SafeConfigParser, NoOptionError from ConfigParser import SafeConfigParser, NoOptionError

1
jmclient/jmclient/jsonrpc.py

@ -46,7 +46,6 @@ class JsonRpcConnectionError(Exception):
are wrong. are wrong.
""" """
pass
class JsonRpc(object): class JsonRpc(object):

1
jmclient/jmclient/schedule.py

@ -1,7 +1,6 @@
#!/usr/bin/env python #!/usr/bin/env python
from __future__ import print_function from __future__ import print_function
import copy import copy
from pprint import pformat
from jmclient import (validate_address, rand_exp_array, from jmclient import (validate_address, rand_exp_array,
rand_norm_array, rand_pow_array, jm_single) rand_norm_array, rand_pow_array, jm_single)
"""Utility functions for dealing with Taker schedules. """Utility functions for dealing with Taker schedules.

2
jmclient/jmclient/taker.py

@ -7,7 +7,7 @@ import random
from binascii import hexlify, unhexlify from binascii import hexlify, unhexlify
import btc import btc
from jmclient.configure import jm_single, get_p2pk_vbyte, get_p2sh_vbyte from jmclient.configure import get_p2sh_vbyte, jm_single
from jmbase.support import get_log from jmbase.support import get_log
from jmclient.support import (calc_cj_fee, weighted_order_choose, choose_orders, from jmclient.support import (calc_cj_fee, weighted_order_choose, choose_orders,
choose_sweep_orders) choose_sweep_orders)

2
jmclient/jmclient/taker_utils.py

@ -9,7 +9,7 @@ from binascii import hexlify, unhexlify
from .configure import get_log, jm_single, validate_address from .configure import get_log, jm_single, validate_address
from .schedule import human_readable_schedule_entry, tweak_tumble_schedule from .schedule import human_readable_schedule_entry, tweak_tumble_schedule
from .wallet import BaseWallet, estimate_tx_fee from .wallet import BaseWallet, estimate_tx_fee
from .btc import mktx, serialize, deserialize, sign, txhash from .btc import deserialize, mktx, serialize, txhash
log = get_log() log = get_log()
""" """

1
jmclient/test/test_argon2.py

@ -1,7 +1,6 @@
from __future__ import print_function, absolute_import, division, unicode_literals from __future__ import print_function, absolute_import, division, unicode_literals
from jmclient import Argon2Hash, get_random_bytes from jmclient import Argon2Hash, get_random_bytes
import pytest
def test_argon2_sanity(): def test_argon2_sanity():

2
jmclient/test/test_blockchaininterface.py

@ -3,7 +3,7 @@ from __future__ import absolute_import, print_function
"""Blockchaininterface functionality tests.""" """Blockchaininterface functionality tests."""
import binascii import binascii
from commontest import create_wallet_for_sync, make_sign_and_push from commontest import create_wallet_for_sync
import pytest import pytest
from jmclient import load_program_config, jm_single, sync_wallet, get_log from jmclient import load_program_config, jm_single, sync_wallet, get_log

7
jmclient/test/test_client_protocol.py

@ -2,24 +2,19 @@
from __future__ import absolute_import from __future__ import absolute_import
'''test client-protocol interfacae.''' '''test client-protocol interfacae.'''
import pytest
from jmclient import (get_schedule, load_program_config, start_reactor, from jmclient import (get_schedule, load_program_config, start_reactor,
Taker, get_log, JMClientProtocolFactory, jm_single) Taker, get_log, JMClientProtocolFactory, jm_single)
from jmclient.client_protocol import JMProtocolError, JMTakerClientProtocol from jmclient.client_protocol import JMTakerClientProtocol
import os
from twisted.python.log import startLogging, err
from twisted.python.log import msg as tmsg from twisted.python.log import msg as tmsg
from twisted.internet import protocol, reactor, task from twisted.internet import protocol, reactor, task
from twisted.internet.error import (ConnectionLost, ConnectionAborted, from twisted.internet.error import (ConnectionLost, ConnectionAborted,
ConnectionClosed, ConnectionDone) ConnectionClosed, ConnectionDone)
from twisted.protocols.amp import UnknownRemoteError from twisted.protocols.amp import UnknownRemoteError
from twisted.python import failure
from twisted.protocols import amp from twisted.protocols import amp
from twisted.trial import unittest from twisted.trial import unittest
from jmbase.commands import * from jmbase.commands import *
from taker_test_data import t_raw_signed_tx from taker_test_data import t_raw_signed_tx
import json import json
import time
import jmbitcoin as bitcoin import jmbitcoin as bitcoin
import twisted import twisted

2
jmclient/test/test_configure.py

@ -8,8 +8,6 @@ from jmclient import (load_program_config, jm_single, get_irc_mchannels,
JsonRpcConnectionError) JsonRpcConnectionError)
from jmclient.configure import (get_config_irc_channel, get_p2sh_vbyte, from jmclient.configure import (get_config_irc_channel, get_p2sh_vbyte,
get_p2pk_vbyte, get_blockchain_interface_instance) get_p2pk_vbyte, get_blockchain_interface_instance)
import jmbitcoin as bitcoin
import copy
import os import os
def test_attribute_dict(): def test_attribute_dict():

2
jmdaemon/jmdaemon/enc_wrapper.py

@ -8,8 +8,6 @@ from __future__ import absolute_import, print_function
import binascii import binascii
import base64 import base64
import string
import random
from libnacl import public from libnacl import public

7
jmdaemon/jmdaemon/irc.py

@ -1,17 +1,10 @@
from __future__ import absolute_import, print_function from __future__ import absolute_import, print_function
import base64
import random
import socket
import ssl
#TODO: SSL support (can it be done without back-end openssl?) #TODO: SSL support (can it be done without back-end openssl?)
import threading
import time
from twisted.internet import reactor, protocol from twisted.internet import reactor, protocol
from twisted.internet.endpoints import TCP4ClientEndpoint from twisted.internet.endpoints import TCP4ClientEndpoint
from twisted.application.internet import ClientService from twisted.application.internet import ClientService
from twisted.internet.ssl import ClientContextFactory from twisted.internet.ssl import ClientContextFactory
from twisted.logger import Logger
from twisted.words.protocols import irc from twisted.words.protocols import irc
from twisted.internet.error import (ConnectionLost, ConnectionAborted, from twisted.internet.error import (ConnectionLost, ConnectionAborted,
ConnectionClosed, ConnectionDone) ConnectionClosed, ConnectionDone)

4
jmdaemon/jmdaemon/message_channel.py

@ -1,6 +1,8 @@
#! /usr/bin/env python #! /usr/bin/env python
from __future__ import print_function from __future__ import print_function
import base64, abc, threading, time import abc
import base64
import threading
from jmdaemon import ( from jmdaemon import (
encrypt_encode, decode_decrypt, COMMAND_PREFIX, ORDER_KEYS, encrypt_encode, decode_decrypt, COMMAND_PREFIX, ORDER_KEYS,
NICK_HASH_LENGTH, NICK_MAX_ENCODED, JM_VERSION, JOINMARKET_NICK_HEADER, NICK_HASH_LENGTH, NICK_MAX_ENCODED, JM_VERSION, JOINMARKET_NICK_HEADER,

6
jmdaemon/test/dummy_mc.py

@ -1,10 +1,5 @@
from __future__ import absolute_import, print_function from __future__ import absolute_import, print_function
import base64
import random
import socket
import ssl
import threading
import time import time
@ -61,7 +56,6 @@ class DummyMessageChannel(MessageChannel):
def _privmsg(self, nick, cmd, message): def _privmsg(self, nick, cmd, message):
"""As for pubmsg """As for pubmsg
""" """
pass
def _announce_orders(self, orderlist): def _announce_orders(self, orderlist):
pass pass
def change_nick(self, new_nick): def change_nick(self, new_nick):

8
jmdaemon/test/test_daemon_protocol.py

@ -2,31 +2,25 @@
from __future__ import absolute_import from __future__ import absolute_import
'''test daemon-protocol interfacae.''' '''test daemon-protocol interfacae.'''
import pytest
from jmdaemon import (JMDaemonServerProtocolFactory, MessageChannelCollection) from jmdaemon import (JMDaemonServerProtocolFactory, MessageChannelCollection)
from jmdaemon.orderbookwatch import OrderbookWatch from jmdaemon.orderbookwatch import OrderbookWatch
from jmdaemon.daemon_protocol import JMDaemonServerProtocol from jmdaemon.daemon_protocol import JMDaemonServerProtocol
from jmdaemon.protocol import (COMMAND_PREFIX, ORDER_KEYS, NICK_HASH_LENGTH, from jmdaemon.protocol import (COMMAND_PREFIX, ORDER_KEYS, NICK_HASH_LENGTH,
NICK_MAX_ENCODED, JM_VERSION, JOINMARKET_NICK_HEADER) NICK_MAX_ENCODED, JM_VERSION, JOINMARKET_NICK_HEADER)
from jmclient import (load_program_config, get_log, jm_single, get_irc_mchannels) from jmclient import (load_program_config, get_log, jm_single, get_irc_mchannels)
import os
from twisted.python.log import startLogging, err
from twisted.python.log import msg as tmsg from twisted.python.log import msg as tmsg
from twisted.internet import protocol, reactor, task from twisted.internet import protocol, reactor, task
from twisted.internet.protocol import ServerFactory, ClientCreator from twisted.internet.protocol import ServerFactory
from twisted.internet.error import (ConnectionLost, ConnectionAborted, from twisted.internet.error import (ConnectionLost, ConnectionAborted,
ConnectionClosed, ConnectionDone) ConnectionClosed, ConnectionDone)
from twisted.protocols.amp import UnknownRemoteError from twisted.protocols.amp import UnknownRemoteError
from twisted.python import failure
from twisted.protocols import amp from twisted.protocols import amp
from twisted.trial import unittest from twisted.trial import unittest
from jmbase.commands import * from jmbase.commands import *
from msgdata import * from msgdata import *
import json import json
import time
import base64 import base64
from dummy_mc import DummyMessageChannel from dummy_mc import DummyMessageChannel
from test_message_channel import make_valid_nick
test_completed = False test_completed = False
end_early = False end_early = False
jlog = get_log() jlog = get_log()

4
scripts/joinmarketd.py

@ -1,6 +1,6 @@
import sys import sys
from twisted.internet import reactor, ssl from twisted.internet import reactor
from twisted.python.log import startLogging, err from twisted.python.log import startLogging
import jmdaemon import jmdaemon
def startup_joinmarketd(host, port, usessl, finalizer=None, finalizer_args=None): def startup_joinmarketd(host, port, usessl, finalizer=None, finalizer_args=None):

1
scripts/qtsupport.py

@ -20,7 +20,6 @@ Qt files for the wizard for initiating a tumbler run.
''' '''
import sys, math, re, logging, Queue import sys, math, re, logging, Queue
from collections import namedtuple from collections import namedtuple
from decimal import Decimal
from PyQt4 import QtCore from PyQt4 import QtCore
from PyQt4.QtGui import * from PyQt4.QtGui import *

7
scripts/sendpayment.py

@ -8,13 +8,8 @@ For notes, see scripts/README.md; in particular, note the use
of "schedules" with the -S flag. of "schedules" with the -S flag.
""" """
import random
import sys import sys
import threading
from optparse import OptionParser
from twisted.internet import reactor from twisted.internet import reactor
import time
import os
import pprint import pprint
from jmclient import ( from jmclient import (
@ -24,7 +19,7 @@ from jmclient import (
sync_wallet, RegtestBitcoinCoreInterface, estimate_tx_fee, direct_send, sync_wallet, RegtestBitcoinCoreInterface, estimate_tx_fee, direct_send,
open_test_wallet_maybe, get_wallet_path) open_test_wallet_maybe, get_wallet_path)
from twisted.python.log import startLogging from twisted.python.log import startLogging
from jmbase.support import get_log, debug_dump_object, get_password from jmbase.support import get_log
from cli_options import get_sendpayment_parser from cli_options import get_sendpayment_parser
log = get_log() log = get_log()

2
scripts/sendtomany.py

@ -6,8 +6,6 @@ for a Joinmarket user, although of course it may be useful
for other reasons). for other reasons).
""" """
import binascii
import sys, os
from pprint import pformat from pprint import pformat
from optparse import OptionParser from optparse import OptionParser
import jmclient.btc as btc import jmclient.btc as btc

2
scripts/tumbler.py

@ -14,7 +14,7 @@ from jmclient import (
tweak_tumble_schedule, human_readable_schedule_entry, schedule_to_text, tweak_tumble_schedule, human_readable_schedule_entry, schedule_to_text,
restart_waiter, get_tumble_log, tumbler_taker_finished_update, restart_waiter, get_tumble_log, tumbler_taker_finished_update,
tumbler_filter_orders_callback) tumbler_filter_orders_callback)
from jmbase.support import get_log, debug_dump_object, get_password from jmbase.support import get_log
from cli_options import get_tumbler_parser from cli_options import get_tumbler_parser
log = get_log() log = get_log()
logsdir = os.path.join(os.path.dirname( logsdir = os.path.join(os.path.dirname(

3
scripts/yield-generator-basic.py

@ -1,9 +1,6 @@
#! /usr/bin/env python #! /usr/bin/env python
from __future__ import absolute_import, print_function from __future__ import absolute_import, print_function
import datetime
import os
import time
from jmclient import (YieldGenerator, YieldGeneratorBasic, ygmain, get_log, from jmclient import (YieldGenerator, YieldGeneratorBasic, ygmain, get_log,
jm_single, calc_cj_fee) jm_single, calc_cj_fee)

Loading…
Cancel
Save