diff --git a/src/sakia/app.py b/src/sakia/app.py index f69536884c55fa0f379e4fd1ac57cca2b196bde9..bc303ad7bf6f3bbe0c9ca7e92888423b075e4bc0 100644 --- a/src/sakia/app.py +++ b/src/sakia/app.py @@ -273,8 +273,8 @@ class Application(QObject): latest_version, latest["html_url"], ) - logging.debug("Found version : {0}".format(latest_version)) - logging.debug("Current version : {0}".format(__version__)) + logging.debug("Found version: {0}".format(latest_version)) + logging.debug("Current version: {0}".format(__version__)) self.available_version = version except ( aiohttp.ClientError, @@ -282,7 +282,7 @@ class Application(QObject): asyncio.TimeoutError, socket.gaierror, ) as e: - self._logger.debug("Could not connect to github : {0}".format(str(e))) + self._logger.debug("Could not connect to github: {0}".format(str(e))) def save_parameters(self, parameters): self.parameters = UserParametersFile.in_config_path( diff --git a/src/sakia/data/connectors/bma.py b/src/sakia/data/connectors/bma.py index 34adaf523aa198b4190087e234418dd60d786bb2..53963fcc9ed699ba4b69a27e9dae3f10670ac512 100644 --- a/src/sakia/data/connectors/bma.py +++ b/src/sakia/data/connectors/bma.py @@ -178,7 +178,7 @@ class BmaConnector: return res except errors.DuniterError as e: if e.ucode == errors.HTTP_LIMITATION: - self._logger.debug("Exception in responses : " + str(e)) + self._logger.debug("Exception in responses: " + str(e)) self._nodes_processor.handle_failure(node) else: return e @@ -256,13 +256,13 @@ class BmaConnector: if isinstance(r, errors.DuniterError): if r.ucode == errors.HTTP_LIMITATION: self._logger.debug( - "Exception in responses : " + r.message + "Exception in responses: " + r.message ) continue else: data_hash = hash(r.ucode) elif isinstance(r, BaseException): - self._logger.debug("Exception in responses : " + str(r)) + self._logger.debug("Exception in responses: " + str(r)) continue else: filtered_data = _filter_data(request, r) @@ -359,7 +359,7 @@ class BmaConnector: if len(endpoints) > 0: async with aiohttp.ClientSession() as session: for endpoint in endpoints: - self._logger.debug("Trying to connect to : " + str(endpoint)) + self._logger.debug("Trying to connect to: " + str(endpoint)) _client = client.Client(endpoint, proxy=self._user_parameters.proxy()) reply = asyncio.ensure_future( _client(request, **req_args) diff --git a/src/sakia/data/connectors/node.py b/src/sakia/data/connectors/node.py index 9ccd8656868576cfded89ce490b62a3f965a1467..12a587d196c57593c3a44672a7e09fcbec82843a 100644 --- a/src/sakia/data/connectors/node.py +++ b/src/sakia/data/connectors/node.py @@ -99,7 +99,7 @@ class NodeConnector(QObject): peer.blockUID, last_state_change=time.time(), ) - logging.getLogger("sakia").debug("Node from address : {:}".format(str(node))) + logging.getLogger("sakia").debug("Node from address: {:}".format(str(node))) return cls(node, user_parameters) @@ -125,7 +125,7 @@ class NodeConnector(QObject): current_buid=peer.blockUID, last_state_change=time.time(), ) - logging.getLogger("sakia").debug("Node from peer : {:}".format(str(node))) + logging.getLogger("sakia").debug("Node from peer: {:}".format(str(node))) return cls(node, user_parameters, session=None) @@ -234,11 +234,11 @@ class NodeConnector(QObject): except (aiohttp.WSServerHandshakeError, ValueError) as e: self._logger.debug( - "Websocket block {0} : {1}".format(type(e).__name__, str(e)) + "Websocket block {0}: {1}".format(type(e).__name__, str(e)) ) self.handle_failure() except (ClientError, gaierror, TimeoutError) as e: - self._logger.debug("{0} : {1}".format(str(e), self.node.pubkey[:5])) + self._logger.debug("{0}: {1}".format(str(e), self.node.pubkey[:5])) self.handle_failure() except jsonschema.ValidationError as e: self._logger.debug( @@ -292,7 +292,7 @@ class NodeConnector(QObject): except (aiohttp.WSServerHandshakeError, ValueError) as e: self._logger.debug( - "Websocket peer {0} : {1}".format(type(e).__name__, str(e)) + "Websocket peer {0}: {1}".format(type(e).__name__, str(e)) ) await self.request_peers() except (ClientError, gaierror, TimeoutError) as e: @@ -355,7 +355,7 @@ class NodeConnector(QObject): self._logger.debug(str(e)) else: self._logger.debug( - "Incorrect peer data in {leaf} : {err}".format( + "Incorrect peer data in {leaf}: {err}".format( leaf=leaf_hash, err=str(e) ) ) @@ -370,7 +370,7 @@ class NodeConnector(QObject): else: self.handle_failure() self._logger.debug( - "Incorrect peer data in {leaf} : {err}".format( + "Incorrect peer data in {leaf}: {err}".format( leaf=leaf_hash, err=str(e) ) ) @@ -379,7 +379,7 @@ class NodeConnector(QObject): self.node.merkle_peers_leaves = tuple(peers_data["leaves"]) return # Break endpoints loop except errors.DuniterError as e: - self._logger.debug("Error in peers reply : {0}".format(str(e))) + self._logger.debug("Error in peers reply: {0}".format(str(e))) self.handle_failure() else: if self.session.closed: @@ -414,7 +414,7 @@ class NodeConnector(QObject): self._logger.debug('Connection to BMA succeeded (%s,%s,%s)', endpoint.server, endpoint.port, endpoint.API) return heads_data # Break endpoints loop except errors.DuniterError as e: - self._logger.debug("Error in peers reply : {0}".format(str(e))) + self._logger.debug("Error in peers reply: {0}".format(str(e))) self.handle_failure() else: if self.session.closed: diff --git a/src/sakia/data/entities/blockchain.py b/src/sakia/data/entities/blockchain.py index ed5722cd5574725704ac1187e250d79b7be77af2..36699f008d95a8e1a48ec00110fbd6ccc8bd95d0 100644 --- a/src/sakia/data/entities/blockchain.py +++ b/src/sakia/data/entities/blockchain.py @@ -14,9 +14,9 @@ class BlockchainParameters: sig_period = attr.ib(converter=int, default=0, cmp=False, hash=False) # Maximum quantity of active certifications made by member sig_stock = attr.ib(converter=int, default=0, cmp=False, hash=False) - # Maximum age of a active signature (in seconds) + # Maximum validity time of an active certification (in seconds) sig_validity = attr.ib(converter=int, default=0, cmp=False, hash=False) - # Minimum quantity of signatures to be part of the WoT + # Minimum quantity of certifications to be part of the WoT sig_qty = attr.ib(converter=int, default=0, cmp=False, hash=False) # Maximum delay in seconds a certification can wait before being expired for non-writing sig_window = attr.ib(converter=int, default=0, cmp=False, hash=False) @@ -26,7 +26,7 @@ class BlockchainParameters: ms_window = attr.ib(converter=int, default=0, cmp=False, hash=False) # Minimum decimal percent of sentries to reach to match the distance rule xpercent = attr.ib(converter=float, default=0, cmp=False, hash=False) - # Maximum age of an active membership( in seconds) + # Maximum validity time of an active membership (in seconds) ms_validity = attr.ib(converter=int, default=0, cmp=False, hash=False) # Maximum distance between each WoT member and a newcomer step_max = attr.ib(converter=int, default=0, cmp=False, hash=False) diff --git a/src/sakia/data/entities/node.py b/src/sakia/data/entities/node.py index a3bbe47436504c0dace85dc6b845a56fe3e31b72..8d8bd3c37486a18a11f410d8e4ac74531180f49d 100644 --- a/src/sakia/data/entities/node.py +++ b/src/sakia/data/entities/node.py @@ -27,7 +27,7 @@ class Node: A node can have multiple states : - ONLINE <= 3: The node is available for requests - OFFLINE > 3: The node is disconnected - - DESYNCED : The node is online but is desynced from the network + - DESYNCED: The node is online but is desynced from the network """ MERKLE_EMPTY_ROOT = ( diff --git a/src/sakia/data/processors/nodes.py b/src/sakia/data/processors/nodes.py index 054108266b31a42434b72d876b9314993a786007..789cd0e53fe62e6d39c2bfd6fc4a932e85876efd 100644 --- a/src/sakia/data/processors/nodes.py +++ b/src/sakia/data/processors/nodes.py @@ -154,7 +154,7 @@ class NodesProcessor: node = self._repo.get_one(pubkey=head.pubkey, currency=currency) if node: if node.current_buid < head.blockstamp: - logging.debug("Update node : {0}".format(head.pubkey[:5])) + logging.debug("Update node: {0}".format(head.pubkey[:5])) node.previous_buid = node.current_buid node.current_buid = head.blockstamp # todo: https://git.duniter.org/clients/python/duniterpy/issues/120 @@ -179,7 +179,7 @@ class NodesProcessor: """ node = self._repo.get_one(pubkey=peer.pubkey, currency=currency) if node and node.peer_blockstamp < peer.blockUID: - logging.debug("Update node : {0}".format(peer.pubkey[:5])) + logging.debug("Update node: {0}".format(peer.pubkey[:5])) node.endpoints = tuple(peer.endpoints) node.peer_blockstamp = peer.blockUID self._repo.update(node) diff --git a/src/sakia/data/processors/sources.py b/src/sakia/data/processors/sources.py index a4b02c5bb3a93acaff36e85d237f845dca55206e..18e4a0bbc44bd269ae3a1a0779e017c286742aab 100644 --- a/src/sakia/data/processors/sources.py +++ b/src/sakia/data/processors/sources.py @@ -33,7 +33,7 @@ class SourcesProcessor: try: self._repo.insert(source) except sqlite3.IntegrityError: - self._logger.debug("Source already known : {0}".format(source.identifier)) + self._logger.debug("Source already known: {0}".format(source.identifier)) def amount(self, currency, pubkey): """ @@ -67,13 +67,13 @@ class SourcesProcessor: try: self._repo.insert(source) except sqlite3.IntegrityError: - self._logger.debug("Source already exist : {0}".format(source)) + self._logger.debug("Source already exist: {0}".format(source)) def drop(self, source): try: self._repo.drop(source) except sqlite3.IntegrityError: - self._logger.debug("Source already dropped : {0}".format(source)) + self._logger.debug("Source already dropped: {0}".format(source)) def drop_all_of(self, currency, pubkey): self._repo.drop_all(currency=currency, pubkey=pubkey) diff --git a/src/sakia/data/processors/transactions.py b/src/sakia/data/processors/transactions.py index 86bcefdd5f189b6685d0fd789d516edc7a250dd2..04ff3822e76f2bb36eaad9510b21d0b0bad9396d 100644 --- a/src/sakia/data/processors/transactions.py +++ b/src/sakia/data/processors/transactions.py @@ -68,13 +68,13 @@ class TransactionsProcessor: if transition[0](tx, *inputs): if tx.sha_hash: self._logger.debug( - "{0} : {1} --> {2}".format( + "{0}: {1} --> {2}".format( tx.sha_hash[:5], tx.state, transition[2] ) ) else: self._logger.debug( - "Unsent transfer : {0} --> {1}".format( + "Unsent transfer: {0} --> {1}".format( tx.state, transition[2] ) ) @@ -179,7 +179,7 @@ class TransactionsProcessor: transactions.append(tx) self._repo.insert(tx) else: - log_stream("ERROR : Could not parse transaction") + log_stream("ERROR: Could not parse transaction") except sqlite3.IntegrityError: log_stream("Transaction already registered in database") await asyncio.sleep(0) diff --git a/src/sakia/data/repositories/005_add_lass_monetary_mass.sql b/src/sakia/data/repositories/005_add_lass_monetary_mass.sql index 7e69cd3bb4e6f2870f9569d3c5b7a5097dbe5821..dd8a6002b1e29a4be3291b8ee7fd47f44cbabaf2 100644 --- a/src/sakia/data/repositories/005_add_lass_monetary_mass.sql +++ b/src/sakia/data/repositories/005_add_lass_monetary_mass.sql @@ -28,7 +28,7 @@ CREATE TABLE IF NOT EXISTS blockchains ( current_members_count INT, current_mass INT, median_time INT, --- NEW ENTRY : last_mass +-- NEW ENTRY: last_mass last_mass INT, -- END OF INSERT last_members_count INT, diff --git a/src/sakia/errors.py b/src/sakia/errors.py index 1335791e03d50ce537d7b7e144d78c16b71e843d..73f862fbe87f2ac798618a2b67cc8fe72952cd71 100644 --- a/src/sakia/errors.py +++ b/src/sakia/errors.py @@ -10,7 +10,7 @@ class Error(Exception): """ Constructor """ - self.message = "Error : " + message + self.message = "Error: " + message def __str__(self): return self.message diff --git a/src/sakia/gui/dialogs/connection_cfg/controller.py b/src/sakia/gui/dialogs/connection_cfg/controller.py index f3e0bb3b61e79784cb8a640ff84106bd9b7f4702..d90c6dfac40431e018eb13799c1c5d025a17de99 100644 --- a/src/sakia/gui/dialogs/connection_cfg/controller.py +++ b/src/sakia/gui/dialogs/connection_cfg/controller.py @@ -122,7 +122,7 @@ class ConnectionConfigController(QObject): else: while not self.model.connection: self.mode = await self.step_node - self._logger.debug("Create connection") + self._logger.debug("Create account") try: self.view.button_connect.setEnabled(False) self.view.button_register.setEnabled(False) @@ -136,7 +136,7 @@ class ConnectionConfigController(QObject): self._logger.debug(str(e)) self.view.display_info( self.tr( - "Could not connect. Check hostname, ip address or port : <br/>" + "Could not connect. Check hostname, IP address or port: <br/>" + str(e) ) ) @@ -279,31 +279,31 @@ class ConnectionConfigController(QObject): def check_key(self): if self.mode == ConnectionConfigController.PUBKEY: if len(self.view.edit_pubkey.text()) < 42: - self.view.label_info.setText(self.tr("Forbidden : pubkey is too short")) + self.view.label_info.setText(self.tr("Forbidden: pubkey is too short")) return False if len(self.view.edit_pubkey.text()) > 45: - self.view.label_info.setText(self.tr("Forbidden : pubkey is too long")) + self.view.label_info.setText(self.tr("Forbidden: pubkey is too long")) return False else: if self.view.edit_password.text() != self.view.edit_password_repeat.text(): - self.view.label_info.setText(self.tr("Error : passwords are different")) + self.view.label_info.setText(self.tr("Error: passwords are different")) return False if self.view.edit_salt.text() != self.view.edit_salt_bis.text(): self.view.label_info.setText( - self.tr("Error : secret keys are different") + self.tr("Error: salts are different") ) return False if detect_non_printable(self.view.edit_salt.text()): self.view.label_info.setText( - self.tr("Forbidden : Invalid characters in salt field") + self.tr("Forbidden: invalid characters in salt") ) return False if detect_non_printable(self.view.edit_password.text()): self.view.label_info.setText( - self.tr("Forbidden : Invalid characters in password field") + self.tr("Forbidden: invalid characters in password") ) return False @@ -312,12 +312,12 @@ class ConnectionConfigController(QObject): return True if len(self.view.edit_salt.text()) < 6: - self.view.label_info.setText(self.tr("Forbidden : salt is too short")) + self.view.label_info.setText(self.tr("Forbidden: salt is too short")) return False if len(self.view.edit_password.text()) < 6: self.view.label_info.setText( - self.tr("Forbidden : password is too short") + self.tr("Forbidden: password is too short") ) return False @@ -343,11 +343,11 @@ class ConnectionConfigController(QObject): dialog = QMessageBox( QMessageBox.Information, - self.tr("Revokation file"), + self.tr("Revocation file"), self.tr( """<div>Your revocation document has been saved.</div> <div><b>Please keep it in a safe place.</b></div> -The publication of this document will remove your identity from the network.</p>""" +The publication of this document will revoke your identity on the network.</p>""" ), QMessageBox.Ok, ) @@ -377,7 +377,7 @@ The publication of this document will remove your identity from the network.</p> self.view.display_info( self.tr( """Your pubkey or UID is different on the network. -Yours : {0}, the network : {1}""".format( +Yours: {0}, the network: {1}""".format( registered[1], registered[2] ) ) @@ -395,7 +395,7 @@ Yours : {0}, the network : {1}""".format( self.step_key.set_result(None) else: self.view.display_info( - self.tr("A connection already exists using this key.") + self.tr("An account already exists using this key.") ) except NoPeerAvailable: @@ -423,7 +423,7 @@ Yours : {0}, the network : {1}""".format( self.view.display_info( self.tr( """Your pubkey is associated to an identity. -Yours : {0}, the network : {1}""".format( +Yours: {0}, the network: {1}""".format( registered[1], registered[2] ) ) @@ -434,7 +434,7 @@ Yours : {0}, the network : {1}""".format( self.view.display_info(str(e)) else: self.view.display_info( - self.tr("A connection already exists using this key.") + self.tr("An account already exists using this key.") ) except NoPeerAvailable: @@ -464,7 +464,7 @@ Yours : {0}, the network : {1}""".format( self.view.display_info( self.tr( """Your pubkey or UID is different on the network. - Yours : {0}, the network : {1}""".format( + Yours: {0}, the network: {1}""".format( registered[1], registered[2] ) ) @@ -477,7 +477,7 @@ Yours : {0}, the network : {1}""".format( self.view.display_info(str(e)) else: self.view.display_info( - self.tr("A connection already exists using this key.") + self.tr("An account already exists using this key.") ) except NoPeerAvailable: @@ -509,7 +509,7 @@ Yours : {0}, the network : {1}""".format( self.view.display_info( self.tr( """Your pubkey or UID was already found on the network. - Yours : {0}, the network : {1}""".format( + Yours: {0}, the network: {1}""".format( registered[1], registered[2] ) ) @@ -524,7 +524,7 @@ Yours : {0}, the network : {1}""".format( self.view.display_info(str(e)) else: self.view.display_info( - self.tr("A connection already exists using this key.") + self.tr("An account already exists using this key.") ) except NoPeerAvailable: self.view.display_info( diff --git a/src/sakia/gui/dialogs/connection_cfg/view.py b/src/sakia/gui/dialogs/connection_cfg/view.py index 12363c63efa91309dd4cd32fbe7fc5807c65a227..710248a52e5055b55ea86a5021dcd10ed2e995e0 100644 --- a/src/sakia/gui/dialogs/connection_cfg/view.py +++ b/src/sakia/gui/dialogs/connection_cfg/view.py @@ -142,7 +142,7 @@ class ConnectionConfigView(QDialog, Ui_ConnectionConfigurationDialog): Hide unecessary buttons and display correct title """ self.setWindowTitle( - self.tr("New connection to {0} network").format( + self.tr("New account on {0} network").format( ROOT_SERVERS[currency]["display"] ) ) @@ -220,18 +220,18 @@ class ConnectionConfigView(QDialog, Ui_ConnectionConfigurationDialog): dialog = QDialog(self) about_dialog = Ui_CongratulationPopup() about_dialog.setupUi(dialog) - dialog.setWindowTitle("Registration") + dialog.setWindowTitle("Identity registration") about_dialog.label.setText( self.tr( """ -<p><b>Congratulations !</b><br> +<p><b>Congratulations!</b><br> <br> You just published your identity to the network.<br> For your identity to be registered, you will need<br> <b>{certs} certifications</b> from members.<br> Once you got the required certifications, <br> you will be able to validate your registration<br> -by <b>publishing your membership request !</b><br> +by <b>publishing your membership request!</b><br> Please notice that your identity document <br> <b>will expire in {expiration_time_str}.</b><br> If you failed to get {certs} certifications before this time, <br> diff --git a/src/sakia/gui/dialogs/plugins_manager/view.py b/src/sakia/gui/dialogs/plugins_manager/view.py index d021276d6ca43d626898382552893f4e63e90def..72febb801d787eb0057aa215da5a44e3b8ebdba0 100644 --- a/src/sakia/gui/dialogs/plugins_manager/view.py +++ b/src/sakia/gui/dialogs/plugins_manager/view.py @@ -43,5 +43,5 @@ class PluginsManagerView(QDialog, Ui_PluginDialog): QMessageBox.critical( self, self.tr("Plugin import"), - self.tr("CCould not import plugin : {0}".format(error_txt)), + self.tr("Could not import plugin: {0}".format(error_txt)), ) diff --git a/src/sakia/gui/dialogs/revocation/model.py b/src/sakia/gui/dialogs/revocation/model.py index 52630f88c37a03d8cc98bd32ee85b9693837e589..0dacff2ed9728bb626aef7a25044b9d0d4502775 100644 --- a/src/sakia/gui/dialogs/revocation/model.py +++ b/src/sakia/gui/dialogs/revocation/model.py @@ -54,7 +54,7 @@ class RevocationModel(QObject): if isinstance(e, BMAEndpoint) or isinstance(e, SecuredBMAEndpoint) ]: try: - self._logger.debug("Broadcasting : \n" + signed_raw) + self._logger.debug("Broadcasting: \n" + signed_raw) conn_handler = endpoint.conn_handler( node_connector.session, proxy=self.app.parameters.proxy() ) diff --git a/src/sakia/gui/dialogs/revocation/revocation.ui b/src/sakia/gui/dialogs/revocation/revocation.ui index 7688bd3f38c2b87a16a3a63b9b88f124f37ecfbc..1808c93e1db2e76be5fb034d3f4c4ad5d527a757 100644 --- a/src/sakia/gui/dialogs/revocation/revocation.ui +++ b/src/sakia/gui/dialogs/revocation/revocation.ui @@ -47,7 +47,7 @@ QGroupBox::title { </sizepolicy> </property> <property name="text"> - <string><h2>Select a revokation document</h1></string> + <string><h2>Select a revocation document</h1></string> </property> <property name="textFormat"> <enum>Qt::RichText</enum> diff --git a/src/sakia/gui/dialogs/revocation/view.py b/src/sakia/gui/dialogs/revocation/view.py index 2477a1908919bfddcc75a6c638df8daec5e7fcee..20c800fb5fbe35a9d86998da98a507e5174bc2ea 100644 --- a/src/sakia/gui/dialogs/revocation/view.py +++ b/src/sakia/gui/dialogs/revocation/view.py @@ -71,8 +71,8 @@ class RevocationView(QDialog, Ui_RevocationDialog): if revoked_identity: text = self.tr( """ -<div>Identity revoked : {uid} (public key : {pubkey}...)</div> -<div>Identity signed on block : {timestamp}</div> +<div>Identity revoked: {uid} (public key: {pubkey}...)</div> +<div>Identity signed on block: {timestamp}</div> """.format( uid=revoked_identity.uid, pubkey=revoked_identity.pubkey[:12], @@ -139,8 +139,8 @@ class RevocationView(QDialog, Ui_RevocationDialog): def show_revoked_selfcert(self, selfcert): text = self.tr( """ - <div>Identity revoked : {uid} (public key : {pubkey}...)</div> - <div>Identity signed on block : {timestamp}</div> + <div>Identity revoked: {uid} (public key: {pubkey}...)</div> + <div>Identity signed on block: {timestamp}</div> """.format( uid=selfcert.uid, pubkey=selfcert.pubkey[:12], @@ -160,11 +160,11 @@ class RevocationView(QDialog, Ui_RevocationDialog): self, self.tr("Revocation"), self.tr( - """<h4>The publication of this document will remove your identity from the network.</h4> + """<h4>The publication of this document will revoke your identity on the network.</h4> <li> - <li> <b>This identity won't be able to join the targeted currency anymore.</b> </li> + <li> <b>This identity won't be able to join the WoT anymore.</b> </li> <li> <b>This identity won't be able to generate Universal Dividends anymore.</b> </li> - <li> <b>This identity won't be able to certify individuals anymore.</b> </li> + <li> <b>This identity won't be able to certify identities anymore.</b> </li> </li> Please think twice before publishing this document. """ diff --git a/src/sakia/gui/main_window/status_bar/controller.py b/src/sakia/gui/main_window/status_bar/controller.py index bf9c9307df3c434a232c308aed4996d73a686cfe..9edf30bd2d20e16af7d3a9011c1990402d45126c 100644 --- a/src/sakia/gui/main_window/status_bar/controller.py +++ b/src/sakia/gui/main_window/status_bar/controller.py @@ -74,7 +74,7 @@ class StatusBarController(QObject): QLocale.dateTimeFormat(QLocale(), QLocale.NarrowFormat), ) self.view.status_label.setText( - self.tr("Blockchain sync : {0} BAT ({1})").format( + self.tr("Blockchain sync: {0} BAT ({1})").format( str_time, str(current_block)[:15] ) ) diff --git a/src/sakia/gui/main_window/toolbar/model.py b/src/sakia/gui/main_window/toolbar/model.py index f09eac5d575de9833e19f9ece82d48e839932161..c26b75d69466da46ba15522c81df9d71e48c6d10 100644 --- a/src/sakia/gui/main_window/toolbar/model.py +++ b/src/sakia/gui/main_window/toolbar/model.py @@ -40,7 +40,7 @@ class ToolbarModel(QObject): version_info = "" version_url = "" if not latest[0]: - version_info = "Latest release : {version}".format(version=latest[1]) + version_info = "Latest release: {version}".format(version=latest[1]) version_url = latest[2] new_version_text = """ @@ -54,10 +54,10 @@ class ToolbarModel(QObject): <p>Python/Qt Duniter client</p> - <p>Version : {:}</p> + <p>Version: {:}</p> {new_version_text} - <p>License : GPLv3</p> + <p>License: GPLv3</p> <p><b>Authors</b></p> diff --git a/src/sakia/gui/main_window/toolbar/view.py b/src/sakia/gui/main_window/toolbar/view.py index d3fffd535862539860bb8dd232c7141c322cc3bb..5f20fbc0b7b21d14a8709deff062b0e6c10cf5c9 100644 --- a/src/sakia/gui/main_window/toolbar/view.py +++ b/src/sakia/gui/main_window/toolbar/view.py @@ -35,7 +35,7 @@ class ToolbarView(QFrame, Ui_SakiaToolbar): tool_menu = QMenu(self.tr("Tools"), self.toolbutton_menu) self.toolbutton_menu.setMenu(tool_menu) - self.action_add_connection = QAction(self.tr("Add a connection"), tool_menu) + self.action_add_connection = QAction(self.tr("Add an Sakia account"), tool_menu) tool_menu.addAction(self.action_add_connection) self.action_revoke_uid = QAction( @@ -68,7 +68,7 @@ class ToolbarView(QFrame, Ui_SakiaToolbar): self.action_about = QAction(self.tr("About Sakia"), about_menu) about_menu.addAction(self.action_about) - self.action_exit = QAction(self.tr("Exit"), tool_menu) + self.action_exit = QAction(self.tr("Quit"), tool_menu) tool_menu.addAction(self.action_exit) self.setSizePolicy(QSizePolicy.Maximum, QSizePolicy.Minimum) @@ -99,7 +99,7 @@ class ToolbarView(QFrame, Ui_SakiaToolbar): input_dialog = QInputDialog() input_dialog.setComboBoxItems(connections_titles) input_dialog.setWindowTitle(self.tr("Membership")) - input_dialog.setLabelText(self.tr("Select a connection")) + input_dialog.setLabelText(self.tr("Select an account")) await dialog_async_exec(input_dialog) result = input_dialog.textValue() @@ -137,21 +137,21 @@ class ToolbarView(QFrame, Ui_SakiaToolbar): QLocale().toString(params.sig_period / 86400, "f", 2), self.tr("Minimum delay between 2 certifications (days)"), QLocale().toString(params.sig_validity / 86400, "f", 2), - self.tr("Maximum age of a valid signature (days)"), + self.tr("Maximum validity time of a certification (days)"), params.sig_qty, - self.tr("Minimum quantity of signatures to be part of the WoT"), + self.tr("Minimum quantity of certifications to be part of the WoT"), params.sig_stock, - self.tr("Maximum quantity of active certifications made by member"), + self.tr("Maximum quantity of active certifications per member"), QLocale().toString(params.sig_window / 86400, "f", 2), self.tr( - "Maximum delay a certification can wait before being in blockchain (days)" + "Maximum time a certification can wait before being in blockchain (days)" ), params.xpercent * 100, self.tr( "Minimum percent of sentries to reach to match the distance rule" ), params.ms_validity / 86400, - self.tr("Maximum age of a valid membership (days)"), + self.tr("Maximum validity time of a membership (days)"), params.step_max, self.tr("Maximum distance between each WoT member and a newcomer"), ) diff --git a/src/sakia/gui/navigation/controller.py b/src/sakia/gui/navigation/controller.py index 55b328a80ea848a44514712c0a5c18317460c9de..130c34aee656da2b51f1e3f50f3d379b5b8bec68 100644 --- a/src/sakia/gui/navigation/controller.py +++ b/src/sakia/gui/navigation/controller.py @@ -159,12 +159,12 @@ class NavigationController(QObject): lambda c: self.model.view_in_wot(raw_data["misc"]["connection"]) ) - action_gen_revokation = QAction( - self.tr("Save revokation document"), menu + action_gen_revocation = QAction( + self.tr("Save revocation document"), menu ) - menu.addAction(action_gen_revokation) - action_gen_revokation.triggered.connect( - lambda c: self.action_save_revokation( + menu.addAction(action_gen_revocation) + action_gen_revocation.triggered.connect( + lambda c: self.action_save_revocation( raw_data["misc"]["connection"] ) ) @@ -216,7 +216,7 @@ class NavigationController(QObject): ) menu.addAction(copy_pubkey_crc) - action_remove = QAction(self.tr("Remove the connection"), menu) + action_remove = QAction(self.tr("Remove the Sakia account"), menu) menu.addAction(action_remove) action_remove.triggered.connect( lambda c: self.remove_connection(raw_data["misc"]["connection"]) @@ -260,7 +260,7 @@ class NavigationController(QObject): self, self.tr("Warning"), self.tr( - """Are you sure ? + """Are you sure? Sending a leaving demand cannot be canceled. The process to join back the community later will have to be done again.""" ).format(self.account.pubkey), @@ -295,10 +295,10 @@ The process to join back the community later will have to be done again.""" async def remove_connection(self, connection): reply = await QAsyncMessageBox.question( self.view, - self.tr("Removing the connection"), + self.tr("Removing the Sakia account"), self.tr( - """Are you sure ? This won't remove your money" -neither your identity from the network.""" + """Are you sure? This won't remove your money + neither your identity from the network.""" ), QMessageBox.Ok | QMessageBox.Cancel, ) @@ -307,7 +307,7 @@ neither your identity from the network.""" self.init_navigation() @asyncify - async def action_save_revokation(self, connection): + async def action_save_revocation(self, connection): secret_key, password = await PasswordInputController.open_dialog( self, connection ) @@ -320,7 +320,7 @@ neither your identity from the network.""" # Testable way of using a QFileDialog selected_files = await QAsyncFileDialog.get_save_filename( self.view, - self.tr("Save a revokation document"), + self.tr("Save a revocation document"), "revocation-{uid}-{pubkey}-{currency}.txt".format(uid=connection.uid, pubkey=connection.pubkey[:8], currency=connection.currency), self.tr("All text files (*.txt)"), @@ -334,11 +334,11 @@ neither your identity from the network.""" dialog = QMessageBox( QMessageBox.Information, - self.tr("Revokation file"), + self.tr("Revocation file"), self.tr( - """<div>Your revokation document has been saved.</div> + """<div>Your revocation document has been saved.</div> <div><b>Please keep it in a safe place.</b></div> -The publication of this document will remove your identity from the network.</p>""" +The publication of this document will revoke your identity on the network.</p>""" ), QMessageBox.Ok, ) diff --git a/src/sakia/gui/navigation/identities/table_model.py b/src/sakia/gui/navigation/identities/table_model.py index e8b6d07afb17f2e61912ed6395edcaa80088cf13..4e6b2e16fe0959b5a6dcf1160aba088db1919365 100644 --- a/src/sakia/gui/navigation/identities/table_model.py +++ b/src/sakia/gui/navigation/identities/table_model.py @@ -150,7 +150,7 @@ class IdentitiesTableModel(QAbstractTableModel): "renewed": lambda: QT_TRANSLATE_NOOP("IdentitiesTableModel", "Renewed"), "expiration": lambda: QT_TRANSLATE_NOOP("IdentitiesTableModel", "Expiration"), "publication": lambda: QT_TRANSLATE_NOOP( - "IdentitiesTableModel", "Publication Date" + "IdentitiesTableModel", "Publication" ), "block": lambda: QT_TRANSLATE_NOOP("IdentitiesTableModel", "Publication Block"), } diff --git a/src/sakia/gui/navigation/identity/model.py b/src/sakia/gui/navigation/identity/model.py index 464e83d389334900882c1760556620c4b0154f0b..23cb3b7e7838421c665df6d265f6aff293daa363 100644 --- a/src/sakia/gui/navigation/identity/model.py +++ b/src/sakia/gui/navigation/identity/model.py @@ -88,7 +88,7 @@ class IdentityModel(QObject): try: params = self.blockchain_service.parameters() except NoPeerAvailable as e: - logging.debug("community parameters error : " + str(e)) + logging.debug("community parameters error: " + str(e)) return None localized_data["currency"] = ROOT_SERVERS[self.connection.currency]["display"] diff --git a/src/sakia/gui/navigation/identity/table_model.py b/src/sakia/gui/navigation/identity/table_model.py index 5846bd60d7efcaaabfc26303f798207ab3d7d1dc..814c2e4d97fae27d6c3b205e1bdd59ad72e440ce 100644 --- a/src/sakia/gui/navigation/identity/table_model.py +++ b/src/sakia/gui/navigation/identity/table_model.py @@ -124,7 +124,7 @@ class CertifiersTableModel(QAbstractTableModel): "uid": lambda: QT_TRANSLATE_NOOP("CertifiersTableModel", "UID"), "pubkey": lambda: QT_TRANSLATE_NOOP("CertifiersTableModel", "Pubkey"), "publication": lambda: QT_TRANSLATE_NOOP( - "CertifiersTableModel", "Publication Date" + "CertifiersTableModel", "Publication" ), "expiration": lambda: QT_TRANSLATE_NOOP("CertifiersTableModel", "Expiration"), "available": lambda: QT_TRANSLATE_NOOP("CertifiersTableModel"), diff --git a/src/sakia/gui/navigation/identity/view.py b/src/sakia/gui/navigation/identity/view.py index 5ea43a90bef58844be2469bbaa04f42c91cd7156..5fa7451ff60489fbe4a19faea6386de85adc7ca6 100644 --- a/src/sakia/gui/navigation/identity/view.py +++ b/src/sakia/gui/navigation/identity/view.py @@ -79,12 +79,12 @@ class IdentityView(QWidget, Ui_IdentityWidget): written_value = ( self.tr("Identity not written in blockchain") + " (" - + self.tr("Expires on : {0}").format(expiration_text) + + self.tr("Expires on: {0}").format(expiration_text) + " BAT)" ) status_value = ( - self.tr("Member") if data["membership_state"] else self.tr("Non-Member") + self.tr("Member") if data["membership_state"] else self.tr("Not a member") ) if data["mstime"] > 0: membership_action_value = self.tr("Renew membership") @@ -97,7 +97,7 @@ class IdentityView(QWidget, Ui_IdentityWidget): else: membership_action_value = self.tr("Request membership") if data["nb_certs"] > data["nb_certs_required"]: - status_info = self.tr("Registration ready") + status_info = self.tr("Identity registration ready") membership_action_enabled = True else: status_info = self.tr("{0} more certifications required").format( @@ -236,21 +236,21 @@ and that you will only certify persons that you know well enough.</b> QLocale().toString(params.sig_period / 86400, "f", 2), self.tr("Minimum delay between 2 certifications (in days)"), QLocale().toString(params.sig_validity / 86400, "f", 2), - self.tr("Maximum age of a valid signature (in days)"), + self.tr("Maximum validity time of a certification (in days)"), params.sig_qty, - self.tr("Minimum quantity of signatures to be part of the WoT"), + self.tr("Minimum quantity of certifications to be part of the WoT"), params.sig_stock, - self.tr("Maximum quantity of active certifications made by member."), + self.tr("Maximum quantity of active certifications per member"), params.sig_window, self.tr( - "Maximum delay a certification can wait before being expired for non-writing." + "Maximum time before a pending certification expire" ), params.xpercent, self.tr( "Minimum percent of sentries to reach to match the distance rule" ), params.ms_validity / 86400, - self.tr("Maximum age of a valid membership (in days)"), + self.tr("Maximum validity time of a membership (in days)"), params.step_max, self.tr("Maximum distance between each WoT member and a newcomer"), ) diff --git a/src/sakia/gui/preferences.ui b/src/sakia/gui/preferences.ui index 03c4e3f68528025988681bf129b139686a8e995c..e90b5eecd46d69759e0fe1cf1c7c09a8fc88205b 100644 --- a/src/sakia/gui/preferences.ui +++ b/src/sakia/gui/preferences.ui @@ -30,7 +30,7 @@ <string>General</string> </property> <property name="icon"> - <iconset> + <iconset resource="../../../res/icons/sakia.icons.qrc"> <normaloff>:/icons/settings_app_icon</normaloff>:/icons/settings_app_icon</iconset> </property> <property name="iconSize"> @@ -50,7 +50,7 @@ <string>Display</string> </property> <property name="icon"> - <iconset> + <iconset resource="../../../res/icons/sakia.icons.qrc"> <normaloff>:/icons/settings_display_icon</normaloff>:/icons/settings_display_icon</iconset> </property> <property name="iconSize"> @@ -70,7 +70,7 @@ <string>Network</string> </property> <property name="icon"> - <iconset> + <iconset resource="../../../res/icons/sakia.icons.qrc"> <normaloff>:/icons/settings_network_icon</normaloff>:/icons/settings_network_icon</iconset> </property> <property name="iconSize"> @@ -96,7 +96,7 @@ <item> <widget class="QStackedWidget" name="stackedWidget"> <property name="currentIndex"> - <number>1</number> + <number>2</number> </property> <widget class="QWidget" name="page"> <layout class="QVBoxLayout" name="verticalLayout_7"> @@ -328,7 +328,7 @@ <item> <widget class="QLabel" name="label_6"> <property name="text"> - <string>Proxy server address : </string> + <string>Proxy server address</string> </property> </widget> </item> @@ -352,7 +352,7 @@ <item> <widget class="QLabel" name="label"> <property name="text"> - <string>Proxy username :</string> + <string>Proxy username</string> </property> </widget> </item> @@ -366,7 +366,7 @@ <item> <widget class="QLabel" name="label_8"> <property name="text"> - <string>Proxy password : </string> + <string>Proxy password</string> </property> </widget> </item> diff --git a/src/sakia/gui/sub/certification/controller.py b/src/sakia/gui/sub/certification/controller.py index c4ad39af47d93e5abaa1e98a7419a0f75db259b5..6a4616d54a9e120f61f344aca9397905c6523dbb 100644 --- a/src/sakia/gui/sub/certification/controller.py +++ b/src/sakia/gui/sub/certification/controller.py @@ -153,7 +153,7 @@ communication means and imitate the voice of the person.<br/> <br/> The 2°) is however preferable to the 3°)... whereas <b>1°) is mandatory in any case.</b><br/> <br/> -<b>Reminder</b> : Certifying is not only uniquely ensuring that you met the person, its ensuring the {:} community +<b>Reminder</b>: Certifying is not only uniquely ensuring that you met the person, its ensuring the {:} community that you know her well enough and that you will know how to find a double account done by a person certified by you using cross checking which will help to reveal the problem if needs to be.</br>""".format( ROOT_SERVERS[self.model.app.currency]["display"] diff --git a/src/sakia/gui/sub/certification/view.py b/src/sakia/gui/sub/certification/view.py index dcf430e46c5ae124f723e197eca7074602b6be97..eef91ce2b5fef851ddf8d4fb0587fa74212a62c7 100644 --- a/src/sakia/gui/sub/certification/view.py +++ b/src/sakia/gui/sub/certification/view.py @@ -111,7 +111,7 @@ class CertificationView(QWidget, Ui_CertificationWidget): def import_identity_document(self): file_name = QFileDialog.getOpenFileName( self, - self.tr("Open identity document"), + self.tr("Import identity document"), "", self.tr("Duniter documents (*.txt)"), ) @@ -153,13 +153,13 @@ class CertificationView(QWidget, Ui_CertificationWidget): if notification: toast.display( self.tr("Certification"), - self.tr("Could not broadcast certification : {0}".format(error_txt)), + self.tr("Could not broadcast certification: {0}".format(error_txt)), ) else: await QAsyncMessageBox.critical( self, self.tr("Certification"), - self.tr("Could not broadcast certification : {0}".format(error_txt)), + self.tr("Could not broadcast certification: {0}".format(error_txt)), ) def display_cert_stock( @@ -180,7 +180,7 @@ class CertificationView(QWidget, Ui_CertificationWidget): :param int remaining_hours: :param int remaining_minutes: """ - cert_text = self.tr("Certifications sent : {nb_certifications}/{stock}").format( + cert_text = self.tr("Certifications sent: {nb_certifications}/{stock}").format( nb_certifications=written, stock=stock ) if pending > 0: @@ -196,7 +196,7 @@ class CertificationView(QWidget, Ui_CertificationWidget): ) cert_text += "\n" cert_text += self.tr( - "Remaining time before next certification validation : {0}".format( + "Remaining time before next certification validation: {0}".format( remaining_localized ) ) diff --git a/src/sakia/gui/sub/transfer/transfer.ui b/src/sakia/gui/sub/transfer/transfer.ui index fd3081fb20fdbbb0a3b618a5878f37a509f5ba31..603f2beae8fe242537e7c86efa3149b10587e130 100644 --- a/src/sakia/gui/sub/transfer/transfer.ui +++ b/src/sakia/gui/sub/transfer/transfer.ui @@ -185,7 +185,7 @@ <item> <widget class="QLabel" name="label_total"> <property name="text"> - <string>Available money : </string> + <string>Available money: </string> </property> </widget> </item> diff --git a/src/sakia/gui/sub/transfer/view.py b/src/sakia/gui/sub/transfer/view.py index 10a8ae6e0273c91eaa909c761b905ab32703dc73..755bc204a408662d486d0098cda98c81210f7694 100644 --- a/src/sakia/gui/sub/transfer/view.py +++ b/src/sakia/gui/sub/transfer/view.py @@ -207,7 +207,7 @@ class TransferView(QWidget, Ui_TransferMoneyWidget): async def show_error(self, notification, error_txt): if notification: - toast.display(self.tr("Transfer"), "Error : {0}".format(error_txt)) + toast.display(self.tr("Transfer"), "Error: {0}".format(error_txt)) else: await QAsyncMessageBox.critical(self, self.tr("Transfer"), error_txt) diff --git a/src/sakia/gui/sub/user_information/view.py b/src/sakia/gui/sub/user_information/view.py index eb16a3af626076c398a841ab2da0ba8ff37829a6..0f58ec5cbed96c30af0a17f571415f6132c51fdc 100644 --- a/src/sakia/gui/sub/user_information/view.py +++ b/src/sakia/gui/sub/user_information/view.py @@ -92,7 +92,7 @@ class UserInformationView(QWidget, Ui_UserInformationWidget): Display the uid in the label :param str uid: """ - status_label = self.tr("Member") if member else self.tr("Non-Member") + status_label = self.tr("Member") if member else self.tr("Not a member") status_color = "#00AA00" if member else self.tr("#FF0000") text = "<b>{uid}</b> <p style='color: {status_color};'>({status_label})</p>".format( uid=uid, status_color=status_color, status_label=status_label diff --git a/src/sakia/gui/widgets/context_menu.py b/src/sakia/gui/widgets/context_menu.py index ae3baed9f801478b2eea9da0596d73dd1e03bba6..fcb4dc117a28acae41d8ac751aff176230704dce 100644 --- a/src/sakia/gui/widgets/context_menu.py +++ b/src/sakia/gui/widgets/context_menu.py @@ -237,7 +237,7 @@ class ContextMenu(QObject): self.qmenu, self.tr("Warning"), self.tr( - """Are you sure ? + """Are you sure? This money transfer will be removed and not sent.""" ), QMessageBox.Ok | QMessageBox.Cancel, diff --git a/src/sakia/main.py b/src/sakia/main.py index a532f9752a5513d538dcad7ca0e94af0c39fee45..16a46f68fb0cc851736215726c788939da8c2214 100755 --- a/src/sakia/main.py +++ b/src/sakia/main.py @@ -39,7 +39,7 @@ def exit_exception_handler(loop, context): exc_info = (type(exception), exception, exception.__traceback__) logging.debug( - "An unhandled exception occured : {0}".format(message), exc_info=exc_info + "An unhandled exception occurred: {0}".format(message), exc_info=exc_info ) @@ -163,7 +163,7 @@ def main(): reply = QMessageBox.critical( None, "Error", - "Error connecting to the network : {:}. Keep Trying ?".format( + "Error connecting to the network: {:}. Keep Trying?".format( str(e) ), QMessageBox.Ok | QMessageBox.Abort, diff --git a/src/sakia/services/documents.py b/src/sakia/services/documents.py index 119026c6943a18032ee8a4013775cb1739abc282..b04d1246a4dca449805a1c7b7776a4d0b83922c1 100644 --- a/src/sakia/services/documents.py +++ b/src/sakia/services/documents.py @@ -95,7 +95,7 @@ class DocumentsService: :param sakia.data.entities.Connection connection: the connection published """ - self._logger.debug("Key publish : {0}".format(identity_doc.signed_raw())) + self._logger.debug("Key publish: {0}".format(identity_doc.signed_raw())) responses = await self._bma_connector.broadcast( connection.currency, @@ -110,7 +110,7 @@ class DocumentsService: self, currency, identity_document, revocation_document ): signed_raw = revocation_document.signed_raw() - self._logger.debug("Broadcasting : \n" + signed_raw) + self._logger.debug("Broadcasting: \n" + signed_raw) responses = await self._bma_connector.broadcast( currency, bma.wot.revoke, req_args={"revocation_signed_raw": signed_raw} ) @@ -154,7 +154,7 @@ class DocumentsService: ) key = SigningKey.from_credentials(secret_key, password, connection.scrypt_params) membership.sign([key]) - self._logger.debug("Membership : {0}".format(membership.signed_raw())) + self._logger.debug("Membership: {0}".format(membership.signed_raw())) responses = await self._bma_connector.broadcast( connection.currency, bma.blockchain.membership, @@ -202,7 +202,7 @@ class DocumentsService: key = SigningKey.from_credentials(secret_key, password, connection.scrypt_params) certification.sign([key]) signed_cert = certification.signed_raw() - self._logger.debug("Certification : {0}".format(signed_cert)) + self._logger.debug("Certification: {0}".format(signed_cert)) timestamp = self._blockchain_processor.time(connection.currency) responses = await self._bma_connector.broadcast( connection.currency, bma.wot.certify, req_args={"certification_signed_raw": signed_cert} @@ -232,16 +232,16 @@ class DocumentsService: revocation.sign([key]) self._logger.debug( - "Self-Revokation Document : \n{0}".format(revocation.raw()) + "Self-Revocation Document: \n{0}".format(revocation.raw()) ) - self._logger.debug("Signature : \n{0}".format(revocation.signatures[0])) + self._logger.debug("Signature: \n{0}".format(revocation.signatures[0])) data = { "pubkey": identity.pubkey, "self_": self_cert.signed_raw(), "sig": revocation.signatures[0], } - self._logger.debug("Posted data : {0}".format(data)) + self._logger.debug("Posted data: {0}".format(data)) responses = await self._bma_connector.broadcast( currency, bma.wot.revoke, data ) @@ -320,7 +320,7 @@ class DocumentsService: amount ) * (10 ** amount_base) # we round the overhead in the current base - # exemple : 12 in base 1 -> 1*10^1 + # example: 12 in base 1 -> 1*10^1 overhead = int(round(float(overhead) / (10 ** current_base))) source_value = s.amount * (10 ** s.base) out = int( @@ -475,12 +475,12 @@ class DocumentsService: ) forged_tx += chained_tx self._sources_processor.consume(sources) - logging.debug("Inputs : {0}".format(sources)) + logging.debug("Inputs: {0}".format(sources)) inputs = self.tx_inputs(sources) unlocks = self.tx_unlocks(sources) outputs = self.tx_outputs(key.pubkey, receiver, computed_outputs, overheads) - logging.debug("Outputs : {0}".format(outputs)) + logging.debug("Outputs: {0}".format(outputs)) txdoc = TransactionDoc( 10, currency, @@ -547,7 +547,7 @@ class DocumentsService: ) for i, tx in enumerate(tx_entities): - logging.debug("Transaction : [{0}]".format(tx.raw)) + logging.debug("Transaction: [{0}]".format(tx.raw)) tx.txid = i tx_res, tx_entities[i] = await self._transactions_processor.send( tx, connection.currency diff --git a/src/sakia/services/identities.py b/src/sakia/services/identities.py index ced7e87914306b4373cd678172edd4634c0f65f9..159ff8a306828104238b519f0bb583522a4c67a0 100644 --- a/src/sakia/services/identities.py +++ b/src/sakia/services/identities.py @@ -204,7 +204,7 @@ class IdentitiesService(QObject): ) self._certs_processor.insert_or_update_certification(cert) except errors.DuniterError as e: - logging.debug("Certified by error : {0}".format(str(e))) + logging.debug("Certified by error: {0}".format(str(e))) except NoPeerAvailable as e: logging.debug(str(e)) return certifiers, certified @@ -253,7 +253,7 @@ class IdentitiesService(QObject): identity.written = False if identity.pubkey in self._connections_processor.pubkeys(): self._identities_processor.insert_or_update_identity(identity) - logging.debug("Certified by error : {0}".format(str(e))) + logging.debug("Certified by error: {0}".format(str(e))) except NoPeerAvailable as e: logging.debug(str(e)) return certifications @@ -299,7 +299,7 @@ class IdentitiesService(QObject): errors.NO_MATCHING_IDENTITY, errors.NO_MEMBER_MATCHING_PUB_OR_UID, ): - logging.debug("Certified by error : {0}".format(str(e))) + logging.debug("Certified by error: {0}".format(str(e))) identity.written = False if identity.pubkey in self._connections_processor.pubkeys(): self._identities_processor.insert_or_update_identity(identity) diff --git a/src/sakia/services/network.py b/src/sakia/services/network.py index dc7dc2a8f3d3b7ce55f13604026100b3876635f9..00f2033ee0c67e4a2e2c4576e618299c6831378c 100644 --- a/src/sakia/services/network.py +++ b/src/sakia/services/network.py @@ -233,7 +233,7 @@ class NetworkService(QObject): else: node, updated = self._processor.update_peer(self.currency, peer) if not node: - self._logger.debug("New node found : {0}".format(peer.pubkey[:5])) + self._logger.debug("New node found: {0}".format(peer.pubkey[:5])) try: connector = NodeConnector.from_peer( self.currency, peer, self._app.parameters @@ -269,12 +269,12 @@ class NetworkService(QObject): not in [p.signatures[0] for p in self._discovery_stack] ): self._logger.debug( - "Stacking new peer document : {0}".format(peer.pubkey) + "Stacking new peer document: {0}".format(peer.pubkey) ) self._discovery_stack.append(peer) else: self._logger.debug( - "Wrong document received : {0}".format(peer.signed_raw()) + "Wrong document received: {0}".format(peer.signed_raw()) ) @pyqtSlot() @@ -303,10 +303,10 @@ class NetworkService(QObject): ws2p_heads = {} for r in responses: if isinstance(r, errors.DuniterError): - self._logger.debug("Exception in responses : " + str(r)) + self._logger.debug("Exception in responses: " + str(r)) continue elif isinstance(r, BaseException): - self._logger.debug("Exception in responses : " + str(r)) + self._logger.debug("Exception in responses: " + str(r)) else: if r: for head_data in r["heads"]: @@ -345,7 +345,7 @@ class NetworkService(QObject): # if hash of last block in DB <> hash of current block in trusted nodes... if self._block_found.sha_hash != current_buid.sha_hash: - self._logger.debug("Latest block changed : {0}".format(current_buid.number)) + self._logger.debug("Latest block changed: {0}".format(current_buid.number)) self.latest_block_changed.emit(current_buid) self._logger.debug("Start refresh") self._block_found = current_buid diff --git a/src/sakia/services/transactions.py b/src/sakia/services/transactions.py index e32b6707861abd6016b9764ad902adb88965a28c..1db7fda6a864ad86f925028fc2350b8db364027b 100644 --- a/src/sakia/services/transactions.py +++ b/src/sakia/services/transactions.py @@ -117,7 +117,7 @@ class TransactionsService(QObject): ): transfers_changed.append(tx) self._logger.debug( - "New transaction validated : {0}".format(tx.sha_hash) + "New transaction validated: {0}".format(tx.sha_hash) ) for tx_data in history_data["history"]["received"]: tx_doc = TransactionDoc.from_bma_history( @@ -231,7 +231,7 @@ class TransactionsService(QObject): ): transfers_changed.append(tx) self._logger.debug( - "New transaction validated : {0}".format(tx.sha_hash) + "New transaction validated: {0}".format(tx.sha_hash) ) for tx_data in history_data["history"]["received"]: tx_doc = TransactionDoc.from_bma_history(