Skip to content

Commit

Permalink
Update build scripts, write LF line endings.
Browse files Browse the repository at this point in the history
  • Loading branch information
titusz committed Feb 11, 2022
1 parent 5432b40 commit 698ba9e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion tests/build_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def main():
r1 = "![ISCC Architecture](https://raw.githubusercontent.com/iscc/iscc-core/master/docs/images/iscc-codec-light.png#only-light)\n"
r2 = "![ISCC Architecture](https://raw.githubusercontent.com/iscc/iscc-core/master/docs/images/iscc-codec-dark.png#only-dark)\n"
text = text.replace(m, r1 + r2)
with open(DST, "wt", encoding="utf-8") as outf:
with open(DST, "wt", encoding="utf-8", newline="\n") as outf:
outf.write(text)


Expand Down
2 changes: 1 addition & 1 deletion tests/build_test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def main():
raise

testdata["outputs"] = result
with open(TEST_DATA, "w", encoding="utf-8") as outf:
with open(TEST_DATA, "w", encoding="utf-8", newline="\n") as outf:
out_data = dump_compact(data)
outf.write(out_data)

Expand Down
17 changes: 8 additions & 9 deletions tests/build_valid_prefixes.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
# -*- coding: utf-8 -*-
"""Build a list of possible base32 encoded ISCC 2-character prefixes for validation"""
import iscc_core as ic
import types


def build_valid_prefixes():
prefixes = set()

stype_for_mtype = {
types.MT.META: types.ST,
types.MT.SEMANTIC: types.ST_CC,
types.MT.CONTENT: types.ST_CC,
types.MT.DATA: types.ST,
types.MT.INSTANCE: types.ST,
types.MT.ISCC: types.ST_ISCC,
types.MT.ID: types.ST_ID,
ic.MT.META: ic.ST,
ic.MT.SEMANTIC: ic.ST_CC,
ic.MT.CONTENT: ic.ST_CC,
ic.MT.DATA: ic.ST,
ic.MT.INSTANCE: ic.ST,
ic.MT.ISCC: ic.ST_ISCC,
ic.MT.ID: ic.ST_ID,
}

for mtype in types.MT:
for mtype in ic.MT:
for stype in stype_for_mtype[mtype]:
digest = ic.write_header(mtype, stype, 0, 0)
base = ic.encode_base32(digest)
Expand Down

0 comments on commit 698ba9e

Please sign in to comment.