Fix pylint global variable warning issue
This commit is contained in:
parent
f004021c6d
commit
f4d25ab0ed
|
@ -2,6 +2,7 @@ import kivy_helper_search
|
||||||
import os
|
import os
|
||||||
import queues
|
import queues
|
||||||
import shutdown
|
import shutdown
|
||||||
|
import state
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from kivy.app import App
|
from kivy.app import App
|
||||||
|
@ -20,8 +21,6 @@ from addresses import decodeAddress, addBMIfNotPresent
|
||||||
from helper_sql import sqlExecute
|
from helper_sql import sqlExecute
|
||||||
|
|
||||||
statusIconColor = 'red'
|
statusIconColor = 'red'
|
||||||
global belonging
|
|
||||||
belonging = ''
|
|
||||||
|
|
||||||
|
|
||||||
class NavigateApp(App, TextInput):
|
class NavigateApp(App, TextInput):
|
||||||
|
@ -44,8 +43,7 @@ class NavigateApp(App, TextInput):
|
||||||
|
|
||||||
def getCurrentAccountData(self, text):
|
def getCurrentAccountData(self, text):
|
||||||
"""Get Current Address Account Data."""
|
"""Get Current Address Account Data."""
|
||||||
global belonging
|
state.association = text
|
||||||
belonging = text
|
|
||||||
main_widget.ids.sc1.clear_widgets()
|
main_widget.ids.sc1.clear_widgets()
|
||||||
main_widget.ids.sc2.clear_widgets()
|
main_widget.ids.sc2.clear_widgets()
|
||||||
main_widget.ids.sc3.clear_widgets()
|
main_widget.ids.sc3.clear_widgets()
|
||||||
|
@ -53,7 +51,7 @@ class NavigateApp(App, TextInput):
|
||||||
main_widget.ids.sc2.add_widget(Sent())
|
main_widget.ids.sc2.add_widget(Sent())
|
||||||
main_widget.ids.sc3.add_widget(Trash())
|
main_widget.ids.sc3.add_widget(Trash())
|
||||||
main_widget.ids.toolbar.title = BMConfigParser().get(
|
main_widget.ids.toolbar.title = BMConfigParser().get(
|
||||||
belonging, 'label') + '({})'.format(belonging)
|
state.association, 'label') + '({})'.format(state.association)
|
||||||
Inbox()
|
Inbox()
|
||||||
Sent()
|
Sent()
|
||||||
Trash()
|
Trash()
|
||||||
|
@ -132,7 +130,7 @@ class NavigateApp(App, TextInput):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def getCurrentAccount():
|
def getCurrentAccount():
|
||||||
"""It uses to get current account label."""
|
"""It uses to get current account label."""
|
||||||
return BMConfigParser().get(belonging, 'label') + '({})'.format(belonging)
|
return BMConfigParser().get(state.association, 'label') + '({})'.format(state.association)
|
||||||
|
|
||||||
|
|
||||||
class Navigator(NavigationDrawer):
|
class Navigator(NavigationDrawer):
|
||||||
|
@ -155,9 +153,8 @@ class Inbox(Screen):
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(Inbox, self).__init__(*args, **kwargs)
|
super(Inbox, self).__init__(*args, **kwargs)
|
||||||
global belonging
|
if state.association == '':
|
||||||
if belonging == '':
|
state.association = Navigator().ids.btn.text
|
||||||
belonging = Navigator().ids.btn.text
|
|
||||||
Clock.schedule_once(self.init_ui, 0)
|
Clock.schedule_once(self.init_ui, 0)
|
||||||
|
|
||||||
def init_ui(self, dt=0):
|
def init_ui(self, dt=0):
|
||||||
|
@ -167,7 +164,7 @@ class Inbox(Screen):
|
||||||
|
|
||||||
def inboxaccounts(self):
|
def inboxaccounts(self):
|
||||||
"""Load inbox accounts."""
|
"""Load inbox accounts."""
|
||||||
account = belonging
|
account = state.association
|
||||||
folder = 'inbox'
|
folder = 'inbox'
|
||||||
self.loadMessagelist(account, folder, 'All', '')
|
self.loadMessagelist(account, folder, 'All', '')
|
||||||
|
|
||||||
|
@ -208,9 +205,8 @@ class Sent(Screen):
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(Sent, self).__init__(*args, **kwargs)
|
super(Sent, self).__init__(*args, **kwargs)
|
||||||
global belonging
|
if state.association == '':
|
||||||
if belonging == '':
|
state.association = Navigator().ids.btn.text
|
||||||
belonging = Navigator().ids.btn.text
|
|
||||||
Clock.schedule_once(self.init_ui, 0)
|
Clock.schedule_once(self.init_ui, 0)
|
||||||
|
|
||||||
def init_ui(self, dt=0):
|
def init_ui(self, dt=0):
|
||||||
|
@ -220,7 +216,7 @@ class Sent(Screen):
|
||||||
|
|
||||||
def sentaccounts(self):
|
def sentaccounts(self):
|
||||||
"""Load sent accounts."""
|
"""Load sent accounts."""
|
||||||
account = belonging
|
account = state.association
|
||||||
self.loadSent(account, 'All', '')
|
self.loadSent(account, 'All', '')
|
||||||
|
|
||||||
def loadSent(self, account, where="", what=""):
|
def loadSent(self, account, where="", what=""):
|
||||||
|
@ -252,9 +248,8 @@ class Trash(Screen):
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(Trash, self).__init__(*args, **kwargs)
|
super(Trash, self).__init__(*args, **kwargs)
|
||||||
global belonging
|
if state.association == '':
|
||||||
if belonging == '':
|
state.association = Navigator().ids.btn.text
|
||||||
belonging = Navigator().ids.btn.text
|
|
||||||
Clock.schedule_once(self.init_ui, 0)
|
Clock.schedule_once(self.init_ui, 0)
|
||||||
|
|
||||||
def init_ui(self, dt=0):
|
def init_ui(self, dt=0):
|
||||||
|
@ -264,7 +259,7 @@ class Trash(Screen):
|
||||||
|
|
||||||
def inboxaccounts(self):
|
def inboxaccounts(self):
|
||||||
"""Load inbox accounts."""
|
"""Load inbox accounts."""
|
||||||
account = belonging
|
account = state.association
|
||||||
folder = 'trash'
|
folder = 'trash'
|
||||||
self.loadTrashlist(account, folder, 'All', '')
|
self.loadTrashlist(account, folder, 'All', '')
|
||||||
|
|
||||||
|
|
|
@ -70,3 +70,5 @@ dandelion = 0
|
||||||
testmode = False
|
testmode = False
|
||||||
|
|
||||||
kivy = False
|
kivy = False
|
||||||
|
|
||||||
|
association = ''
|
||||||
|
|
Loading…
Reference in New Issue
Block a user