Skip to content

Commit

Permalink
Improve formatting yet again
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurenzV committed Feb 7, 2024
1 parent 98e1a00 commit 60b89f3
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions scripts/gen-universal-table.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@
if j >= 0:
line = line[:j]

fields = [x.strip () for x in line.split (';')]
if len (fields) == 1:
fields = [x.strip() for x in line.split(';')]
if len(fields) == 1:
continue

uu = fields[0].split ('..')
start = int (uu[0], 16)
if len (uu) == 1:
start = int(uu[0], 16)
if len(uu) == 1:
end = start
else:
end = int (uu[1], 16)
end = int(uu[1], 16)

t = fields[1 if i not in [2, 4] else 2]

Expand All @@ -67,9 +67,9 @@
t = 'Not_Applicable'

i0 = i if i < 7 else i - 7
for u in range (start, end + 1):
for u in range(start, end + 1):
data[i0][u] = t
values[i0][t] = values[i0].get (t, 0) + end - start + 1
values[i0][t] = values[i0].get(t, 0) + end - start + 1

defaults = ('Other', 'Not_Applicable', 'jt_X', '', 'Cn', 'No_Block', 'Unknown')

Expand Down Expand Up @@ -97,14 +97,14 @@

# Merge data into one dict:
for i, v in enumerate(defaults):
values[i][v] = values[i].get (v, 0) + 1
values[i][v] = values[i].get(v, 0) + 1
combined = {}
for i, d in enumerate(data):
for u, v in d.items():
if not u in combined:
if i >= 4:
continue
combined[u] = list (defaults)
combined[u] = list(defaults)
combined[u][i] = v
combined = {k: v for k, v in combined.items(
) if v[6] not in DISABLED_SCRIPTS}
Expand Down

0 comments on commit 60b89f3

Please sign in to comment.