From 01938f23a75fa9e158571131bff40b90dbcc1519 Mon Sep 17 00:00:00 2001 From: Hugo Trentesaux <hugo@trentesaux.fr> Date: Wed, 7 Oct 2020 11:06:29 +0200 Subject: [PATCH] [fmt] black --- duniterpy/constants.py | 6 ++---- examples/load_local_blockchain.py | 10 +++++----- examples/send_identity.py | 6 +----- examples/send_membership.py | 5 +---- 4 files changed, 9 insertions(+), 18 deletions(-) diff --git a/duniterpy/constants.py b/duniterpy/constants.py index 1e182dc2..6703e382 100644 --- a/duniterpy/constants.py +++ b/duniterpy/constants.py @@ -25,10 +25,8 @@ BLOCK_ID_REGEX = "[0-9]+" BLOCK_UID_REGEX = "{block_id_regex}-{block_hash_regex}".format( block_id_regex=BLOCK_ID_REGEX, block_hash_regex=BLOCK_HASH_REGEX ) -CONDITIONS_REGEX = ( - "(&&|\\|\\|| |[()]|(SIG\\({pubkey_regex}\\)|(XHX\\({hash_regex}\\))))*".format( - pubkey_regex=PUBKEY_REGEX, hash_regex=HASH_REGEX - ) +CONDITIONS_REGEX = "(&&|\\|\\|| |[()]|(SIG\\({pubkey_regex}\\)|(XHX\\({hash_regex}\\))))*".format( + pubkey_regex=PUBKEY_REGEX, hash_regex=HASH_REGEX ) IPV4_REGEX = ( "(?:(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][" diff --git a/examples/load_local_blockchain.py b/examples/load_local_blockchain.py index 260f49fd..d59ee891 100644 --- a/examples/load_local_blockchain.py +++ b/examples/load_local_blockchain.py @@ -3,9 +3,9 @@ from duniterpy.helpers.blockchain import load -bc = load() # gets blockchain iterator -b = next(bc) # gets block -b.number # should return 0 +bc = load() # gets blockchain iterator +b = next(bc) # gets block +b.number # should return 0 # you can access all properties of this block through it's duniterpy objects attributes -next(bc).number # should return 1 -next(bc).number # should return 2 (and so on) \ No newline at end of file +next(bc).number # should return 1 +next(bc).number # should return 2 (and so on) diff --git a/examples/send_identity.py b/examples/send_identity.py index 68bcd4d5..1fc29f89 100644 --- a/examples/send_identity.py +++ b/examples/send_identity.py @@ -34,11 +34,7 @@ BMAS_ENDPOINT = "BMAS g1-test.duniter.org 443" ################################################ -def get_identity_document( - current_block: dict, - uid: str, - key: SigningKey, -) -> Identity: +def get_identity_document(current_block: dict, uid: str, key: SigningKey,) -> Identity: """ Get an Identity document diff --git a/examples/send_membership.py b/examples/send_membership.py index acfb79ef..dfa7139e 100644 --- a/examples/send_membership.py +++ b/examples/send_membership.py @@ -35,10 +35,7 @@ BMAS_ENDPOINT = "BMAS g1-test.duniter.org 443" def get_membership_document( - membership_type: str, - current_block: dict, - identity: dict, - key: SigningKey, + membership_type: str, current_block: dict, identity: dict, key: SigningKey, ) -> Membership: """ Get a Membership document -- GitLab