Pylint Fixes

This commit is contained in:
lakshyacis 2019-08-20 18:41:18 +05:30
parent 41001d02dc
commit 37e0257396
No known key found for this signature in database
GPG Key ID: D2C539C8EC63E9EB

View File

@ -72,6 +72,7 @@ def toast(text):
class Navigatorss(MDNavigationDrawer): class Navigatorss(MDNavigationDrawer):
"""Navigators class contains image, title and logo.""" """Navigators class contains image, title and logo."""
# pylint: disable=too-few-public-methods # pylint: disable=too-few-public-methods
image_source = StringProperty('images/qidenticon_two.png') image_source = StringProperty('images/qidenticon_two.png')
title = StringProperty('Navigation') title = StringProperty('Navigation')
@ -178,7 +179,6 @@ class Inbox(Screen):
src_mng_obj = self.manager src_mng_obj = self.manager
else: else:
src_mng_obj = self.parent.parent src_mng_obj = self.parent.parent
src_mng_obj.screens[13].clear_widgets() src_mng_obj.screens[13].clear_widgets()
src_mng_obj.screens[13].add_widget(MailDetail()) src_mng_obj.screens[13].add_widget(MailDetail())
src_mng_obj.current = 'mailDetail' src_mng_obj.current = 'mailDetail'
@ -195,16 +195,20 @@ class Inbox(Screen):
int(state.inbox_count) - 1) int(state.inbox_count) - 1)
msg_count_objs.trash_cnt.badge_text = str( msg_count_objs.trash_cnt.badge_text = str(
int(state.trash_count) + 1) int(state.trash_count) + 1)
state.inbox_count = str(int(state.inbox_count) - 1) state.inbox_count = str(
state.trash_count = str(int(state.trash_count) + 1) int(state.inbox_count) - 1)
self.ids.ml.remove_widget(instance.parent.parent) state.trash_count = str(
int(state.trash_count) + 1)
self.ids.ml.remove_widget(
instance.parent.parent)
toast('Deleted') toast('Deleted')
self.update_trash() self.update_trash()
def archive(self, data_index, instance, *args): def archive(self, data_index, instance, *args):
"""Archive inbox mail from inbox listing.""" """Archive inbox mail from inbox listing."""
sqlExecute("UPDATE inbox SET folder = 'trash' WHERE \ sqlExecute(
received = {};".format(data_index)) "UPDATE inbox SET folder = 'trash' WHERE received = {};".format(
data_index))
self.ids.ml.remove_widget(instance.parent.parent) self.ids.ml.remove_widget(instance.parent.parent)
self.update_trash() self.update_trash()
@ -218,7 +222,7 @@ class Inbox(Screen):
self.parent.parent.screens[4].add_widget(Trash()) self.parent.parent.screens[4].add_widget(Trash())
def refresh_callback(self, *args): def refresh_callback(self, *args):
"""Method updates the state of application, \ """Method updates the state of application,\
While the spinner remains on the screen.""" While the spinner remains on the screen."""
def refresh_callback(interval): def refresh_callback(interval):
"""Method used for loading the inbox screen data.""" """Method used for loading the inbox screen data."""
@ -247,9 +251,8 @@ class MyAddress(Screen):
"""Clock Schdule for method inbox accounts.""" """Clock Schdule for method inbox accounts."""
addresses_list = state.kivyapp.variable_1 addresses_list = state.kivyapp.variable_1
if state.searcing_text: if state.searcing_text:
filtered_list = filter( filtered_list = filter(lambda addr: self.filter_address(
lambda addr: self.filter_address( addr), BMConfigParser().addresses())
addr), BMConfigParser().addresses())
addresses_list = filtered_list addresses_list = filtered_list
if addresses_list: if addresses_list:
data = [] data = []
@ -310,16 +313,14 @@ class MyAddress(Screen):
screens_obj.add_widget(MyAddress()) screens_obj.add_widget(MyAddress())
self.ids.refresh_layout.refresh_done() self.ids.refresh_layout.refresh_done()
self.tick = 0 self.tick = 0
Clock.schedule_once(refresh_callback, 1) Clock.schedule_once(refresh_callback, 1)
@staticmethod @staticmethod
def filter_address(address): def filter_address(address):
"""Method will filter the my address list data.""" """Method will filter the my address list data."""
if filter(lambda x: ( if filter(lambda x: (state.searcing_text).lower() in x, [
state.searcing_text).lower() in x, [ BMConfigParser().get(
BMConfigParser().get( address, 'label').lower(), address.lower()]):
address, 'label').lower(), address.lower()]):
return True return True
return False return False
@ -411,6 +412,7 @@ class AddressBook(Screen):
class SelectableRecycleBoxLayout(FocusBehavior, LayoutSelectionBehavior, class SelectableRecycleBoxLayout(FocusBehavior, LayoutSelectionBehavior,
RecycleBoxLayout): RecycleBoxLayout):
"""Adds selection and focus behaviour to the view.""" """Adds selection and focus behaviour to the view."""
# pylint: disable=too-few-public-methods # pylint: disable=too-few-public-methods
pass pass
@ -428,6 +430,7 @@ class SelectableLabel(RecycleDataViewBehavior, Label):
return super(SelectableLabel, self).refresh_view_attrs( return super(SelectableLabel, self).refresh_view_attrs(
rv, index, data) rv, index, data)
# pylint: disable=inconsistent-return-statements
def on_touch_down(self, touch): def on_touch_down(self, touch):
"""Add selection on touch down.""" """Add selection on touch down."""
if super(SelectableLabel, self).on_touch_down(touch): if super(SelectableLabel, self).on_touch_down(touch):
@ -446,6 +449,7 @@ class SelectableLabel(RecycleDataViewBehavior, Label):
class RV(RecycleView): class RV(RecycleView):
"""Recycling View.""" """Recycling View."""
# pylint: disable=too-few-public-methods # pylint: disable=too-few-public-methods
def __init__(self, **kwargs): def __init__(self, **kwargs):
@ -459,6 +463,7 @@ class DropDownWidget(BoxLayout):
txt_input = ObjectProperty() txt_input = ObjectProperty()
rv = ObjectProperty() rv = ObjectProperty()
# pylint: disable=inconsistent-return-statements
def send(self): def send(self):
"""Send message from one address to another.""" """Send message from one address to another."""
# pylint: disable=too-many-locals # pylint: disable=too-many-locals
@ -607,18 +612,21 @@ class MyTextInput(TextInput):
class Payment(Screen): class Payment(Screen):
"""Payment Method.""" """Payment Method."""
# pylint: disable=too-few-public-methods # pylint: disable=too-few-public-methods
pass pass
class Login(Screen): class Login(Screen):
"""Login Screeen.""" """Login Screeen."""
# pylint: disable=too-few-public-methods # pylint: disable=too-few-public-methods
pass pass
class NetworkStat(Screen): class NetworkStat(Screen):
"""Method used to show network stat.""" """Method used to show network stat."""
# pylint: disable=too-few-public-methods # pylint: disable=too-few-public-methods
text_variable_1 = StringProperty( text_variable_1 = StringProperty(
'{0}::{1}'.format('Total Connections', '0')) '{0}::{1}'.format('Total Connections', '0'))
@ -654,12 +662,14 @@ class NetworkStat(Screen):
class ContentNavigationDrawer(Navigatorss): class ContentNavigationDrawer(Navigatorss):
"""Navigate Content Drawer.""" """Navigate Content Drawer."""
# pylint: disable=too-few-public-methods # pylint: disable=too-few-public-methods
pass pass
class Random(Screen): class Random(Screen):
"""Generates Random Address.""" """Generates Random Address."""
# pylint: disable=too-few-public-methods # pylint: disable=too-few-public-methods
is_active = BooleanProperty(False) is_active = BooleanProperty(False)
checked = StringProperty("") checked = StringProperty("")
@ -689,6 +699,7 @@ class Random(Screen):
class AddressSuccessful(Screen): class AddressSuccessful(Screen):
"""Getting Address Detail.""" """Getting Address Detail."""
# pylint: disable=too-few-public-methods # pylint: disable=too-few-public-methods
pass pass
@ -848,6 +859,7 @@ class Sent(Screen):
class Trash(Screen): class Trash(Screen):
"""Trash Screen uses screen to show widgets of screens.""" """Trash Screen uses screen to show widgets of screens."""
# pylint: disable=too-few-public-methods # pylint: disable=too-few-public-methods
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
@ -887,12 +899,14 @@ class Trash(Screen):
class Page(Screen): class Page(Screen):
"""Page Screen show widgets of page.""" """Page Screen show widgets of page."""
# pylint: disable=too-few-public-methods # pylint: disable=too-few-public-methods
pass pass
class Create(Screen): class Create(Screen):
"""Creates the screen widgets.""" """Creates the screen widgets."""
# pylint: disable=too-few-public-methods # pylint: disable=too-few-public-methods
def __init__(self, **kwargs): def __init__(self, **kwargs):
@ -908,6 +922,7 @@ class Create(Screen):
class Setting(Screen): class Setting(Screen):
"""Setting the Screen components.""" """Setting the Screen components."""
# pylint: disable=too-few-public-methods # pylint: disable=too-few-public-methods
pass pass
@ -959,20 +974,19 @@ class NavigateApp(App):
kivyuisignaler.release() kivyuisignaler.release()
super(NavigateApp, self).run() super(NavigateApp, self).run()
# pylint: disable=inconsistent-return-statements
@staticmethod @staticmethod
def showmeaddresses(name="text"): def showmeaddresses(name="text"):
"""Show the addresses in spinner to make as dropdown.""" """Show the addresses in spinner to make as dropdown."""
if name == "text": if name == "text":
if BMConfigParser().addresses(): if BMConfigParser().addresses():
return BMConfigParser().addresses()[0][:16] + '..' return BMConfigParser().addresses()[0][:16] + '..'
else: return "textdemo"
return "textdemo"
elif name == "values": elif name == "values":
if BMConfigParser().addresses(): if BMConfigParser().addresses():
return [address[:16] + '..' return [address[:16] + '..'
for address in BMConfigParser().addresses()] for address in BMConfigParser().addresses()]
else: return "valuesdemo"
return "valuesdemo"
def getCurrentAccountData(self, text): def getCurrentAccountData(self, text):
"""Get Current Address Account Data.""" """Get Current Address Account Data."""
@ -1020,8 +1034,7 @@ class NavigateApp(App):
"""It uses to get current account label.""" """It uses to get current account label."""
if state.association: if state.association:
return state.association return state.association
else: return "Bitmessage Login"
return "Bitmessage Login"
@staticmethod @staticmethod
def addingtoaddressbook(): def addingtoaddressbook():
@ -1259,18 +1272,21 @@ class GrashofPopup(Popup):
class AvatarSampleWidget(ILeftBody, Image): class AvatarSampleWidget(ILeftBody, Image):
"""Avatar Sample Widget.""" """Avatar Sample Widget."""
# pylint: disable=too-few-public-methods # pylint: disable=too-few-public-methods
pass pass
class IconLeftSampleWidget(ILeftBodyTouch, MDIconButton): class IconLeftSampleWidget(ILeftBodyTouch, MDIconButton):
"""Left icon sample widget.""" """Left icon sample widget."""
# pylint: disable=too-few-public-methods # pylint: disable=too-few-public-methods
pass pass
class IconRightSampleWidget(IRightBodyTouch, MDCheckbox): class IconRightSampleWidget(IRightBodyTouch, MDCheckbox):
"""Right icon sample widget.""" """Right icon sample widget."""
# pylint: disable=too-few-public-methods # pylint: disable=too-few-public-methods
pass pass
@ -1478,6 +1494,7 @@ class AddbookDetailPopup(Popup):
class ShowQRCode(Screen): class ShowQRCode(Screen):
"""ShowQRCode Screen uses to show the detail of mails.""" """ShowQRCode Screen uses to show the detail of mails."""
# pylint: disable=too-few-public-methods # pylint: disable=too-few-public-methods
def qrdisplay(self): def qrdisplay(self):
@ -1647,6 +1664,7 @@ class Draft(Screen):
class CustomSpinner(Spinner): class CustomSpinner(Spinner):
"""This class is used for setting spinner size.""" """This class is used for setting spinner size."""
# pylint: disable=too-few-public-methods # pylint: disable=too-few-public-methods
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):