Skip to content

Instantly share code, notes, and snippets.

@rlaager
Created February 22, 2020 23:49
Show Gist options
  • Save rlaager/963b482f47c59fc88ad088a149b31e2c to your computer and use it in GitHub Desktop.
Save rlaager/963b482f47c59fc88ad088a149b31e2c to your computer and use it in GitHub Desktop.
--- zfs.py.orig 2020-02-22 17:48:50.632095353 -0600
+++ zfs.py 2020-02-22 17:47:34.907137427 -0600
@@ -126,6 +126,7 @@
}
features = defaultdict(list)
+guids = dict()
readonly = dict()
for name, sub in sources.items():
@@ -139,9 +140,11 @@
guid = line.split()[-1]
if guid == 'org.open-zfs:large_block':
guid += 's'
- features[guid].append((name, ver))
+ feature = guid.split(':')[1]
+ guids[feature] = guid
+ features[feature].append((name, ver))
elif line.startswith('READ\\-ONLY COMPATIBLE'):
- readonly[guid] = line.split()[-1]
+ readonly[feature] = (line.split()[-1] == 'yes')
header = list(sorted(sources.keys()))
header = list(zip(header, (sorted(sources[name],
@@ -158,6 +161,7 @@
.yes{background-color:lightgreen}
.warn{background-color:yellow}
.no{background-color:lightsalmon}
+abbr{text-decoration: none}
table{border-collapse: collapse}
th,td{padding:0.2em 0.4em;border:1px solid #aaa;background-color:#f9f9f9}
th{background-color:#eaecf0}
@@ -185,9 +189,9 @@
mw.write('|-\n')
for feature, names in sorted(features.items()):
- html.write('<tr><th scope="row">' + feature + '</th>')
+ html.write('<tr><th scope="row"><abbr title="' + guids[feature] + '">' + feature + '</abbr></th>')
mw.write('!style="text-align:left"|' + feature + '\n')
- if readonly[feature] == 'yes':
+ if readonly[feature]:
html.write('<td class="yes">yes</td>')
mw.write('|style="background-color:lightgreen"|yes\n')
else:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment