From 1d9614fae798555f1772242dc35cd801ad7bff8f Mon Sep 17 00:00:00 2001 From: enkore Date: Fri, 7 Nov 2014 11:22:55 +0100 Subject: [PATCH] Fix #141 --- i3pystatus/clock.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/i3pystatus/clock.py b/i3pystatus/clock.py index e8833ce..dc03bee 100644 --- a/i3pystatus/clock.py +++ b/i3pystatus/clock.py @@ -11,10 +11,17 @@ from i3pystatus import IntervalModule class Clock(IntervalModule): """ This class shows a clock + + format can be passed in four different ways: + + - single string, no timezone, just the strftime-format + - one two-tuple, first is the format, second the timezone + - list of strings - no timezones + - list of two tuples, first is the format, second is timezone """ settings = ( - ("format", "list of tuple (stftime format string, optional timezone), `None` means to use the default, locale-dependent format. Can cycle between formats with mousewheel"), + ("format", "`None` means to use the default, locale-dependent format. Can cycle between formats with mousewheel"), ("color", "RGB hexadecimal code color specifier, default to #ffffff, set to `i3Bar` to use i3 bar default"), ) format = None @@ -35,7 +42,7 @@ class Clock(IntervalModule): # DMY format - almost all other countries self.format = ["%a %-d %b %X"] - elif isinstance(self.format, str): + elif isinstance(self.format, str) or isinstance(self.format, tuple): self.format = [self.format] self.format = self.expand_formats(self.format)