Merge pull request #1964 from lbryio/update-aiohttp
update aiohttp and pylint
This commit is contained in:
commit
4fd2d994f2
6 changed files with 15 additions and 18 deletions
|
@ -9,7 +9,7 @@ jobs:
|
||||||
- stage: code quality
|
- stage: code quality
|
||||||
name: "pylint lbrynet"
|
name: "pylint lbrynet"
|
||||||
install:
|
install:
|
||||||
- pip install astroid==2.0.4 pylint
|
- pip install astroid pylint
|
||||||
- pip install git+https://github.com/lbryio/torba.git#egg=torba
|
- pip install git+https://github.com/lbryio/torba.git#egg=torba
|
||||||
- pip install -e .
|
- pip install -e .
|
||||||
script: pylint lbrynet
|
script: pylint lbrynet
|
||||||
|
|
|
@ -67,8 +67,7 @@ class RequestDatagram(KademliaDatagramBase):
|
||||||
def make_ping(cls, from_node_id: bytes, rpc_id: typing.Optional[bytes] = None) -> 'RequestDatagram':
|
def make_ping(cls, from_node_id: bytes, rpc_id: typing.Optional[bytes] = None) -> 'RequestDatagram':
|
||||||
if rpc_id and len(rpc_id) != constants.rpc_id_length:
|
if rpc_id and len(rpc_id) != constants.rpc_id_length:
|
||||||
raise ValueError("invalid rpc id length")
|
raise ValueError("invalid rpc id length")
|
||||||
elif not rpc_id:
|
rpc_id = rpc_id or constants.generate_id()[:constants.rpc_id_length]
|
||||||
rpc_id = constants.generate_id()[:constants.rpc_id_length]
|
|
||||||
if len(from_node_id) != constants.hash_bits // 8:
|
if len(from_node_id) != constants.hash_bits // 8:
|
||||||
raise ValueError("invalid node id")
|
raise ValueError("invalid node id")
|
||||||
return cls(REQUEST_TYPE, rpc_id, from_node_id, b'ping')
|
return cls(REQUEST_TYPE, rpc_id, from_node_id, b'ping')
|
||||||
|
|
|
@ -843,12 +843,12 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||||
amount = self.get_dewies_or_error("amount", amount)
|
amount = self.get_dewies_or_error("amount", amount)
|
||||||
if not amount:
|
if not amount:
|
||||||
raise NullFundsError
|
raise NullFundsError
|
||||||
elif amount < 0:
|
if amount < 0:
|
||||||
raise NegativeFundsError()
|
raise NegativeFundsError()
|
||||||
|
|
||||||
if address and claim_id:
|
if address and claim_id:
|
||||||
raise Exception("Given both an address and a claim id")
|
raise Exception("Given both an address and a claim id")
|
||||||
elif not address and not claim_id:
|
if not address and not claim_id:
|
||||||
raise Exception("Not given an address or a claim id")
|
raise Exception("Not given an address or a claim id")
|
||||||
|
|
||||||
if address:
|
if address:
|
||||||
|
@ -1238,7 +1238,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||||
amount = self.get_dewies_or_error("amount", amount)
|
amount = self.get_dewies_or_error("amount", amount)
|
||||||
if not amount:
|
if not amount:
|
||||||
raise NullFundsError
|
raise NullFundsError
|
||||||
elif amount < 0:
|
if amount < 0:
|
||||||
raise NegativeFundsError()
|
raise NegativeFundsError()
|
||||||
|
|
||||||
for address in addresses:
|
for address in addresses:
|
||||||
|
|
|
@ -445,11 +445,11 @@ def _handle_claim_result(results):
|
||||||
if results['error'] in ['name is not claimed', 'claim not found']:
|
if results['error'] in ['name is not claimed', 'claim not found']:
|
||||||
if 'claim_id' in results:
|
if 'claim_id' in results:
|
||||||
raise UnknownClaimID(results['claim_id'])
|
raise UnknownClaimID(results['claim_id'])
|
||||||
elif 'name' in results:
|
if 'name' in results:
|
||||||
raise UnknownNameError(results['name'])
|
raise UnknownNameError(results['name'])
|
||||||
elif 'uri' in results:
|
if 'uri' in results:
|
||||||
raise UnknownURI(results['uri'])
|
raise UnknownURI(results['uri'])
|
||||||
elif 'outpoint' in results:
|
if 'outpoint' in results:
|
||||||
raise UnknownOutpoint(results['outpoint'])
|
raise UnknownOutpoint(results['outpoint'])
|
||||||
raise Exception(results['error'])
|
raise Exception(results['error'])
|
||||||
|
|
||||||
|
|
|
@ -434,7 +434,6 @@ class StreamManager:
|
||||||
msg = f"fee of {fee_amount} exceeds max configured to allow of {max_fee_amount}"
|
msg = f"fee of {fee_amount} exceeds max configured to allow of {max_fee_amount}"
|
||||||
log.warning(msg)
|
log.warning(msg)
|
||||||
raise KeyFeeAboveMaxAllowed(msg)
|
raise KeyFeeAboveMaxAllowed(msg)
|
||||||
else:
|
|
||||||
balance = await self.wallet.default_account.get_balance()
|
balance = await self.wallet.default_account.get_balance()
|
||||||
if lbc_to_dewies(str(fee_amount)) > balance:
|
if lbc_to_dewies(str(fee_amount)) > balance:
|
||||||
msg = f"fee of {fee_amount} exceeds max available balance"
|
msg = f"fee of {fee_amount} exceeds max available balance"
|
||||||
|
@ -449,7 +448,6 @@ class StreamManager:
|
||||||
if existing and existing[0].claim_id != resolved['claim_id']:
|
if existing and existing[0].claim_id != resolved['claim_id']:
|
||||||
raise Exception(f"stream for {existing[0].claim_id} collides with existing "
|
raise Exception(f"stream for {existing[0].claim_id} collides with existing "
|
||||||
f"download {resolved['claim_id']}")
|
f"download {resolved['claim_id']}")
|
||||||
elif not existing:
|
|
||||||
existing.extend(self.get_filtered_streams(claim_id=resolved['claim_id']))
|
existing.extend(self.get_filtered_streams(claim_id=resolved['claim_id']))
|
||||||
if existing and existing[0].sd_hash != claim.source_hash.decode():
|
if existing and existing[0].sd_hash != claim.source_hash.decode():
|
||||||
log.info("claim contains an update to a stream we have, downloading it")
|
log.info("claim contains an update to a stream we have, downloading it")
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -23,7 +23,7 @@ setup(
|
||||||
'console_scripts': 'lbrynet=lbrynet.extras.cli:main'
|
'console_scripts': 'lbrynet=lbrynet.extras.cli:main'
|
||||||
},
|
},
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'aiohttp==3.4.4',
|
'aiohttp==3.5.4',
|
||||||
'aioupnp',
|
'aioupnp',
|
||||||
'appdirs==1.4.3',
|
'appdirs==1.4.3',
|
||||||
'colorama==0.3.7',
|
'colorama==0.3.7',
|
||||||
|
|
Loading…
Reference in a new issue