diff --git a/src/tests/mock/bitmessagemock.py b/src/tests/mock/bitmessagemock.py index ee707e92..4d357388 100644 --- a/src/tests/mock/bitmessagemock.py +++ b/src/tests/mock/bitmessagemock.py @@ -1,6 +1,15 @@ +# pylint: disable=too-many-lines,import-error,no-name-in-module,unused-argument, no-else-return, unused-variable +# pylint: disable=too-many-ancestors,too-many-locals,useless-super-delegation, attribute-defined-outside-init +# pylint: disable=protected-access, super-with-arguments, pointless-statement, no-method-argument, too-many-function-args +# pylint: disable=import-outside-toplevel,ungrouped-imports,wrong-import-order,unused-import,arguments-differ +# pylint: disable=invalid-name,unnecessary-comprehension,broad-except,simplifiable-if-expression,no-member, consider-using-in +# pylint: disable=too-many-return-statements, unnecessary-pass, bad-option-value, abstract-method, consider-using-f-string + + """ Bitmessage mock """ + from pybitmessage.class_addressGenerator import addressGenerator from pybitmessage.inventory import Inventory from pybitmessage.bmconfigparser import BMConfigParser @@ -12,7 +21,7 @@ class MockMain: def start(self): """Start main application""" - # pylint: disable=too-many-statements,too-many-branches,too-many-locals, unused-variable + # pylint: disable=too-many-statements,too-many-branches, unused-variable config = BMConfigParser() daemon = config.safeGetBoolean('bitmessagesettings', 'daemon') # Start the address generation thread @@ -26,8 +35,6 @@ class MockMain: state.kivyapp.run() - - def main(): """Triggers main module""" mainprogram = MockMain() diff --git a/src/tests/mock/pybitmessage/addresses.py b/src/tests/mock/pybitmessage/addresses.py index cf42bc26..8f38f720 100644 --- a/src/tests/mock/pybitmessage/addresses.py +++ b/src/tests/mock/pybitmessage/addresses.py @@ -1,3 +1,11 @@ +# pylint: disable=too-many-lines,import-error,no-name-in-module,unused-argument, no-else-return, unused-variable, chained-comparison +# pylint: disable=too-many-ancestors,too-many-locals,useless-super-delegation, attribute-defined-outside-init, no-self-use +# pylint: disable=protected-access, super-with-arguments, pointless-statement, no-method-argument, too-many-function-args +# pylint: disable=import-outside-toplevel,ungrouped-imports,wrong-import-order,unused-import,arguments-differ, too-few-public-methods +# pylint: disable=invalid-name,unnecessary-comprehension,broad-except,simplifiable-if-expression,no-member, consider-using-in +# pylint: disable=too-many-return-statements, unnecessary-pass, bad-option-value, abstract-method, consider-using-f-string + + """ Operations with addresses """ @@ -6,8 +14,6 @@ import hashlib from binascii import hexlify, unhexlify from struct import pack, unpack -# from debug import logger - ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" diff --git a/src/tests/mock/pybitmessage/baseclass/addressbook.py b/src/tests/mock/pybitmessage/baseclass/addressbook.py index a22893f3..2c3983ef 100644 --- a/src/tests/mock/pybitmessage/baseclass/addressbook.py +++ b/src/tests/mock/pybitmessage/baseclass/addressbook.py @@ -1,3 +1,13 @@ +# pylint: disable=too-many-lines,import-error,no-name-in-module,unused-argument, no-else-return, unused-variable +# pylint: disable=too-many-ancestors,too-many-locals,useless-super-delegation, attribute-defined-outside-init, no-self-use +# pylint: disable=protected-access, super-with-arguments, pointless-statement, no-method-argument, too-many-function-args +# pylint: disable=import-outside-toplevel,ungrouped-imports,wrong-import-order,unused-import,arguments-differ, too-few-public-methods +# pylint: disable=invalid-name,unnecessary-comprehension,broad-except,simplifiable-if-expression,no-member, consider-using-in +# pylint: disable=too-many-return-statements, unnecessary-pass, bad-option-value, abstract-method, consider-using-f-string + +''' +Address book screen +''' from pybitmessage.get_platform import platform from kivy.clock import Clock from kivy.properties import ( diff --git a/src/tests/mock/pybitmessage/baseclass/allmail.py b/src/tests/mock/pybitmessage/baseclass/allmail.py index e389d871..9255573d 100644 --- a/src/tests/mock/pybitmessage/baseclass/allmail.py +++ b/src/tests/mock/pybitmessage/baseclass/allmail.py @@ -1,3 +1,14 @@ +# pylint: disable=too-many-lines,import-error,no-name-in-module,unused-argument, no-else-return, unused-variable +# pylint: disable=too-many-ancestors,too-many-locals,useless-super-delegation, attribute-defined-outside-init +# pylint: disable=protected-access, super-with-arguments, pointless-statement +# pylint: disable=import-outside-toplevel,ungrouped-imports,wrong-import-order,unused-import,arguments-differ +# pylint: disable=invalid-name,unnecessary-comprehension,broad-except,simplifiable-if-expression,no-member, consider-using-in +# pylint: disable=too-many-return-statements, unnecessary-pass, bad-option-value, abstract-method, consider-using-f-string + +""" +All Mails Screen Functionality +""" + from functools import partial from kivy.clock import Clock from kivy.properties import ( diff --git a/src/tests/mock/pybitmessage/baseclass/draft.py b/src/tests/mock/pybitmessage/baseclass/draft.py index 1c037722..e8cd1361 100644 --- a/src/tests/mock/pybitmessage/baseclass/draft.py +++ b/src/tests/mock/pybitmessage/baseclass/draft.py @@ -1,6 +1,16 @@ -from pybitmessage.bmconfigparser import BMConfigParser +# pylint: disable=too-many-lines,import-error,no-name-in-module,unused-argument, no-else-return, unused-variable +# pylint: disable=too-many-ancestors,too-many-locals,useless-super-delegation, attribute-defined-outside-init +# pylint: disable=protected-access +# pylint: disable=import-outside-toplevel,ungrouped-imports,wrong-import-order,unused-import,arguments-differ +# pylint: disable=invalid-name,unnecessary-comprehension,broad-except,simplifiable-if-expression,no-member +# pylint: disable=too-many-return-statements + +""" +Draft Screen +""" + from functools import partial -from pybitmessage.addresses import decodeAddress + from kivy.clock import Clock from kivy.properties import ( ListProperty, @@ -10,7 +20,8 @@ from kivy.uix.screenmanager import Screen from kivymd.uix.label import MDLabel from pybitmessage import state - +from pybitmessage.bmconfigparser import BMConfigParser +from pybitmessage.addresses import decodeAddress from pybitmessage.baseclass.common import ( showLimitedCnt, toast, ThemeClsColor, SwipeToDeleteItem, ShowTimeHistoy @@ -43,7 +54,7 @@ class Draft(Screen): # self.account = state.association self.loadDraft() - def loadDraft(self, where="", what=""): + def loadDraft(self): """Load draft list for Draft messages""" self.account = state.association xAddress = 'fromaddress' @@ -99,13 +110,13 @@ class Draft(Screen): updated_msg = len(self.ids.ml.children) self.has_refreshed = True if total_draft_msg != updated_msg else False - def check_scroll_y(self, instance, somethingelse): + def check_scroll_y(self): """Load data on scroll""" if self.ids.scroll_y.scroll_y <= -0.0 and self.has_refreshed: self.ids.scroll_y.scroll_y = 0.06 total_draft_msg = len(self.ids.ml.children) - def draft_detail(self, ackdata, instance, *args): + def draft_detail(self, ackdata, instance): """Show draft Details""" if instance.state == 'closed': instance.ids.delete_msg.disabled = True @@ -122,7 +133,7 @@ class Draft(Screen): else: instance.ids.delete_msg.disabled = False - def delete_draft(self, data_index, instance, *args): + def delete_draft(self, instance): """Delete draft message permanently""" if int(state.draft_count) > 0: state.draft_count = str(int(state.draft_count) - 1) diff --git a/src/tests/mock/pybitmessage/baseclass/inbox.py b/src/tests/mock/pybitmessage/baseclass/inbox.py index bbfe5abd..b4332d01 100644 --- a/src/tests/mock/pybitmessage/baseclass/inbox.py +++ b/src/tests/mock/pybitmessage/baseclass/inbox.py @@ -1,3 +1,14 @@ +# pylint: disable=too-many-lines,import-error,no-name-in-module,unused-argument, no-else-return, unused-variable +# pylint: disable=too-many-ancestors,too-many-locals,useless-super-delegation, attribute-defined-outside-init +# pylint: disable=protected-access, super-with-arguments, pointless-statement +# pylint: disable=import-outside-toplevel,ungrouped-imports,wrong-import-order,unused-import,arguments-differ +# pylint: disable=invalid-name,unnecessary-comprehension,broad-except,simplifiable-if-expression,no-member, consider-using-in +# pylint: disable=too-many-return-statements, unnecessary-pass, bad-option-value, abstract-method, consider-using-f-string + +""" +All Mails Screen Functionality +""" + from kivy.clock import Clock from kivy.properties import ( ListProperty, diff --git a/src/tests/mock/pybitmessage/baseclass/login.py b/src/tests/mock/pybitmessage/baseclass/login.py index d082b739..61f79259 100644 --- a/src/tests/mock/pybitmessage/baseclass/login.py +++ b/src/tests/mock/pybitmessage/baseclass/login.py @@ -1,14 +1,25 @@ +# pylint: disable=too-many-lines,import-error,no-name-in-module,unused-argument +# pylint: disable=too-many-ancestors,too-many-locals,useless-super-delegation +# pylint: disable=protected-access +# pylint: disable=import-outside-toplevel,ungrouped-imports,wrong-import-order,unused-import,arguments-differ +# pylint: disable=invalid-name,unnecessary-comprehension,broad-except,simplifiable-if-expression,no-member +# pylint: disable=too-many-return-statements + +""" +Login screen +""" +# pylint: disable=redefined-outer-name,inconsistent-return-statements +from kivy.clock import Clock +from kivy.uix.boxlayout import BoxLayout +from kivy.uix.screenmanager import Screen +from kivy.properties import StringProperty, BooleanProperty +from kivymd.uix.behaviors.elevation import RectangularElevationBehavior + from pybitmessage import queues from pybitmessage.bmconfigparser import BMConfigParser from pybitmessage import state from pybitmessage.baseclass.common import toast -from kivy.clock import Clock -from kivy.properties import StringProperty, BooleanProperty -from kivy.uix.boxlayout import BoxLayout -from kivymd.uix.behaviors.elevation import RectangularElevationBehavior -from kivy.uix.screenmanager import Screen - class Login(Screen): """Login Screeen class for kivy Ui""" @@ -85,7 +96,7 @@ class Random(Screen): if entered_label in lables: instance.error = True instance.helper_text = 'it is already exist you'\ - ' can try this Ex. ( {0}_1, {0}_2 )'.format( + 'can try this Ex. ( {0}_1, {0}_2 )'.format( entered_label) elif entered_label: instance.error = False diff --git a/src/tests/mock/pybitmessage/baseclass/maildetail.py b/src/tests/mock/pybitmessage/baseclass/maildetail.py index 81e62cc8..4ec847eb 100644 --- a/src/tests/mock/pybitmessage/baseclass/maildetail.py +++ b/src/tests/mock/pybitmessage/baseclass/maildetail.py @@ -1,3 +1,14 @@ +# pylint: disable=too-many-lines,import-error,no-name-in-module,unused-argument, no-else-return, unused-variable +# pylint: disable=too-many-ancestors,too-many-locals,useless-super-delegation, attribute-defined-outside-init +# pylint: disable=protected-access, super-with-arguments, pointless-statement +# pylint: disable=import-outside-toplevel,ungrouped-imports,wrong-import-order,unused-import,arguments-differ +# pylint: disable=invalid-name,unnecessary-comprehension,broad-except,simplifiable-if-expression,no-member, consider-using-in +# pylint: disable=too-many-return-statements, unnecessary-pass, bad-option-value, abstract-method, consider-using-f-string + +""" +Mail Detail Screen Functionality +""" + from datetime import datetime from kivy.core.clipboard import Clipboard diff --git a/src/tests/mock/pybitmessage/baseclass/msg_composer.py b/src/tests/mock/pybitmessage/baseclass/msg_composer.py index f047fb7e..a6ff0258 100644 --- a/src/tests/mock/pybitmessage/baseclass/msg_composer.py +++ b/src/tests/mock/pybitmessage/baseclass/msg_composer.py @@ -1,3 +1,14 @@ +# pylint: disable=too-many-lines,import-error,no-name-in-module,unused-argument, no-else-return, unused-variable +# pylint: disable=too-many-ancestors,too-many-locals,useless-super-delegation, attribute-defined-outside-init +# pylint: disable=protected-access, super-with-arguments +# pylint: disable=import-outside-toplevel,ungrouped-imports,wrong-import-order,unused-import,arguments-differ +# pylint: disable=invalid-name,unnecessary-comprehension,broad-except,simplifiable-if-expression,no-member +# pylint: disable=too-many-return-statements + +""" +Message Composer +""" + from pybitmessage.get_platform import platform from pybitmessage.bmconfigparser import BMConfigParser from kivy.clock import Clock diff --git a/src/tests/mock/pybitmessage/baseclass/myaddress.py b/src/tests/mock/pybitmessage/baseclass/myaddress.py index 2073b951..fa4b384a 100644 --- a/src/tests/mock/pybitmessage/baseclass/myaddress.py +++ b/src/tests/mock/pybitmessage/baseclass/myaddress.py @@ -1,3 +1,14 @@ +# pylint: disable=too-many-lines,import-error,no-name-in-module,unused-argument, no-else-return, unused-variable +# pylint: disable=too-many-ancestors,too-many-locals,useless-super-delegation, attribute-defined-outside-init +# pylint: disable=protected-access, super-with-arguments, pointless-statement +# pylint: disable=import-outside-toplevel,ungrouped-imports,wrong-import-order,unused-import,arguments-differ +# pylint: disable=invalid-name,unnecessary-comprehension,broad-except,simplifiable-if-expression,no-member +# pylint: disable=too-many-return-statements, unnecessary-pass, bad-option-value, abstract-method + +""" +My Addresses Screen +""" + from pybitmessage.get_platform import platform from functools import partial from pybitmessage.bmconfigparser import BMConfigParser diff --git a/src/tests/mock/pybitmessage/baseclass/network.py b/src/tests/mock/pybitmessage/baseclass/network.py index cbe18504..2be55ebc 100644 --- a/src/tests/mock/pybitmessage/baseclass/network.py +++ b/src/tests/mock/pybitmessage/baseclass/network.py @@ -1,3 +1,14 @@ +# pylint: disable=too-many-lines,import-error,no-name-in-module,unused-argument, no-else-return, unused-variable +# pylint: disable=too-many-ancestors,too-many-locals,useless-super-delegation, attribute-defined-outside-init +# pylint: disable=protected-access, super-with-arguments +# pylint: disable=import-outside-toplevel,ungrouped-imports,wrong-import-order,unused-import,arguments-differ +# pylint: disable=invalid-name,unnecessary-comprehension,broad-except,simplifiable-if-expression,no-member +# pylint: disable=too-many-return-statements, unnecessary-pass + +""" +Network Screen +""" + from kivy.clock import Clock from kivy.properties import StringProperty from kivy.uix.screenmanager import Screen diff --git a/src/tests/mock/pybitmessage/baseclass/payment.py b/src/tests/mock/pybitmessage/baseclass/payment.py index c286888c..a51aa6ad 100644 --- a/src/tests/mock/pybitmessage/baseclass/payment.py +++ b/src/tests/mock/pybitmessage/baseclass/payment.py @@ -1,6 +1,14 @@ +# pylint: disable=too-many-lines,import-error,no-name-in-module,unused-argument, no-else-return, unused-variable +# pylint: disable=too-many-ancestors,too-many-locals,useless-super-delegation, attribute-defined-outside-init, no-self-use +# pylint: disable=protected-access, super-with-arguments, pointless-statement, no-method-argument, too-many-function-args +# pylint: disable=import-outside-toplevel,ungrouped-imports,wrong-import-order,unused-import,arguments-differ, too-few-public-methods +# pylint: disable=invalid-name,unnecessary-comprehension,broad-except,simplifiable-if-expression,no-member, consider-using-in +# pylint: disable=too-many-return-statements, unnecessary-pass, bad-option-value, abstract-method, consider-using-f-string + ''' This is for payment related part ''' + from kivy.uix.boxlayout import BoxLayout from kivymd.uix.behaviors.elevation import RectangularElevationBehavior from kivy.uix.screenmanager import Screen diff --git a/src/tests/mock/pybitmessage/baseclass/popup.py b/src/tests/mock/pybitmessage/baseclass/popup.py index eba6b494..9bd237e3 100644 --- a/src/tests/mock/pybitmessage/baseclass/popup.py +++ b/src/tests/mock/pybitmessage/baseclass/popup.py @@ -1,3 +1,13 @@ +# pylint: disable=too-many-lines,import-error,no-name-in-module,unused-argument, no-else-return, unused-variable +# pylint: disable=too-many-ancestors,too-many-locals,useless-super-delegation, attribute-defined-outside-init +# pylint: disable=protected-access, super-with-arguments, pointless-statement +# pylint: disable=import-outside-toplevel,ungrouped-imports,wrong-import-order,unused-import,arguments-differ +# pylint: disable=invalid-name,unnecessary-comprehension,broad-except,simplifiable-if-expression,no-member, consider-using-in +# pylint: disable=too-many-return-statements, unnecessary-pass, bad-option-value, abstract-method, consider-using-f-string + +""" +Popup Screen Functionality +""" from kivy.clock import Clock from kivy.metrics import dp diff --git a/src/tests/mock/pybitmessage/baseclass/qrcode.py b/src/tests/mock/pybitmessage/baseclass/qrcode.py index 46867990..c0fa3cbb 100644 --- a/src/tests/mock/pybitmessage/baseclass/qrcode.py +++ b/src/tests/mock/pybitmessage/baseclass/qrcode.py @@ -1,3 +1,14 @@ +# pylint: disable=too-many-lines,import-error,no-name-in-module,unused-argument, no-else-return, unused-variable +# pylint: disable=too-many-ancestors,too-many-locals,useless-super-delegation, attribute-defined-outside-init +# pylint: disable=protected-access, super-with-arguments, pointless-statement +# pylint: disable=import-outside-toplevel,ungrouped-imports,wrong-import-order,unused-import,arguments-differ +# pylint: disable=invalid-name,unnecessary-comprehension,broad-except,simplifiable-if-expression,no-member +# pylint: disable=too-many-return-statements, unnecessary-pass + +""" +QR Code Generator +""" + from pybitmessage import state from pybitmessage.baseclass.common import toast from kivy.uix.screenmanager import Screen diff --git a/src/tests/mock/pybitmessage/baseclass/scan_screen.py b/src/tests/mock/pybitmessage/baseclass/scan_screen.py index a2bbff78..ad1eb8ed 100644 --- a/src/tests/mock/pybitmessage/baseclass/scan_screen.py +++ b/src/tests/mock/pybitmessage/baseclass/scan_screen.py @@ -1,3 +1,13 @@ +# pylint: disable=too-many-lines,import-error,no-name-in-module,unused-argument, no-else-return, unused-variable +# pylint: disable=too-many-ancestors,too-many-locals,useless-super-delegation, attribute-defined-outside-init +# pylint: disable=protected-access, super-with-arguments +# pylint: disable=import-outside-toplevel,ungrouped-imports,wrong-import-order,unused-import,arguments-differ +# pylint: disable=invalid-name,unnecessary-comprehension,broad-except,simplifiable-if-expression,no-member +# pylint: disable=too-many-return-statements, unnecessary-pass + +""" +Scan screen +""" import os from pybitmessage.get_platform import platform diff --git a/src/tests/mock/pybitmessage/baseclass/sent.py b/src/tests/mock/pybitmessage/baseclass/sent.py index a44aaf3b..e2f1dbc8 100644 --- a/src/tests/mock/pybitmessage/baseclass/sent.py +++ b/src/tests/mock/pybitmessage/baseclass/sent.py @@ -1,3 +1,14 @@ +# pylint: disable=too-many-lines,import-error,no-name-in-module,unused-argument, no-else-return, unused-variable +# pylint: disable=too-many-ancestors,too-many-locals,useless-super-delegation, attribute-defined-outside-init +# pylint: disable=protected-access, super-with-arguments, pointless-statement +# pylint: disable=import-outside-toplevel,ungrouped-imports,wrong-import-order,unused-import,arguments-differ +# pylint: disable=invalid-name,unnecessary-comprehension,broad-except,simplifiable-if-expression,no-member +# pylint: disable=too-many-return-statements, unnecessary-pass + +""" +Sent Screen +""" + from functools import partial from kivy.clock import Clock from kivy.properties import StringProperty, ListProperty diff --git a/src/tests/mock/pybitmessage/baseclass/settings.py b/src/tests/mock/pybitmessage/baseclass/settings.py index d63884b2..88af3c2c 100644 --- a/src/tests/mock/pybitmessage/baseclass/settings.py +++ b/src/tests/mock/pybitmessage/baseclass/settings.py @@ -1,3 +1,8 @@ +# pylint: disable=unnecessary-pass +""" +Setting screen +""" + from kivy.uix.screenmanager import Screen diff --git a/src/tests/mock/pybitmessage/baseclass/trash.py b/src/tests/mock/pybitmessage/baseclass/trash.py index 885e3987..7b9060c0 100644 --- a/src/tests/mock/pybitmessage/baseclass/trash.py +++ b/src/tests/mock/pybitmessage/baseclass/trash.py @@ -1,3 +1,15 @@ +# pylint: disable=too-many-lines,import-error,no-name-in-module,unused-argument, no-else-return, unused-variable +# pylint: disable=too-many-ancestors,too-many-locals,useless-super-delegation, attribute-defined-outside-init, no-self-use +# pylint: disable=protected-access, super-with-arguments, pointless-statement, no-method-argument, too-many-function-args +# pylint: disable=import-outside-toplevel,ungrouped-imports,wrong-import-order,unused-import,arguments-differ, too-few-public-methods +# pylint: disable=invalid-name,unnecessary-comprehension,broad-except,simplifiable-if-expression,no-member, consider-using-in +# pylint: disable=too-many-return-statements, unnecessary-pass, bad-option-value, abstract-method, consider-using-f-string + + +""" +Trash Screen +""" + from kivy.clock import Clock from kivy.properties import ( ListProperty, diff --git a/src/tests/mock/pybitmessage/bmconfigparser.py b/src/tests/mock/pybitmessage/bmconfigparser.py index efeac69b..618b5792 100644 --- a/src/tests/mock/pybitmessage/bmconfigparser.py +++ b/src/tests/mock/pybitmessage/bmconfigparser.py @@ -1,3 +1,10 @@ +# pylint: disable=too-many-lines,import-error,no-name-in-module,unused-argument, no-else-return, unused-variable +# pylint: disable=too-many-ancestors,too-many-locals,useless-super-delegation, attribute-defined-outside-init +# pylint: disable=protected-access +# pylint: disable=import-outside-toplevel,ungrouped-imports,wrong-import-order,unused-import,arguments-differ +# pylint: disable=invalid-name,unnecessary-comprehension,broad-except,simplifiable-if-expression,no-member +# pylint: disable=too-many-return-statements + """ BMConfigParser class definition and default configuration settings """ diff --git a/src/tests/mock/pybitmessage/get_platform.py b/src/tests/mock/pybitmessage/get_platform.py index e4fea889..c2945b88 100644 --- a/src/tests/mock/pybitmessage/get_platform.py +++ b/src/tests/mock/pybitmessage/get_platform.py @@ -1,3 +1,10 @@ +# pylint: disable=too-many-lines,import-error,no-name-in-module,unused-argument +# pylint: disable=too-many-ancestors,too-many-locals,useless-super-delegation +# pylint: disable=protected-access +# pylint: disable=import-outside-toplevel,ungrouped-imports,wrong-import-order,unused-import,arguments-differ +# pylint: disable=invalid-name,unnecessary-comprehension,broad-except,simplifiable-if-expression,no-member +# pylint: disable=too-many-return-statements + from sys import platform as _sys_platform from os import environ @@ -35,6 +42,7 @@ def _get_platform(): return "linux" return "unknown" + platform = _get_platform() if platform not in ("android", "unknown"): diff --git a/src/tests/mock/pybitmessage/mpybit.py b/src/tests/mock/pybitmessage/mpybit.py index 4ed435af..f66e76fc 100644 --- a/src/tests/mock/pybitmessage/mpybit.py +++ b/src/tests/mock/pybitmessage/mpybit.py @@ -37,7 +37,7 @@ from kivymd.uix.list import ( OneLineListItem ) -from kivy.uix.screenmanager import RiseInTransition, SlideTransition, FallOutTransition +from kivy.uix.screenmanager import SlideTransition, FallOutTransition from pybitmessage import queues from pybitmessage import state @@ -53,7 +53,7 @@ if platform != "android": from kivy.config import Config Config.set("input", "mouse", "mouse, multitouch_on_demand") elif platform == "android": - from jnius import autoclass, cast + from jnius import autoclass, cast # noqa:F401 from android.runnable import run_on_ui_thread from android import python_act as PythonActivity @@ -97,7 +97,7 @@ class Lang(Observable): if name == "_": self.observers.append((func, args, kwargs)) else: - return super(Lang, self).fbind(name, func, *largs, **kwargs) + return super(Lang, self).fbind(name, func, **args, **kwargs) def funbind(self, name, func, args, **kwargs): if name == "_": @@ -337,7 +337,6 @@ class NavigateApp(MDApp): # self.add_popup.set_normal_height() self.add_popup.auto_dismiss = False self.add_popup.open() - # p = GrashofPopup() # p.open() def scan_qr_code(self, instance): @@ -406,10 +405,8 @@ class NavigateApp(MDApp): if self.variable_1: first_addr = self.variable_1[0] if BMConfigParser().get(str(first_addr), 'enabled') == 'true': - if os.path.exists( - state.imageDir + '/default_identicon/{}.png'.format(first_addr)): - return state.imageDir + '/default_identicon/{}.png'.format( - first_addr) + if os.path.exists(state.imageDir + '/default_identicon/{}.png'.format(first_addr)): + return state.imageDir + '/default_identicon/{}.png'.format(first_addr) else: return return state.imageDir + '/drawer_logo1.png' @@ -617,7 +614,7 @@ class NavigateApp(MDApp): def set_message_count(self): """Setting message count""" pass - + def on_start(self): """Setting message count""" self.set_message_count() @@ -626,7 +623,7 @@ class NavigateApp(MDApp): def current_address_label(current_add_label=None, current_addr=None): """Getting current address labels""" addresses = [addr for addr in BMConfigParser().addresses() - if BMConfigParser().get(str(addr), 'enabled') == 'true'] + if BMConfigParser().get(str(addr), 'enabled') == 'true'] if addresses: if current_add_label: first_name = current_add_label @@ -775,7 +772,7 @@ class NavigateApp(MDApp): def on_request_close(self, *args): # pylint: disable=no-self-use """This method is for app closing request""" - AppClosingPopup().open() + AppClosingPopup().open() # noqa:F821 return True def file_manager_open(self): @@ -874,9 +871,6 @@ class NavigateApp(MDApp): print("Purchasing {} through {}".format(self.product_id, method_name)) def _after_scan(self, text): - # if platform == 'android': - # toast_txt = cast(CharSequence, String(text)) - # show_toast(toast_txt, Toast.LENGTH_SHORT) if self.root.ids.sc23.previous_open_screen == 'composer': self.root.ids.sc3.children[1].ids.txt_input.text = text self.root.ids.scr_mngr.current = 'create' diff --git a/src/tests/mock/pybitmessage/queues.py b/src/tests/mock/pybitmessage/queues.py index 16faaf82..64b553a1 100644 --- a/src/tests/mock/pybitmessage/queues.py +++ b/src/tests/mock/pybitmessage/queues.py @@ -1,3 +1,10 @@ +# pylint: disable=too-many-lines,import-error,no-name-in-module,unused-argument +# pylint: disable=too-many-ancestors,too-many-locals,useless-super-delegation +# pylint: disable=protected-access +# pylint: disable=import-outside-toplevel,ungrouped-imports,wrong-import-order,unused-import,arguments-differ +# pylint: disable=invalid-name,unnecessary-comprehension,broad-except,simplifiable-if-expression,no-member +# pylint: disable=too-many-return-statements + """Most of the queues used by bitmessage threads are defined here.""" import threading @@ -39,8 +46,6 @@ addressGeneratorQueue = queue.Queue() #: `.network.ReceiveQueueThread` instances dump objects they hear #: on the network into this queue to be processed. objectProcessorQueue = ObjectProcessorQueue() -# invQueue = MultiQueue() -# addrQueue = MultiQueue() portCheckerQueue = queue.Queue() receiveDataQueue = queue.Queue() #: The address generator thread uses this queue to get information back diff --git a/src/tests/mock/pybitmessage/shutdown.py b/src/tests/mock/pybitmessage/shutdown.py index 6ab29e02..23f1b3d8 100644 --- a/src/tests/mock/pybitmessage/shutdown.py +++ b/src/tests/mock/pybitmessage/shutdown.py @@ -1,5 +1,12 @@ +# pylint: disable=too-many-lines,import-error,no-name-in-module,unused-argument +# pylint: disable=too-many-ancestors,too-many-locals,useless-super-delegation +# pylint: disable=protected-access +# pylint: disable=import-outside-toplevel,ungrouped-imports,wrong-import-order,unused-import,arguments-differ +# pylint: disable=invalid-name,unnecessary-comprehension,broad-except,simplifiable-if-expression,no-member +# pylint: disable=too-many-return-statements + """shutdown function""" -import os + import queue as Queue import threading import time @@ -73,12 +80,3 @@ def doCleanShutdown(): queue.task_done() except Queue.Empty: break - - # if state.thisapp.daemon or not state.enableGUI: - # logger.info('Clean shutdown complete.') - # state.thisapp.cleanup() - # os._exit(0) # pylint: disable=protected-access - # else: - # logger.info('Core shutdown complete.') - # for thread in threading.enumerate(): - # logger.debug('Thread %s still running', thread.name)