~ubuntu-branches/ubuntu/oneiric/alarm-clock/oneiric

« back to all changes in this revision

Viewing changes to alarm-clock/SnoozeThread.py

  • Committer: Bazaar Package Importer
  • Author(s): Marco Rodrigues
  • Date: 2008-11-11 12:38:15 UTC
  • mto: (7.1.2 sid) (9.1.1 squeeze) (1.2.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20081111123815-uw5x62teqst2npi3
Tags: upstream-0.9.18
ImportĀ upstreamĀ versionĀ 0.9.18

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
import time
4
4
import gtk
5
5
 
 
6
 
6
7
class SnoozeThread(Thread):
7
 
        def __init__(self, c, MainClass, Count = False, Remover = False, Loader = False, Prefs = False, UpdateList = None):
 
8
        def __init__(self, c, MainClass, Count = False, Remover = False, Loader = False, Prefs = False, UpdateList = None, Button = None):
8
9
                Thread.__init__(self)
9
10
                self.setDaemon(True)
10
11
                self.c = c
14
15
                self.Prefs = Prefs
15
16
                self.UpdateList = UpdateList
16
17
                self.MainClass = MainClass
17
 
 
 
18
                self.Button = Button
18
19
        def run(self):
19
20
                self.count = 0
20
 
 
21
 
                gtk.gdk.threads_enter()
22
 
                self.MainClass().StopTheSound(None)
23
 
                gtk.gdk.threads_leave()
24
 
                while True:
 
21
                while self.Button.get_property('sensitive'):
25
22
                        time.sleep(60)
26
23
                        self.count = self.count + 1
27
24
                        if self.count == self.c[39]: