# -----------------------------------------------------------------------------
# Title       : hourApp.py
# Author      : Wamk9 (wamk-9@hotmail.com)
# Date        : 21-Jul-2015
# Description : Clock 
# -----------------------------------------------------------------------------

# -------------------------------------
# Imports
# -------------------------------------
import ac
import acsys
import math
from datetime import *
	
l_lapcount=0

def acMain(ac_version):
		global l_lapcount
		appWindow = ac.newApp("Clock")
		ac.setSize(appWindow, 200, 75)
		ac.setIconPosition(appWindow, 0, 0)
		ac.setBackgroundTexture(appWindow, "apps/python/hourApp/img/background_off.png")
		l_lapcount = ac.addLabel(appWindow, str(datetime.now().strftime("%H:%M")));
		ac.setFontAlignment(l_lapcount, 'center')
		ac.setFontSize(l_lapcount,40)
		ac.setPosition(l_lapcount, 3, 15)
		return "Clock"
	

def acUpdate(deltaT):
		global l_lapcount
		window = 0
		ac.setText(l_lapcount, "{}".format(str(datetime.now().strftime("%H:%M"))))
	