Skip to content

Commit

Permalink
Merge pull request gpiozero#892 from chrisruk/memory_pinout_gb
Browse files Browse the repository at this point in the history
Memory pinout GB
  • Loading branch information
waveform80 authored Oct 1, 2020
2 parents 70cc772 + 340355e commit 3b9b785
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions gpiozero/pins/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1304,18 +1304,24 @@ def __format__(self, format_spec):
})
return self.board.format(style=style, **kw)
elif content == 'specs':
specs = self._asdict()
if specs['memory'] < 1024:
specs['memory_unit'] = "MB"
else:
specs['memory'] /= 1024
specs['memory_unit'] = "GB"
return dedent("""\
{style:bold}Revision {style:reset}: {revision}
{style:bold}SoC {style:reset}: {soc}
{style:bold}RAM {style:reset}: {memory}Mb
{style:bold}RAM {style:reset}: {memory}{memory_unit}
{style:bold}Storage {style:reset}: {storage}
{style:bold}USB ports {style:reset}: {usb} {style:yellow}(excluding power){style:reset}
{style:bold}Ethernet ports {style:reset}: {ethernet}
{style:bold}Wi-fi {style:reset}: {wifi}
{style:bold}Bluetooth {style:reset}: {bluetooth}
{style:bold}Camera ports (CSI) {style:reset}: {csi}
{style:bold}Display ports (DSI){style:reset}: {dsi}"""
).format(style=style, **self._asdict())
).format(style=style, **specs)
elif content == 'headers':
return '\n\n'.join(
dedent("""\
Expand Down

0 comments on commit 3b9b785

Please sign in to comment.