Actualize clock once per second
This commit is contained in:
parent
dd7b5ef346
commit
13c684860d
@ -46,7 +46,7 @@ battery status
|
|||||||
|
|
||||||
This class shows a clock
|
This class shows a clock
|
||||||
|
|
||||||
* format
|
* format — stftime format string
|
||||||
|
|
||||||
### mail
|
### mail
|
||||||
|
|
||||||
|
@ -10,8 +10,11 @@ class Clock(IntervalModule):
|
|||||||
This class shows a clock
|
This class shows a clock
|
||||||
"""
|
"""
|
||||||
|
|
||||||
settings = ("format",)
|
settings = (
|
||||||
|
("format", "stftime format string"),
|
||||||
|
)
|
||||||
format = None
|
format = None
|
||||||
|
interval = 1
|
||||||
|
|
||||||
def init(self):
|
def init(self):
|
||||||
if self.format is None:
|
if self.format is None:
|
||||||
@ -38,9 +41,8 @@ class Clock(IntervalModule):
|
|||||||
self.format = "%a %-d %b %X"
|
self.format = "%a %-d %b %X"
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
full_text = datetime.datetime.now().strftime(self.format)
|
|
||||||
self.output = {
|
self.output = {
|
||||||
"full_text": full_text,
|
"full_text": datetime.datetime.now().strftime(self.format),
|
||||||
"name": "pyclock",
|
"name": "pyclock",
|
||||||
"urgent": False,
|
"urgent": False,
|
||||||
"color": "#ffffff"
|
"color": "#ffffff"
|
||||||
|
Loading…
Reference in New Issue
Block a user