Fixed sql query

This commit is contained in:
shekhar-cis 2022-05-30 17:11:20 +05:30
parent df712511da
commit 2e5fcf5fc6
Signed by untrusted user: shekhar-cis
GPG Key ID: F4F00AB04E83F9A7
5 changed files with 32 additions and 15 deletions

View File

View File

@ -178,9 +178,7 @@ class AddressBook(Screen, HelperAddressBook):
if label in stored_labels and self.address == add_dict[label]: if label in stored_labels and self.address == add_dict[label]:
stored_labels.remove(label) stored_labels.remove(label)
if label and label not in stored_labels: if label and label not in stored_labels:
sqlExecute( sqlExecute("UPDATE addressbook SET label = ? WHERE address = ?", label, self.addbook_popup.content_cls.address)
"UPDATE addressbook SET label = ? WHERE"
"address = ?", label, self.addbook_popup.content_cls.address)
state.kivyapp.root.ids.sc11.ids.ml.clear_widgets() state.kivyapp.root.ids.sc11.ids.ml.clear_widgets()
state.kivyapp.root.ids.sc11.loadAddresslist(None, 'All', '') state.kivyapp.root.ids.sc11.loadAddresslist(None, 'All', '')
self.addbook_popup.dismiss() self.addbook_popup.dismiss()

View File

@ -2,6 +2,7 @@ from datetime import datetime
from kivy.core.window import Window from kivy.core.window import Window
from kivy.lang import Builder from kivy.lang import Builder
from kivy.metrics import dp from kivy.metrics import dp
from kivy.app import App
from kivymd.uix.list import ( from kivymd.uix.list import (
ILeftBody, ILeftBody,
IRightBodyTouch, IRightBodyTouch,
@ -82,13 +83,29 @@ def showLimitedCnt(total_msg):
def avatarImageFirstLetter(letter_string): def avatarImageFirstLetter(letter_string):
"""This function is used to the first letter for the avatar image""" """This function is used to the first letter for the avatar image"""
# try:
# if isinstance(letter_string, int):
# letter_string = str(letter_string)
# letter_string = letter_string.title()[0]
# if image_exists:
# return letter
# raise IndexError
# except IndexError:
# return '!'
# import pdb; pdb.set_trace()
try: try:
if isinstance(letter_string, int): image_letter = letter_string.title()[0]
return letter_string[0] if image_letter.isalnum():
elif isinstance(letter_string, str) and letter_string[0].isalnum(): return image_letter
return letter_string.title()[0] return '!'
else:
return '!' # if isinstance(letter_string, int):
# return letter_string[0]
# elif isinstance(letter_string, str) and letter_string[0].isalnum():
# return letter_string.title()[0]
# else:
# return '!'
except IndexError: except IndexError:
return '!' return '!'
@ -146,10 +163,13 @@ class CutsomSwipeToDeleteItem(MDCardSwipe):
def empty_screen_label(label_str=None, no_search_res_found=None): def empty_screen_label(label_str=None, no_search_res_found=None):
"""Returns default text on screen when no address is there.""" """Returns default text on screen when no address is there."""
kivy_running_app = App.get_running_app()
kivy_state = kivy_running_app.kivy_state_obj
# import pdb; pdb.set_trace()
content = MDLabel( content = MDLabel(
font_style='Caption', font_style='Caption',
theme_text_color='Primary', theme_text_color='Primary',
text=no_search_res_found if state.searcing_text else label_str, text=no_search_res_found if kivy_state.searcing_text else label_str,
halign='center', halign='center',
size_hint_y=None, size_hint_y=None,
valign='top') valign='top')

View File

@ -1,10 +1,10 @@
''' '''
This is for pamyent related part This is for payment related part
''' '''
from kivy.uix.boxlayout import BoxLayout from kivy.uix.boxlayout import BoxLayout
from kivymd.uix.behaviors.elevation import RectangularElevationBehavior
from kivy.uix.screenmanager import Screen from kivy.uix.screenmanager import Screen
from kivymd.uix.behaviors.elevation import RectangularElevationBehavior
from kivymd.uix.label import MDLabel from kivymd.uix.label import MDLabel
from kivymd.uix.list import ( from kivymd.uix.list import (
IRightBodyTouch, IRightBodyTouch,

View File

@ -1,9 +1,8 @@
import state
from bitmessagekivy.baseclass.common import toast
from kivy.uix.screenmanager import Screen from kivy.uix.screenmanager import Screen
from kivy.properties import StringProperty from kivy.properties import StringProperty
from kivy_garden.qrcode import QRCodeWidget from kivy_garden.qrcode import QRCodeWidget
from bitmessagekivy.baseclass.common import toast
import state
class ShowQRCode(Screen): class ShowQRCode(Screen):
"""ShowQRCode Screen class for kivy Ui""" """ShowQRCode Screen class for kivy Ui"""