def header(self): items = [['message', Config.get_tmp('log_message')], ['error', Config.get_tmp('log_error')], ['disconnect', Config.get_tmp('log_socket_error')]] msg = [item[0] for item in items if item[1]] if len(msg) == 0: msg = ['off'] return "\t____%s____\n%s\nLogging: %s" % (self.__title, self.__url, ', '.join(msg))
def proceed_socket_error(): now = time.time() if (now - Log.last_socket_error) > Log.INTERVAL: Log.last_socket_error = now Log.do_proceed_socket_error = Config.get_tmp('log_socket_error') return Log.do_proceed_socket_error
def proceed_message(): now = time.time() if (now - Log.last_message) > Log.INTERVAL: Log.last_message = now Log.do_proceed_message = Config.get_tmp('log_message') return Log.do_proceed_message
def proceed_socket_error(): now = time.time() if (now - Log.last_socket_error) > Log.INTERVAL: Log.last_socket_error = now Log.do_proceed_socket_error = Config.get_tmp('log_socket_error') return Log.do_proceed_socket_error
def proceed_message(): now = time.time() if (now - Log.last_message) > Log.INTERVAL: Log.last_message = now Log.do_proceed_message = Config.get_tmp('log_message') return Log.do_proceed_message
def toggle_error(arg=None): if Config.get_tmp('log_error'): Config.load_tmp(log_error=False) else: Config.load_tmp(log_error=True) Log.last_error = 0
def toggle_message(arg=None): if Config.get_tmp('log_message'): Config.load_tmp(log_message=False) else: Config.load_tmp(log_message=True) Log.last_message = 0
def toggle_disconnect(arg=None): if Config.get_tmp('log_socket_error'): Config.load_tmp(log_socket_error=False) else: Config.load_tmp(log_socket_error=True) Log.last_socket_error = 0