Logo Search packages:      
Sourcecode: alarm-clock version File versions  Download package

SnoozeThread.py

from threading import Thread

import time
import gtk


class SnoozeThread(Thread):
      def __init__(self, c, MainClass, Count = False, Remover = False, Loader = False, Prefs = False, UpdateList = None, Button = None):
            Thread.__init__(self)
            self.setDaemon(True)
            self.c = c
            self.Count = Count
            self.Remover = Remover
            self.Loader = Loader
            self.Prefs = Prefs
            self.UpdateList = UpdateList
            self.MainClass = MainClass
            self.Button = Button
      def run(self):
            self.count = 0
            while self.Button.get_property('sensitive'):
                  time.sleep(60)
                  self.count = self.count + 1
                  if self.count == self.c[39]:
                        gtk.gdk.threads_enter()
                        self.MainClass().RunAlarm(self.c, self.Count, self.Remover, self.Loader, self.Prefs, self.UpdateList)
                        gtk.gdk.threads_leave()
                        break

Generated by  Doxygen 1.6.0   Back to index