oaknut-cli 12.2.0__tar.gz → 12.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oaknut-cli
3
- Version: 12.2.0
3
+ Version: 12.4.0
4
4
  Summary: Shared CLI toolkit for the oaknut family: the contributed-command axis and report-rendering helpers a disc command needs, below the filesystem packages.
5
5
  Author-email: Robert Smallshire <robert@smallshire.org.uk>
6
6
  License-Expression: MIT
@@ -31,11 +31,12 @@ from oaknut.cli.help import (
31
31
  from oaknut.cli.reports import (
32
32
  SECTOR_SIZE,
33
33
  address_cell,
34
+ bytes_cell,
34
35
  kv_table,
35
36
  size_cell,
36
37
  )
37
38
 
38
- __version__ = "12.2.0"
39
+ __version__ = "12.4.0"
39
40
 
40
41
  __all__ = [
41
42
  "COMMAND_KIND",
@@ -46,6 +47,7 @@ __all__ = [
46
47
  "use_plain_help",
47
48
  "SECTOR_SIZE",
48
49
  "address_cell",
50
+ "bytes_cell",
49
51
  "kv_table",
50
52
  "size_cell",
51
53
  ]
@@ -27,6 +27,16 @@ def size_cell(sectors: int) -> ByAudience:
27
27
  return ByAudience(machine=num_bytes, human=format_capacity(num_bytes))
28
28
 
29
29
 
30
+ def bytes_cell(num_bytes: int) -> ByAudience:
31
+ """A byte count as an audience-aware cell.
32
+
33
+ Like :func:`size_cell`, but for a value already in bytes (a file
34
+ length) rather than sectors: humans read friendly IEC units
35
+ (``9.9 KiB``); machine formatters get the raw integer.
36
+ """
37
+ return ByAudience(machine=num_bytes, human=format_capacity(num_bytes))
38
+
39
+
30
40
  def address_cell(address: int) -> ByAudience:
31
41
  """A 32-bit Acorn address as an audience-aware cell.
32
42
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oaknut-cli
3
- Version: 12.2.0
3
+ Version: 12.4.0
4
4
  Summary: Shared CLI toolkit for the oaknut family: the contributed-command axis and report-rendering helpers a disc command needs, below the filesystem packages.
5
5
  Author-email: Robert Smallshire <robert@smallshire.org.uk>
6
6
  License-Expression: MIT
File without changes
File without changes
File without changes
File without changes