Created
June 21, 2013 20:57
-
-
Save Kovak/5834273 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kivy.app import * | |
from kivy.uix.widget import Widget | |
from kivy.uix.button import Button | |
import datetime | |
from kivy.clock import Clock | |
import alarm | |
from kivy.properties import ObjectProperty | |
class MyHomeScreen(Widget): | |
alarmbox = ObjectProperty(None) | |
def __init__(self, **kwargs): | |
super(MyHomeScreen, self).__init__(**kwargs) | |
self.alarmbox = alarm.AlarmBox() | |
self.start() | |
def start(self): | |
Clock.schedule_interval(self.check_alarm, 0.5) | |
def check_alarm(self, dt): | |
print "in check alarm" | |
a = self.alarmbox | |
if(a.time == datetime.datetime.now): | |
print "BRINNNNG" | |
else: | |
print "No alarm" | |
def open_alarm(self): | |
a = alarm.AlarmBox() | |
a.open() | |
class ButtonTest(Widget): | |
pass | |
class MyAlarmApp(App): | |
def build(self): | |
widget = MyHomeScreen() | |
return widget | |
if __name__ == '__main__': | |
MyAlarmApp().run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment