diff --git a/duniterpy/constants.py b/duniterpy/constants.py index 6703e382118363be648ac60bc63bdf81038242cc..1e182dc26afe5fb18f1d18650aacfdda5c287d9b 100644 --- a/duniterpy/constants.py +++ b/duniterpy/constants.py @@ -25,8 +25,10 @@ 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/duniterpy/helpers/blockchain.py b/duniterpy/helpers/blockchain.py index cc6d433aaa30c96b92a7c0e5f87541dde4a0e790..0e4e10901621e5da1d647f69f4a7815263f70b7e 100644 --- a/duniterpy/helpers/blockchain.py +++ b/duniterpy/helpers/blockchain.py @@ -1,3 +1,21 @@ +""" +Copyright 2014-2020 Vincent Texier <vit@free.fr> + +DuniterPy is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +DuniterPy is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. +""" + + # imports locally stored blockchain in the chunk format # example usage : # ``` diff --git a/examples/load_local_blockchain.py b/examples/load_local_blockchain.py index d59ee89118579f6ac4b0ab7a627237487664ef01..0dc9e9ff5693599fd852ed745f3d595a260bd955 100644 --- a/examples/load_local_blockchain.py +++ b/examples/load_local_blockchain.py @@ -1,3 +1,21 @@ +""" +Copyright 2014-2020 Vincent Texier <vit@free.fr> + +DuniterPy is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +DuniterPy is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. +""" + + # this example lets you load locally copy of duniter blockchain into duniterpy objects # by default, it searches in ~/.config/duniter/duniter_default/g1/ diff --git a/examples/send_identity.py b/examples/send_identity.py index 1fc29f8980bd947a6e50f7ef0ba0ec42294d0e6d..68bcd4d59069148cf58b9865540a6ab7b3e6ee53 100644 --- a/examples/send_identity.py +++ b/examples/send_identity.py @@ -34,7 +34,11 @@ 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 dfa7139e4ea9c5472ef6ae1cee951310572a7849..acfb79effd4f081dd7b21bb4c31146ddffe063e6 100644 --- a/examples/send_membership.py +++ b/examples/send_membership.py @@ -35,7 +35,10 @@ 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