Skip to content

Commit a0d19ce

Browse files
committed
Format with black
line-length 88
1 parent d4cbf51 commit a0d19ce

26 files changed

+914
-814
lines changed

resdb_driver/connection.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
# to you under the Apache License, Version 2.0 (the
66
# "License"); you may not use this file except in compliance
77
# with the License. You may obtain a copy of the License at
8-
#
8+
#
99
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
10+
#
1111
# Unless required by applicable law or agreed to in writing,
1212
# software distributed under the License is distributed on an
1313
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
16-
# under the License.
16+
# under the License.
1717

1818

1919
import time
@@ -42,7 +42,7 @@ def __init__(self, *, node_url: str, headers: dict = None):
4242
@param node_url (str): Url of the node to connect to.
4343
@param headers (dict): Optional headers to send with each request.
4444
45-
@return An instance of the Connection class
45+
@return An instance of the Connection class
4646
"""
4747
self.node_url = node_url
4848
self.session = Session()
@@ -115,8 +115,7 @@ def request(
115115
connExc = err
116116
raise err
117117
finally:
118-
self.update_backoff_time(
119-
success=connExc is None, backoff_cap=backoff_cap)
118+
self.update_backoff_time(success=connExc is None, backoff_cap=backoff_cap)
120119
return response
121120

122121
def get_backoff_timedelta(self) -> float:

resdb_driver/crypto.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@
55
# to you under the Apache License, Version 2.0 (the
66
# "License"); you may not use this file except in compliance
77
# with the License. You may obtain a copy of the License at
8-
#
8+
#
99
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
10+
#
1111
# Unless required by applicable law or agreed to in writing,
1212
# software distributed under the License is distributed on an
1313
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
16-
# under the License.
17-
16+
# under the License.
1817

1918

2019
from collections import namedtuple

resdb_driver/driver.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
# to you under the Apache License, Version 2.0 (the
66
# "License"); you may not use this file except in compliance
77
# with the License. You may obtain a copy of the License at
8-
#
8+
#
99
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
10+
#
1111
# Unless required by applicable law or agreed to in writing,
1212
# software distributed under the License is distributed on an
1313
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
16-
# under the License.
16+
# under the License.
1717

1818

1919
from crypt import methods
@@ -71,8 +71,7 @@ def __init__(
7171

7272
@property
7373
def nodes(self):
74-
"""! :obj:`tuple` of :obj:`str`: URLs of connected nodes.
75-
"""
74+
"""! :obj:`tuple` of :obj:`str`: URLs of connected nodes."""
7675
return self._nodes
7776

7877
@property
@@ -111,7 +110,7 @@ def assets(self):
111110
def metadata(self):
112111
"""! :class:`~resdb_driver.driver.MetadataEndpoint`:
113112
Exposes functionalities of the ``'/metadata'`` endpoint.
114-
TODO: check
113+
TODO: check
115114
"""
116115
return self._metadata
117116

@@ -142,7 +141,7 @@ def api_info(self, headers=None) -> dict:
142141
"""! Retrieves information provided by the API root endpoint
143142
``'/api/v1'``.
144143
145-
TODO: implement the endpoint in the node
144+
TODO: implement the endpoint in the node
146145
147146
@param headers (dict): Optional headers to pass to the request.
148147
@@ -222,7 +221,7 @@ def prepare(
222221
operations. Defaults to ``None``.
223222
@param recipients (:obj:`list` | :obj:`tuple` | :obj:`str`, optional): One or more public keys representing the new recipients(s)
224223
of the asset being created or transferred. Defaults to ``None``.
225-
@param asset (:obj:`list` | :obj:`tuple` | :obj:`str`, optional): The asset to be created or transferred. MUST be supplied
224+
@param asset (:obj:`list` | :obj:`tuple` | :obj:`str`, optional): The asset to be created or transferred. MUST be supplied
226225
for ``'TRANSFER'`` operations. Defaults to ``None``.
227226
@param metadata (:obj:`list` | :obj:`tuple` | :obj:`str`, optional): Metadata associated with the transaction. Defaults to ``None``.
228227
@param inputs (:obj:`dict` | :obj:`list` | :obj:`tuple`, optional): One or more inputs holding the condition(s) that this
@@ -285,10 +284,10 @@ def fulfill(
285284
"""! Fulfills the given transaction.
286285
287286
@param transaction (dict): The transaction to be fulfilled.
288-
@param private_keys (:obj:`str` | :obj:`list` | :obj:`tuple`): One or more private keys to be
287+
@param private_keys (:obj:`str` | :obj:`list` | :obj:`tuple`): One or more private keys to be
289288
used for fulfilling the transaction.
290289
291-
@return The fulfilled transaction payload, ready to
290+
@return The fulfilled transaction payload, ready to
292291
be sent to a Resdb federation.
293292
294293
@exception :exc:`~.exceptions.MissingPrivateKeyError`: If a private
@@ -489,7 +488,7 @@ def get(self, *, txid, headers=None) -> list[dict]:
489488
class AssetsEndpoint(NamespacedDriver):
490489
"""! Exposes functionality of the ``'/assets'`` endpoint.
491490
492-
path (str): The path of the endpoint.
491+
path (str): The path of the endpoint.
493492
"""
494493

495494
PATH = "/assets/"

resdb_driver/driver_experiment.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
# to you under the Apache License, Version 2.0 (the
66
# "License"); you may not use this file except in compliance
77
# with the License. You may obtain a copy of the License at
8-
#
8+
#
99
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
10+
#
1111
# Unless required by applicable law or agreed to in writing,
1212
# software distributed under the License is distributed on an
1313
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
16-
# under the License.
16+
# under the License.
1717

1818

1919
#%%[markdown]

resdb_driver/exceptions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
# to you under the Apache License, Version 2.0 (the
66
# "License"); you may not use this file except in compliance
77
# with the License. You may obtain a copy of the License at
8-
#
8+
#
99
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
10+
#
1111
# Unless required by applicable law or agreed to in writing,
1212
# software distributed under the License is distributed on an
1313
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
16-
# under the License.
16+
# under the License.
1717

1818

1919
class ResdbException(Exception):

resdb_driver/offchain.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
# to you under the Apache License, Version 2.0 (the
66
# "License"); you may not use this file except in compliance
77
# with the License. You may obtain a copy of the License at
8-
#
8+
#
99
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
10+
#
1111
# Unless required by applicable law or agreed to in writing,
1212
# software distributed under the License is distributed on an
1313
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
16-
# under the License.
16+
# under the License.
1717

1818

1919
"""
@@ -76,19 +76,19 @@ def prepare_transaction(
7676
7777
@param operation (str): The operation to perform. Must be ``'CREATE'``
7878
or ``'TRANSFER'``. Case insensitive. Defaults to ``'CREATE'``.
79-
@param signers (:obj:`list` | :obj:`tuple` | :obj:`str`, optional):
79+
@param signers (:obj:`list` | :obj:`tuple` | :obj:`str`, optional):
8080
One or more public keys representing the issuer(s) of
8181
the asset being created. Only applies for ``'CREATE'``
8282
operations. Defaults to ``None``.
83-
@param recipients (:obj:`list` | :obj:`tuple` | :obj:`str`, optional):
83+
@param recipients (:obj:`list` | :obj:`tuple` | :obj:`str`, optional):
8484
One or more public keys representing the new recipients(s)
8585
of the asset being created or transferred.
8686
Defaults to ``None``.
87-
@param asset (:obj:`dict`, optional):
88-
The asset to be created orctransferred.
87+
@param asset (:obj:`dict`, optional):
88+
The asset to be created orctransferred.
8989
MUST be supplied for ``'TRANSFER'`` operations.
9090
Defaults to ``None``.
91-
@param metadata (:obj:`dict`, optional):
91+
@param metadata (:obj:`dict`, optional):
9292
Metadata associated with the
9393
transaction. Defaults to ``None``.
9494
@param inputs (:obj:`dict` | :obj:`list` | :obj:`tuple`, optional):
@@ -151,11 +151,11 @@ def prepare_create_transaction(*, signers, recipients=None, asset=None, metadata
151151
"""! Prepares a ``"CREATE"`` transaction payload, ready to be
152152
fulfilled.
153153
154-
@param signers (:obj:`list` | :obj:`tuple` | :obj:`str`):
155-
One or more public keys representing
154+
@param signers (:obj:`list` | :obj:`tuple` | :obj:`str`):
155+
One or more public keys representing
156156
the issuer(s) of the asset being created.
157-
@param recipients (:obj:`list` | :obj:`tuple` | :obj:`str`, optional):
158-
One or more public keys representing
157+
@param recipients (:obj:`list` | :obj:`tuple` | :obj:`str`, optional):
158+
One or more public keys representing
159159
the new recipients(s) of the asset being created. Defaults to ``None``.
160160
@param asset (:obj:`dict`, optional): The asset to be created. Defaults to ``None``.
161161
@param metadata (:obj:`dict`, optional): Metadata associated with the transaction. Defaults to ``None``.
@@ -208,12 +208,12 @@ def prepare_transfer_transaction(*, inputs, recipients, asset, metadata=None):
208208
"""! Prepares a ``"TRANSFER"`` transaction payload, ready to be
209209
fulfilled.
210210
211-
@param inputs (:obj:`dict` | :obj:`list` | :obj:`tuple`):
211+
@param inputs (:obj:`dict` | :obj:`list` | :obj:`tuple`):
212212
One or more inputs holding the condition(s) that this transaction
213213
intends to fulfill. Each input is expected to be a
214214
:obj:`dict`.
215-
@param recipients (:obj:`str` | :obj:`list` | :obj:`tuple`):
216-
One or more public keys representing the
215+
@param recipients (:obj:`str` | :obj:`list` | :obj:`tuple`):
216+
One or more public keys representing the
217217
new recipients(s) of the
218218
asset being transferred.
219219
@param asset (:obj:`dict`): A single-key dictionary holding the ``id``
@@ -327,7 +327,7 @@ def fulfill_transaction(transaction, *, private_keys) -> dict:
327327
"""! Fulfills the given transaction.
328328
329329
@param transaction The transaction to be fulfilled.
330-
@param private_keys One or more private keys to be
330+
@param private_keys One or more private keys to be
331331
used for fulfilling the transaction.
332332
333333
@return The fulfilled transaction payload, ready to be sent to a

resdb_driver/pool.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
# to you under the Apache License, Version 2.0 (the
66
# "License"); you may not use this file except in compliance
77
# with the License. You may obtain a copy of the License at
8-
#
8+
#
99
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
10+
#
1111
# Unless required by applicable law or agreed to in writing,
1212
# software distributed under the License is distributed on an
1313
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
16-
# under the License.
16+
# under the License.
1717

1818

1919
from abc import ABCMeta, abstractmethod
@@ -60,8 +60,7 @@ def pick(self, connections: list[Connection]) -> Connection:
6060

6161

6262
class Pool:
63-
"""! Pool of connections.
64-
"""
63+
"""! Pool of connections."""
6564

6665
def __init__(self, connections: list[Connection], picker_class=RoundRobinPicker):
6766
"""! Initializes a :class:`~resdb_driver.pool.Pool` instance.

0 commit comments

Comments
 (0)