(self, terminal)
return True
Check if this terminal has gone silent
Check if this terminal has gone silent
Check if this terminal has gone silent
def check_times(self, terminal):
        """Check if this terminal has gone silent"""
        time_now = time.mktime(time.gmtime())
        if terminal not in self.last_activities:
            dbg('Terminal %s has no last activity' % terminal)
            return True

        dbg('seconds since last activity: %f (%s)' % (time_now - self.last_activities[terminal], terminal))
        if time_now - self.last_activities[terminal] >= inactive_period:
            del(self.last_activities[terminal])
            note = Notify.Notification.new(_('Terminator'), _('Silence in: %s') % 
                                         terminal.get_window_title(), 'terminator')
            note.show()

        return True
def check_times ( self , terminal ) : time_now = time . mktime ( time . gmtime ( ) ) if terminal not in self . last_activities : dbg ( 'Terminal %s has no last activity' % terminal ) return True dbg ( 'seconds since last activity: %f (%s)' % ( time_now - self . last_activities [ terminal ] , terminal ) ) if time_now - self . last_activities [ terminal ] >= inactive_period : del ( self . last_activities [ terminal ] ) note = Notify . Notification . new ( _ ( 'Terminator' ) , _ ( 'Silence in: %s' ) % terminal . get_window_title ( ) , 'terminator' ) note . show ( ) return True