Merge pull request #62 from jaicis/kivyfixes

fixed code quality
This commit is contained in:
navjotcis 2020-04-17 19:40:55 +05:30 committed by GitHub
commit c70d9c8952
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 10 deletions

View File

@ -1011,7 +1011,8 @@ class Random(Screen):
state.kivyapp.root.ids.sc10.init_ui() state.kivyapp.root.ids.sc10.init_ui()
toast('New address created') toast('New address created')
def add_validation(self, instance): @staticmethod
def add_validation(instance):
"""Checking validation at address creation time""" """Checking validation at address creation time"""
entered_label = str(instance.text.strip()) entered_label = str(instance.text.strip())
lables = [BMConfigParser().get(obj, 'label') lables = [BMConfigParser().get(obj, 'label')
@ -1995,6 +1996,7 @@ class NavigateApp(MDApp):
toast('Copied') toast('Copied')
def reset_login_screen(self): def reset_login_screen(self):
"""This method is used for clearing random screen"""
if self.root.ids.sc7.ids.add_random_bx.children: if self.root.ids.sc7.ids.add_random_bx.children:
self.root.ids.sc7.ids.add_random_bx.clear_widgets() self.root.ids.sc7.ids.add_random_bx.clear_widgets()
@ -2045,7 +2047,7 @@ class GrashofPopup(Popup):
# my_addresses = ( # my_addresses = (
# self.parent.children[1].children[0].children[0].ids.btn.values) # self.parent.children[1].children[0].children[0].ids.btn.values)
my_addresses = ( my_addresses = (
state.kivyapp.root.children[0].children[0].ids.btn.values) state.kivyapp.root.children[0].children[0].ids.btn.values)
add_book = [addr[1] for addr in kivy_helper_search.search_sql( add_book = [addr[1] for addr in kivy_helper_search.search_sql(
folder="addressbook")] folder="addressbook")]
entered_text = str(instance.text).strip() entered_text = str(instance.text).strip()

View File

@ -4,6 +4,10 @@ and suggest how it may be installed
""" """
import sys import sys
import logging
import os
import state
from importlib import import_module
# Only really old versions of Python don't have sys.hexversion. We don't # Only really old versions of Python don't have sys.hexversion. We don't
# support them. The logging module was introduced in Python 2.3 # support them. The logging module was introduced in Python 2.3
@ -14,10 +18,6 @@ if not hasattr(sys, 'hexversion') or sys.hexversion < 0x20300F0:
% sys.version % sys.version
) )
import logging
import os
from importlib import import_module
import state
# We can now use logging so set up a simple configuration # We can now use logging so set up a simple configuration
formatter = logging.Formatter('%(levelname)s: %(message)s') formatter = logging.Formatter('%(levelname)s: %(message)s')
handler = logging.StreamHandler(sys.stdout) handler = logging.StreamHandler(sys.stdout)
@ -304,7 +304,7 @@ def check_openssl():
' OpenSSL 0.9.8b or later with AES, Elliptic Curves (EC),' ' OpenSSL 0.9.8b or later with AES, Elliptic Curves (EC),'
' ECDH, and ECDSA enabled.') ' ECDH, and ECDSA enabled.')
return False return False
if sys.version_info >=(3,0,0): if sys.version_info >= (3, 0, 0):
matches = cflags_regex.findall(str(openssl_cflags)) matches = cflags_regex.findall(str(openssl_cflags))
else: else:
matches = cflags_regex.findall(openssl_cflags) matches = cflags_regex.findall(openssl_cflags)
@ -359,7 +359,8 @@ def check_curses():
# The pythondialog author does not like Python2 str, so we have to use # The pythondialog author does not like Python2 str, so we have to use
# unicode for just the version otherwise we get the repr form which # unicode for just the version otherwise we get the repr form which
# includes the module and class names along with the actual version. # includes the module and class names along with the actual version.
logger.info('dialog Utility Version %s', unicode(dialog_util_version)) # logger.info('dialog Utility Version %s', unicode(dialog_util_version))
logger.info('dialog Utility Version %s', str(dialog_util_version))
return True return True

View File

@ -172,7 +172,7 @@ class TLSDispatcher(AdvancedDispatcher):
self.handle_close() self.handle_close()
return return
def tls_handshake(self): def tls_handshake(self): # pylint:disable=too-many-branches
"""Perform TLS handshake and handle its stages""" """Perform TLS handshake and handle its stages"""
# wait for flush # wait for flush
# self.sslSocket.setblocking(0) # self.sslSocket.setblocking(0)