From 3a3a9b5f4e2bc217d0ceeacd245f0264c5e4ff8d Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 2 Oct 2019 21:04:30 +0300 Subject: [PATCH] Fix spelling --- lbry/docs/api.json | 6 +++--- lbry/lbry/blob_exchange/client.py | 4 ++-- lbry/lbry/dht/node.py | 2 +- lbry/lbry/extras/daemon/Daemon.py | 6 +++--- lbry/lbry/stream/stream_manager.py | 2 +- lbry/lbry/wallet/server/coin.py | 2 +- lbry/tests/integration/test_dht.py | 4 ++-- lbry/tests/integration/test_file_commands.py | 4 ++-- lbry/tests/integration/test_resolve_command.py | 2 +- lbry/tests/integration/test_streaming.py | 2 +- lbry/tests/integration/test_wallet_server_sessions.py | 2 +- lbry/tests/unit/stream/test_stream_descriptor.py | 2 +- torba/tests/client_tests/integration/test_network.py | 2 +- torba/torba/client/baseledger.py | 2 +- torba/torba/client/basenetwork.py | 4 ++-- torba/torba/rpc/framing.py | 2 +- torba/torba/rpc/jsonrpc.py | 2 +- torba/torba/rpc/session.py | 2 +- torba/torba/server/daemon.py | 2 +- torba/torba/server/history.py | 2 +- torba/torba/server/session.py | 6 +++--- torba/torba/server/tx.py | 2 +- 22 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lbry/docs/api.json b/lbry/docs/api.json index da19d3a7e..4772bf1bd 100644 --- a/lbry/docs/api.json +++ b/lbry/docs/api.json @@ -1694,7 +1694,7 @@ { "name": "support_amount", "type": "int", - "description": "limit by supports and tips recieved (supports equality constraints)", + "description": "limit by supports and tips received (supports equality constraints)", "is_required": false }, { @@ -1992,7 +1992,7 @@ { "name": "visible", "type": "bool", - "description": "Select only Visisble Comments", + "description": "Select only Visible Comments", "is_required": false }, { @@ -2189,7 +2189,7 @@ { "name": "comparison", "type": "str", - "description": "logical comparision, (eq | ne | g | ge | l | le)", + "description": "logical comparison, (eq | ne | g | ge | l | le)", "is_required": false } ], diff --git a/lbry/lbry/blob_exchange/client.py b/lbry/lbry/blob_exchange/client.py index fefe75836..8eb7c53dc 100644 --- a/lbry/lbry/blob_exchange/client.py +++ b/lbry/lbry/blob_exchange/client.py @@ -67,7 +67,7 @@ class BlobExchangeClientProtocol(asyncio.Protocol): self.blob.set_length(blob_response.length) elif blob_response and not blob_response.error and self.blob.blob_hash != blob_response.blob_hash: # the server started sending a blob we didn't request - log.warning("%s started sending blob we didnt request %s instead of %s", self.peer_address, + log.warning("%s started sending blob we didn't request %s instead of %s", self.peer_address, blob_response.blob_hash, self.blob.blob_hash) return if response.responses: @@ -139,7 +139,7 @@ class BlobExchangeClientProtocol(asyncio.Protocol): log.warning("data rate rejected by %s:%i", self.peer_address, self.peer_port) return self._blob_bytes_received, self.close() if not blob_response or blob_response.error: - log.warning("blob cant be downloaded from %s:%i", self.peer_address, self.peer_port) + log.warning("blob can't be downloaded from %s:%i", self.peer_address, self.peer_port) return self._blob_bytes_received, self.close() if not blob_response.error and blob_response.blob_hash != self.blob.blob_hash: log.warning("incoming blob hash mismatch from %s:%i", self.peer_address, self.peer_port) diff --git a/lbry/lbry/dht/node.py b/lbry/lbry/dht/node.py index 57fb9baa1..83dd08704 100644 --- a/lbry/lbry/dht/node.py +++ b/lbry/lbry/dht/node.py @@ -36,7 +36,7 @@ class Node: total_peers: typing.List['KademliaPeer'] = [] # add all peers in the routing table total_peers.extend(self.protocol.routing_table.get_peers()) - # add all the peers who have announed blobs to us + # add all the peers who have announced blobs to us total_peers.extend(self.protocol.data_store.get_storing_contacts()) # get ids falling in the midpoint of each bucket that hasn't been recently updated diff --git a/lbry/lbry/extras/daemon/Daemon.py b/lbry/lbry/extras/daemon/Daemon.py index 57f74512b..e6506d333 100644 --- a/lbry/lbry/extras/daemon/Daemon.py +++ b/lbry/lbry/extras/daemon/Daemon.py @@ -1726,7 +1726,7 @@ class Daemon(metaclass=JSONRPCServerType): --blobs_in_stream : (int) get file with matching blobs in stream --blobs_remaining= : (int) amount of remaining blobs to download --sort= : (str) field to sort by (one of the above filter fields) - --comparison= : (str) logical comparision, (eq | ne | g | ge | l | le) + --comparison= : (str) logical comparison, (eq | ne | g | ge | l | le) Returns: {List[File]} """ @@ -1975,7 +1975,7 @@ class Daemon(metaclass=JSONRPCServerType): a release time the publish time is used instead (supports equality constraints) --amount= : (int) limit by claim value (supports equality constraints) - --support_amount=: (int) limit by supports and tips recieved (supports + --support_amount=: (int) limit by supports and tips received (supports equality constraints) --effective_amount=: (int) limit by total value (initial claim value plus all tips and supports received), this amount is @@ -3695,7 +3695,7 @@ class Daemon(metaclass=JSONRPCServerType): --is_channel_signature_valid : (bool) Only include comments with valid signatures. [Warning: Paginated total size will not change, even if list reduces] - --visible : (bool) Select only Visisble Comments + --visible : (bool) Select only Visible Comments --hidden : (bool) Select only Hidden Comments Returns: diff --git a/lbry/lbry/stream/stream_manager.py b/lbry/lbry/stream/stream_manager.py index 3b6c23c78..3a45d01b9 100644 --- a/lbry/lbry/stream/stream_manager.py +++ b/lbry/lbry/stream/stream_manager.py @@ -442,7 +442,7 @@ class StreamManager: except asyncio.TimeoutError: error = DownloadDataTimeout(stream.sd_hash) raise error - except Exception as err: # forgive data timeout, dont delete stream + except Exception as err: # forgive data timeout, don't delete stream error = err raise finally: diff --git a/lbry/lbry/wallet/server/coin.py b/lbry/lbry/wallet/server/coin.py index a97ff4871..b51f7dd17 100644 --- a/lbry/lbry/wallet/server/coin.py +++ b/lbry/lbry/wallet/server/coin.py @@ -79,7 +79,7 @@ class LBC(Coin): @classmethod def address_from_script(cls, script): - '''Given a pk_script, return the adddress it pays to, or None.''' + '''Given a pk_script, return the address it pays to, or None.''' return ScriptPubKey.pay_to(cls.address_handlers, script) @classmethod diff --git a/lbry/tests/integration/test_dht.py b/lbry/tests/integration/test_dht.py index 5de161b9d..bdf4249db 100644 --- a/lbry/tests/integration/test_dht.py +++ b/lbry/tests/integration/test_dht.py @@ -70,7 +70,7 @@ class DHTIntegrationTest(AsyncioTestCase): await asyncio.sleep(.1) timeout -= 1 if not timeout: - self.fail("node didnt join back after 2 seconds") + self.fail("node didn't join back after 2 seconds") async def test_announce_no_peers(self): await self.setup_network(1) @@ -100,7 +100,7 @@ class DHTIntegrationTest(AsyncioTestCase): await self.setup_network(2, seed_nodes=2) node1, node2 = self.nodes node2.stop() - # forcefully make it a bad peer but dont remove it from routing table + # forcefully make it a bad peer but don't remove it from routing table address, port, node_id = node2.protocol.external_ip, node2.protocol.udp_port, node2.protocol.node_id peer = KademliaPeer(self.loop, address, node_id, port) self.assertTrue(node1.protocol.peer_manager.peer_is_good(peer)) diff --git a/lbry/tests/integration/test_file_commands.py b/lbry/tests/integration/test_file_commands.py index 3ca3155c2..59b31d1de 100644 --- a/lbry/tests/integration/test_file_commands.py +++ b/lbry/tests/integration/test_file_commands.py @@ -98,7 +98,7 @@ class FileCommands(CommandTestCase): resp = await self.daemon.jsonrpc_get('lbry://foo', timeout=2, save_file=True) self.assertIn('error', resp) self.assertEqual('Failed to download data blobs for sd hash %s within timeout' % sd_hash, resp['error']) - self.assertTrue(await self.daemon.jsonrpc_file_delete(claim_name='foo'), "data timeout didnt create a file") + self.assertTrue(await self.daemon.jsonrpc_file_delete(claim_name='foo'), "data timeout didn't create a file") await self.server.blob_manager.delete_blobs([sd_hash]) resp = await self.daemon.jsonrpc_get('lbry://foo', timeout=2, save_file=True) self.assertIn('error', resp) @@ -118,7 +118,7 @@ class FileCommands(CommandTestCase): handle.write(b'some other stuff was there instead') self.daemon.stream_manager.stop() await self.daemon.stream_manager.start() - await asyncio.wait_for(self.wait_files_to_complete(), timeout=5) # if this hangs, file didnt get set completed + await asyncio.wait_for(self.wait_files_to_complete(), timeout=5) # if this hangs, file didn't get set completed # check that internal state got through up to the file list API stream = self.daemon.stream_manager.get_stream_by_stream_hash(file_info['stream_hash']) file_info = self.sout(self.daemon.jsonrpc_file_list()[0]) diff --git a/lbry/tests/integration/test_resolve_command.py b/lbry/tests/integration/test_resolve_command.py index f511e6944..8e2424f6b 100644 --- a/lbry/tests/integration/test_resolve_command.py +++ b/lbry/tests/integration/test_resolve_command.py @@ -178,7 +178,7 @@ class ResolveCommand(BaseResolveTestCase): channel = (await self.channel_create('@abc', '1.0'))['outputs'][0] orphan_claim_id = self.get_claim_id(orphan_claim) - # Original channel doesnt exists anymore, so the signature is invalid. For invalid signatures, resolution is + # Original channel doesn't exists anymore, so the signature is invalid. For invalid signatures, resolution is # only possible outside a channel response = await self.resolve('lbry://@abc/on-channel-claim') self.assertEqual(response, { diff --git a/lbry/tests/integration/test_streaming.py b/lbry/tests/integration/test_streaming.py index 806d24af2..77dadb1c9 100644 --- a/lbry/tests/integration/test_streaming.py +++ b/lbry/tests/integration/test_streaming.py @@ -413,7 +413,7 @@ class RangeRequestsLRUCache(CommandTestCase): self.server.stop_server() # running with cache size 0 gets through without errors without - # this since the server doesnt stop immediately + # this since the server doesn't stop immediately await asyncio.sleep(1, loop=self.loop) await self._request_stream() diff --git a/lbry/tests/integration/test_wallet_server_sessions.py b/lbry/tests/integration/test_wallet_server_sessions.py index b19c77e29..3ac714ce6 100644 --- a/lbry/tests/integration/test_wallet_server_sessions.py +++ b/lbry/tests/integration/test_wallet_server_sessions.py @@ -55,7 +55,7 @@ class TestHeadersComponent(CommandTestCase): async def test_cant_reach_host(self): HeadersComponent.HEADERS_URL = 'notthere/' os.unlink(self.headers_component.headers.path) - # test is that this doesnt raise + # test is that this doesn't raise await self.headers_component.start() self.assertTrue(self.component_manager.get_components_status()['blockchain_headers']) self.assertEqual(await self.headers_component.get_status(), {}) \ No newline at end of file diff --git a/lbry/tests/unit/stream/test_stream_descriptor.py b/lbry/tests/unit/stream/test_stream_descriptor.py index 9889f606a..09d230ddc 100644 --- a/lbry/tests/unit/stream/test_stream_descriptor.py +++ b/lbry/tests/unit/stream/test_stream_descriptor.py @@ -126,5 +126,5 @@ class TestRecoverOldStreamDescriptors(AsyncioTestCase): loop, tmp_dir, blob ) self.assertFalse(blob.file_exists) - # fixme: this is an emergency PR, plase move this to blob_file tests later + # fixme: this is an emergency PR, please move this to blob_file tests later self.assertIsNone(blob.length) diff --git a/torba/tests/client_tests/integration/test_network.py b/torba/tests/client_tests/integration/test_network.py index f607c3c09..2aec6805f 100644 --- a/torba/tests/client_tests/integration/test_network.py +++ b/torba/tests/client_tests/integration/test_network.py @@ -100,7 +100,7 @@ class ReconnectTests(IntegrationTestCase): # * goes to pick some water outside... * time passes by and another donation comes in sendtxid = await self.blockchain.send_to_address(address1, 42) await self.blockchain.generate(1) - # (this is just so the test doesnt hang forever if it doesnt reconnect) + # (this is just so the test doesn't hang forever if it doesn't reconnect) if not self.ledger.network.is_connected: await asyncio.wait_for(self.ledger.network.on_connected.first, timeout=1.0) # omg, the burned cable still works! torba is fire proof! diff --git a/torba/torba/client/baseledger.py b/torba/torba/client/baseledger.py index e92113c98..54ca770f0 100644 --- a/torba/torba/client/baseledger.py +++ b/torba/torba/client/baseledger.py @@ -544,7 +544,7 @@ class BaseLedger(metaclass=LedgerRegistry): return None def broadcast(self, tx): - # broadcast cant be a retriable call yet + # broadcast can't be a retriable call yet return self.network.broadcast(hexlify(tx.raw).decode()) async def wait(self, tx: basetransaction.BaseTransaction, height=-1, timeout=None): diff --git a/torba/torba/client/basenetwork.py b/torba/torba/client/basenetwork.py index 7b5cee4a4..2ed1e0c95 100644 --- a/torba/torba/client/basenetwork.py +++ b/torba/torba/client/basenetwork.py @@ -73,7 +73,7 @@ class ClientSession(BaseClientSession): return reply except (RPCError, ProtocolError) as e: if str(e).find('.*no such .*transaction.*'): - # shouldnt the server return none instead? + # shouldn't the server return none instead? return None log.warning("Wallet server (%s:%i) returned an error. Code: %s Message: %s", *self.server, *e.args) @@ -256,7 +256,7 @@ class BaseNetwork: try: return await self.rpc('blockchain.address.subscribe', [address], True) except asyncio.TimeoutError: - # abort and cancel, we cant lose a subscription, it will happen again on reconnect + # abort and cancel, we can't lose a subscription, it will happen again on reconnect if self.client: self.client.abort() raise asyncio.CancelledError() diff --git a/torba/torba/rpc/framing.py b/torba/torba/rpc/framing.py index 754d68139..b7eba4847 100644 --- a/torba/torba/rpc/framing.py +++ b/torba/torba/rpc/framing.py @@ -37,7 +37,7 @@ class FramerBase(object): """Abstract base class for a framer. A framer breaks an incoming byte stream into protocol messages, - buffering if necesary. It also frames outgoing messages into + buffering if necessary. It also frames outgoing messages into a byte stream. """ diff --git a/torba/torba/rpc/jsonrpc.py b/torba/torba/rpc/jsonrpc.py index 2e8bfa2a7..f33d6979d 100644 --- a/torba/torba/rpc/jsonrpc.py +++ b/torba/torba/rpc/jsonrpc.py @@ -513,7 +513,7 @@ class JSONRPCv2(JSONRPC): class JSONRPCLoose(JSONRPC): - """A relaxed versin of JSON RPC.""" + """A relaxed version of JSON RPC.""" # Don't be so loose we accept any old message ID _message_id = JSONRPCv2._message_id diff --git a/torba/torba/rpc/session.py b/torba/torba/rpc/session.py index dd9909cfd..f093ffedc 100644 --- a/torba/torba/rpc/session.py +++ b/torba/torba/rpc/session.py @@ -93,7 +93,7 @@ class SessionBase(asyncio.Protocol): # Set when a connection is made self._address = None self._proxy_address = None - # For logger.debug messsages + # For logger.debug messages self.verbosity = 0 # Cleared when the send socket is full self._can_send = Event() diff --git a/torba/torba/server/daemon.py b/torba/torba/server/daemon.py index b66430fae..60dc574cd 100644 --- a/torba/torba/server/daemon.py +++ b/torba/torba/server/daemon.py @@ -117,7 +117,7 @@ class Daemon: async def _send(self, payload, processor): """Send a payload to be converted to JSON. - Handles temporary connection issues. Daemon reponse errors + Handles temporary connection issues. Daemon response errors are raise through DaemonError. """ def log_error(error): diff --git a/torba/torba/server/history.py b/torba/torba/server/history.py index 2445bbf14..405355fbb 100644 --- a/torba/torba/server/history.py +++ b/torba/torba/server/history.py @@ -228,7 +228,7 @@ class History: def _compact_hashX(self, hashX, hist_map, hist_list, write_items, keys_to_delete): - """Compres history for a hashX. hist_list is an ordered list of + """Compress history for a hashX. hist_list is an ordered list of the histories to be compressed.""" # History entries (tx numbers) are 4 bytes each. Distribute # over rows of up to 50KB in size. A fixed row size means diff --git a/torba/torba/server/session.py b/torba/torba/server/session.py index e9e1840fc..1e8e46bbb 100644 --- a/torba/torba/server/session.py +++ b/torba/torba/server/session.py @@ -385,7 +385,7 @@ class SessionManager: return "peer '{}' added".format(real_name) async def rpc_disconnect(self, session_ids): - """Disconnect sesssions. + """Disconnect sessions. session_ids: array of session IDs """ @@ -397,7 +397,7 @@ class SessionManager: return await self._for_each_session(session_ids, close) async def rpc_log(self, session_ids): - """Toggle logging of sesssions. + """Toggle logging of sessions. session_ids: array of session IDs """ @@ -414,7 +414,7 @@ class SessionManager: try: self.daemon.set_url(daemon_url) except Exception as e: - raise RPCError(BAD_REQUEST, f'an error occured: {e!r}') + raise RPCError(BAD_REQUEST, f'an error occurred: {e!r}') return f'now using daemon at {self.daemon.logged_url()}' async def rpc_stop(self): diff --git a/torba/torba/server/tx.py b/torba/torba/server/tx.py index 212589d54..0f2b180c3 100644 --- a/torba/torba/server/tx.py +++ b/torba/torba/server/tx.py @@ -457,7 +457,7 @@ class TxInputTokenPay(TxInput): self.script[1] == self.OP_ANON_MARKER) def is_generation(self): - # Transactions comming in from stealth addresses are seen by + # Transactions coming in from stealth addresses are seen by # the blockchain as newly minted coins. The reverse, where coins # are sent TO a stealth address, are seen by the blockchain as # a coin burn.