fixing imports for mock

This commit is contained in:
shekhar-cis 2021-12-22 14:27:17 +05:30
parent 4b3f45ec5f
commit 871157d0aa
Signed by untrusted user: shekhar-cis
GPG Key ID: 8B2A6C8D5F7F1635
2 changed files with 13 additions and 0 deletions

View File

@ -248,17 +248,21 @@ class NavigateApp(MDApp):
def run(self): def run(self):
"""Running the widgets""" """Running the widgets"""
print('run 251 ---------------------------------')
kivyuisignaler.release() kivyuisignaler.release()
super(NavigateApp, self).run() super(NavigateApp, self).run()
@staticmethod @staticmethod
def showmeaddresses(name="text"): def showmeaddresses(name="text"):
print('showmeaddresses 257 ---------------------------------')
"""Show the addresses in spinner to make as dropdown""" """Show the addresses in spinner to make as dropdown"""
if name == "text": if name == "text":
print('if')
if BMConfigParser().addresses(): if BMConfigParser().addresses():
return BMConfigParser().addresses()[0][:16] + '..' return BMConfigParser().addresses()[0][:16] + '..'
return "textdemo" return "textdemo"
elif name == "values": elif name == "values":
print('else')
if BMConfigParser().addresses(): if BMConfigParser().addresses():
return [address[:16] + '..' return [address[:16] + '..'
for address in BMConfigParser().addresses()] for address in BMConfigParser().addresses()]
@ -266,6 +270,7 @@ class NavigateApp(MDApp):
def getCurrentAccountData(self, text): def getCurrentAccountData(self, text):
"""Get Current Address Account Data""" """Get Current Address Account Data"""
print('getCurrentAccountData 273 ---------------------------------')
if text != '': if text != '':
if os.path.exists(state.imageDir + '/default_identicon/{}.png'.format(text)): if os.path.exists(state.imageDir + '/default_identicon/{}.png'.format(text)):
self.load_selected_Image(text) self.load_selected_Image(text)
@ -296,6 +301,8 @@ class NavigateApp(MDApp):
def setCurrentAccountData(self, dt=0): def setCurrentAccountData(self, dt=0):
"""This method set the current accout data on all the screens""" """This method set the current accout data on all the screens"""
print('setCurrentAccountData 304 ---------------------------------')
self.root.ids.sc1.ids.ml.clear_widgets() self.root.ids.sc1.ids.ml.clear_widgets()
self.root.ids.sc1.loadMessagelist(state.association) self.root.ids.sc1.loadMessagelist(state.association)
@ -319,6 +326,7 @@ class NavigateApp(MDApp):
@staticmethod @staticmethod
def getCurrentAccount(): def getCurrentAccount():
print('getCurrentAccount 329 ----------------------------')
"""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
@ -367,6 +375,7 @@ class NavigateApp(MDApp):
toast(altet_txt) toast(altet_txt)
def is_camara_attached(self): def is_camara_attached(self):
print('is_camara_attached -----------------------378')
"""This method is for checking is camera available or not""" """This method is for checking is camera available or not"""
self.root.ids.sc23.check_camera() self.root.ids.sc23.check_camera()
is_available = self.root.ids.sc23.camera_avaialbe is_available = self.root.ids.sc23.camera_avaialbe
@ -414,6 +423,7 @@ class NavigateApp(MDApp):
def getDefaultAccData(self, instance): def getDefaultAccData(self, instance):
"""Getting Default Account Data""" """Getting Default Account Data"""
print('getDefaultAccData---------------------------------')
if self.variable_1: if self.variable_1:
state.association = first_addr = self.variable_1[0] state.association = first_addr = self.variable_1[0]
# if BMConfigParser().get(str(first_addr), 'enabled') == 'true': # if BMConfigParser().get(str(first_addr), 'enabled') == 'true':
@ -456,6 +466,7 @@ class NavigateApp(MDApp):
@staticmethod @staticmethod
def addressexist(): def addressexist():
print('addressexist 469 --------------------------')
"""Checking address existence""" """Checking address existence"""
if BMConfigParser().addresses(): if BMConfigParser().addresses():
return True return True

View File

@ -350,7 +350,9 @@ class Main(object):
# pylint: disable=no-member,import-error,no-name-in-module,relative-import # pylint: disable=no-member,import-error,no-name-in-module,relative-import
from bitmessagekivy.mpybit import NavigateApp from bitmessagekivy.mpybit import NavigateApp
state.kivyapp = NavigateApp() state.kivyapp = NavigateApp()
print('state.kivyapp = NavigateApp() ------------------------')
state.kivyapp.run() state.kivyapp.run()
print('state.kivyapp.run() ----------------')
else: else:
import bitmessageqt import bitmessageqt
bitmessageqt.run() bitmessageqt.run()