From 236beaedf6894994f3e26454cc12b46d6c99ad82 Mon Sep 17 00:00:00 2001 From: lakshyacis Date: Thu, 12 Sep 2019 14:41:33 +0530 Subject: [PATCH 1/2] mpybit flake8 fixes --- src/bitmessagekivy/mpybit.py | 12 ++++++------ .../BM-2cXQpSjUCAf8fvAQCvsrLDVkLnDAkSjRGN.png | Bin 0 -> 461 bytes 2 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 src/images/default_identicon/BM-2cXQpSjUCAf8fvAQCvsrLDVkLnDAkSjRGN.png diff --git a/src/bitmessagekivy/mpybit.py b/src/bitmessagekivy/mpybit.py index 740c0bb2..0a6eb023 100644 --- a/src/bitmessagekivy/mpybit.py +++ b/src/bitmessagekivy/mpybit.py @@ -1,10 +1,12 @@ """Coding: utf-8.""" +import os import time from functools import partial from bmconfigparser import BMConfigParser from helper_sql import sqlExecute, sqlQuery from kivy.app import App from kivy.clock import Clock +from kivy.core.clipboard import Clipboard from kivy.core.window import Window from kivy.lang import Builder from kivy.metrics import dp @@ -18,7 +20,6 @@ from kivy.uix.behaviors import FocusBehavior from kivy.uix.boxlayout import BoxLayout from kivy.uix.button import Button from kivy.uix.carousel import Carousel -from kivy.uix.floatlayout import FloatLayout from kivy.uix.image import Image from kivy.uix.label import Label from kivy.uix.popup import Popup @@ -51,13 +52,11 @@ import queues from semaphores import kivyuisignaler import state from uikivysignaler import UIkivySignaler +# pylint: disable=unused-argument, too-few-public-methods + if platform == 'linux': import identiconGeneration - -import os -from kivy.core.clipboard import Clipboard -# pylint: disable=unused-argument, too-few-public-methods def toast(text): @@ -1168,7 +1167,8 @@ class NavigateApp(App): # pylint: disable=too-many-public-methods [['account-plus', lambda x: self.addingtoaddressbook()]] self.root.ids.toolbar.left_action_items = \ [['menu', lambda x: self.root.toggle_nav_drawer()]] - self.root.ids.scr_mngr.current = 'inbox' if state.in_composer else 'allmails' if state.is_allmail else state.detailPageType + self.root.ids.scr_mngr.current = 'inbox' \ + if state.in_composer else 'allmails' if state.is_allmail else state.detailPageType self.root.ids.scr_mngr.transition.direction = 'right' self.root.ids.scr_mngr.transition.bind(on_complete=self.reset) if state.is_allmail or state.detailPageType == 'draft': diff --git a/src/images/default_identicon/BM-2cXQpSjUCAf8fvAQCvsrLDVkLnDAkSjRGN.png b/src/images/default_identicon/BM-2cXQpSjUCAf8fvAQCvsrLDVkLnDAkSjRGN.png new file mode 100644 index 0000000000000000000000000000000000000000..22def0cd17aa71234a0ab0ad8237d8795055e7e1 GIT binary patch literal 461 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7xzrV4ULV;uumf=k1-1yiATf3Z%_+g}Yo_3`3Vh(#~4LV0gIt_b?d2K{=@9ASpvIdCKIWUk%% zP43a<{r?Wk{I$^JBpV@*Ky^y*7BuFk|yI+#2Mtc{jm*(GOW^ fqJoW6;T`WBd$}JI#g{z=MiYaltDnm{r-UW|*9?{7 literal 0 HcmV?d00001 From 3686acf4d206f0dfc3e51b1aef2353fbefe80108 Mon Sep 17 00:00:00 2001 From: lakshyacis Date: Thu, 12 Sep 2019 15:13:11 +0530 Subject: [PATCH 2/2] mpybit pylint fixes --- src/bitmessagekivy/mpybit.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/bitmessagekivy/mpybit.py b/src/bitmessagekivy/mpybit.py index 0a6eb023..d5bda558 100644 --- a/src/bitmessagekivy/mpybit.py +++ b/src/bitmessagekivy/mpybit.py @@ -1,4 +1,5 @@ """Coding: utf-8.""" +# pylint: disable=relative-import, too-many-lines import os import time from functools import partial @@ -62,7 +63,7 @@ if platform == 'linux': def toast(text): """Method will display the toast message.""" if platform == 'linux': - from kivymd.toast.kivytoast import toast + from kivymd.toast.kivytoast import toast # pylint: disable=redefined-outer-name toast(text) return @@ -552,7 +553,8 @@ class DropDownWidget(BoxLayout): events_callback=self.callback_for_menu_items) msg_dialog.open() - def callback_for_menu_items(self, text_item): + @staticmethod + def callback_for_menu_items(text_item): """Method is used for getting the callback of alert box""" toast(text_item) @@ -1259,6 +1261,7 @@ class NavigateApp(App): # pylint: disable=too-many-public-methods self.root.ids.scr_mngr.current = state.search_screen def clearSreeen(self, text): + """Method is used for clear screen""" if text == 'Sent': self.root.ids.sc4.clear_widgets() self.root.ids.sc4.add_widget(Sent()) @@ -1291,7 +1294,7 @@ class NavigateApp(App): # pylint: disable=too-many-public-methods return def add_search_bar(self): - """Method used for adding search function on screen.""" + """Method used for adding search function on screen""" if not self.root.ids.search_bar.children: self.root.ids.search_bar.add_widget(MDIconButton(icon='magnify')) text_field = MDTextField( @@ -1313,6 +1316,7 @@ class NavigateApp(App): # pylint: disable=too-many-public-methods return './images/drawer_logo1.png' def set_mail_detail_header(self): + """Method is used for setting the details of the page""" toolbar_obj = self.root.ids.toolbar toolbar_obj.left_action_items = [['arrow-left', lambda x: self.back_press()]] delete_btn = ['delete-forever', lambda x: self.root.ids.sc14.delete_mail()]