Corrected duplicate hour time formatting
This commit is contained in:
11
clock.json
11
clock.json
@@ -1,7 +1,7 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"surf": "panel_script::time",
|
"surf": "panel_script::time",
|
||||||
"anchor": "0.5,0.4",
|
"anchor": "0.5, 0.4",
|
||||||
"args": {
|
"args": {
|
||||||
"size": 360
|
"size": 360
|
||||||
}
|
}
|
||||||
@@ -49,5 +49,14 @@
|
|||||||
"anchor": ".5 .5"
|
"anchor": ".5 .5"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"surf": "panel_script::weather",
|
||||||
|
"args": {
|
||||||
|
"fmt": "Weather updated {current_conditions.last_updated}",
|
||||||
|
"size": 30
|
||||||
|
},
|
||||||
|
"anchor": ".5 1",
|
||||||
|
"position": "0 -20"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -27,11 +27,11 @@ class Font(object):
|
|||||||
roboto = Font('res/RobotoSlab-Regular.ttf')
|
roboto = Font('res/RobotoSlab-Regular.ttf')
|
||||||
|
|
||||||
|
|
||||||
def __do_eval(text):
|
def __do_eval(t):
|
||||||
try:
|
try:
|
||||||
return eval(text)
|
return eval(t)
|
||||||
except:
|
except:
|
||||||
return text
|
return t
|
||||||
|
|
||||||
|
|
||||||
def text(size=60, t="", do_eval=False):
|
def text(size=60, t="", do_eval=False):
|
||||||
@@ -40,7 +40,7 @@ def text(size=60, t="", do_eval=False):
|
|||||||
return roboto[size].render(t, True, WHITE)
|
return roboto[size].render(t, True, WHITE)
|
||||||
|
|
||||||
|
|
||||||
def time(size=60, fmt='%I:%H', strip='0'):
|
def time(size=60, fmt='%I:%M', strip='0'):
|
||||||
return roboto[size].render(format(datetime.now(), fmt).lstrip(strip), True, WHITE)
|
return roboto[size].render(format(datetime.now(), fmt).lstrip(strip), True, WHITE)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user