def apply_basic_settings(self): self.check_interval = utils.get_int_setting('check_interval') user = utils.get_setting('username') password = utils.get_setting('password') host = utils.get_setting('host') port = utils.get_int_setting('port') if not host: utils.log_normal("No host specified") return False invalid = utils.invalid_user_char(user) if invalid: utils.log_error("Invalid character in user name: " + invalid) return False invalid = utils.invalid_password_char(password) if invalid: utils.log_error("Invalid character in password: " + invalid) return False self.camera = foscam.Camera(host, port, user, password) success, msg = self.camera.test() if not success: utils.log_error(msg) return False return True
from resources.lib import foscam from resources.lib import utils from resources.lib import gui user = utils.get_setting('username') password = utils.get_setting('password') host = utils.get_setting('host') port = utils.get_int_setting('port') if not host: utils.error_dialog(utils.get_string(32101)) sys.exit(1) if utils.invalid_user_char(user, show_dialog=True): sys.exit(1) if utils.invalid_password_char(password, show_dialog=True): sys.exit(1) camera = foscam.Camera(host, port, user, password) success, msg = camera.test() if not success: utils.error_dialog(msg) sys.exit(1) class MoveButton(gui.Button): def __init__(self, parent, direction, x, y): self.cmd = partial(camera.move, direction)
import xbmcgui from resources.lib import foscam from resources.lib import utils from resources.lib import gui user = utils.get_setting('username') password = utils.get_setting('password') host = utils.get_setting('host') port = utils.get_int_setting('port') if not host: utils.error_dialog(utils.get_string(32101)) sys.exit(1) if utils.invalid_user_char(user, show_dialog=True): sys.exit(1) if utils.invalid_password_char(password, show_dialog=True): sys.exit(1) camera = foscam.Camera(host, port, user, password) success, msg = camera.test() if not success: utils.error_dialog(msg) sys.exit(1) class MoveButton(gui.Button): def __init__(self, parent, direction, x, y): self.cmd = partial(camera.move, direction)