Exemple #1
0
 def _show_notification(self, text, blink_text = None, notification_time = None):
     self._message = strip_formatted_string(text)
     self._duration = notification_time if notification_time is not None else self._default_notification_time
     self._create_notification_timeout_task(self._duration)
     if not self._visible:
         self._visible = True
         self._shown_at = time.clock()
         self.notify_visible()
         self.notify_message()
     self._current_notification = Notification(self)
     self._current_notification.reschedule_after_slow_operation = self._reschedule_after_slow_operation
     return ref(self._current_notification)
 def show_notification(self, text, blink_text=None, notification_time=None):
     self._create_tasks(notification_time)
     text = apply_formatting(text)
     text = self._align_text_fn(text)
     blink_text = self._align_text_fn(blink_text)
     if blink_text is not None:
         self._original_text = text
         self._blink_text = blink_text
         self._blink_text_task.restart()
     self._message_box.text = text
     self._message_box.set_enabled(True)
     self._notification_timeout_task.restart()
     self._current_notification = Notification(self)
     return ref(self._current_notification)
Exemple #3
0
 def _show_notification(self, text, blink_text=None, notification_time=None):
     text = strip_restriction_markup_and_format(text)
     self._message = strip_formatted_string(text)
     if notification_time is None:
         notification_time = self._default_notification_time
     if self._notification_timer:
         self._notification_timer.stop()
     if notification_time != -1:
         self._notification_timer = Live.Base.Timer(callback=self.hide_notification, interval=int(1000 * notification_time), repeat=False)
         self._notification_timer.start()
     if not self._visible:
         self._visible = True
         self.notify_visible()
     self.notify_message()
     self._current_notification = Notification(self)
     return ref(self._current_notification)
Exemple #4
0
 def show_notification(self, text, blink_text=None, notification_time=None):
     """
     Triggers a notification with the given text.
     """
     self._create_tasks(notification_time)
     text = self._align_text_fn(text)
     blink_text = self._align_text_fn(blink_text)
     if blink_text is not None:
         self._original_text = text
         self._blink_text = blink_text
         self._blink_text_task.restart()
     self._message_box.text = text
     self._message_box.set_enabled(True)
     self._notification_timeout_task.restart()
     self._current_notification = Notification(self)
     return ref(self._current_notification)
Exemple #5
0
 def show_notification(self, text, blink_text=None, notification_time=None):
     u"""
     Triggers a notification with the given text.
     If text is a tuple, it will treat it as a format string + arguments.
     """
     self._create_tasks(notification_time)
     text = apply_formatting(text)
     text = self._align_text_fn(text)
     blink_text = self._align_text_fn(blink_text)
     if blink_text is not None:
         self._original_text = text
         self._blink_text = blink_text
         self._blink_text_task.restart()
     self._message_box.text = text
     self._message_box.set_enabled(True)
     self._notification_timeout_task.restart()
     self._current_notification = Notification(self)
     return ref(self._current_notification)