コード例 #1
0
ファイル: ui.py プロジェクト: akang6/Medusa
    def error(self, title, message=''):
        """
        Add an error notification to the queue

        title: The title of the notification
        message: The message portion of the notification
        """
        new_notification = Notification(title, message, ERROR)
        push_to_web_socket(json.dumps({'event': 'notification',
                                       'data': {'title': new_notification.title,
                                                'body': new_notification.message,
                                                'type': new_notification.notification_type,
                                                'hash': hash(new_notification)}}))
コード例 #2
0
ファイル: ui.py プロジェクト: akang6/Medusa
    def message(self, title, message=''):
        """
        Add a regular notification to the queue

        title: The title of the notification
        message: The message portion of the notification
        """
        # self._messages.append(Notification(title, message, MESSAGE))
        new_notification = Notification(title, message, MESSAGE)

        push_to_web_socket(json.dumps({'event': 'notification',
                                       'data': {'title': new_notification.title,
                                                'body': new_notification.message,
                                                'type': new_notification.notification_type,
                                                'hash': hash(new_notification)}}))