Skip to content

Commit bda5bca

Browse files
authored
Merge pull request gpiozero#433 from RPi-Distro/lurch-patch-1
Default to 'full' content in __format__
2 parents 173a6ce + 4e66c0f commit bda5bca

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

gpiozero/pins/data.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,10 @@ def from_style_content(cls, format_spec):
419419
style = 'color' if cls._term_supports_color() else 'mono'
420420
if len(content) > 1:
421421
raise ValueError('cannot specify more than one content element')
422-
content = content.pop()
422+
try:
423+
content = content.pop()
424+
except KeyError:
425+
content = 'full'
423426
return cls(style == 'color'), content
424427

425428
def __call__(self, format_spec):

0 commit comments

Comments
 (0)