Coverage for resources/lib/Settings.py : 97%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# -*- coding: utf-8 -*- # Module: Utils # Author: asciidisco # Created on: 24.07.2017 # License: MIT https://goo.gl/WA1kby
except ImportError: USE_PYDES = False else:
"""Settings interface for Kodi, includes en-/decryption of credentials"""
""" Injects instances, sets encryption var & addon_id
:param utils: Utils instance :type utils: resources.lib.Utils :param dialogs: Dialogs instance :type dialogs: resources.lib.Dialogs :param constants: Constants instance :type constants: resources.lib.Constants """
""" Returns a unique id based on the devices MAC address
:param delay: Retry delay in sec :type delay: int :returns: string -- Unique secret """ else:
""" Encodes data
:param data: Data to be encoded :type data: str :returns: string -- Encoded data """ self.uniq_id(delay=2), pyDes.CBC, "\0\0\0\0\0\0\0\0", padmode=pyDes.PAD_PKCS5) data=data)
""" Decodes data
:param data: Data to be decoded :type data: str :returns: string -- Decoded data """ self.uniq_id(delay=2), pyDes.CBC, "\0\0\0\0\0\0\0\0", padmode=pyDes.PAD_PKCS5) data=base64.b64decode(s=data))
""" checks if credentials are set
:returns: bool -- Credentials set """
""" Opens up the email & password dialogs and stores entered credentials
:returns: tuple -- Credential pai """ else:
""" Returns credentials in clear text
:returns: tuple -- Clear text credentials """
""" Returns the users mac address
:param delay: retry delay in sec :type delay: int :returns: string -- Devices MAC address """ # hack response busy |