def add_notification (self, noti) : notifications = GTW.Notification_Collection (self.session) if notifications is not None : if not isinstance (noti, GTW.Notification) : noti = GTW.Notification (noti) notifications.append (noti) self.notifications_added += 1
def indicate_notifications (self) : added = self.notifications_added if added : notifications = GTW.Notification_Collection (self.session) if len (notifications) : ### `notifications` got disgorged ### -> this response contains embedded notifications ### -> clear the Etag and the last_modified to prevent caching self.set_etag ("") self.last_modified = datetime.datetime.utcfromtimestamp (0)