Skip to content

Commit

Permalink
fix license
Browse files Browse the repository at this point in the history
  • Loading branch information
AlPha5130 committed Sep 13, 2020
1 parent 1d5fd0b commit 05c4a15
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ def build(self):
pack_name, 'w', compression=ZIP_DEFLATED, compresslevel=5)
pack.write(os.path.join(os.path.dirname(
__file__), "pack.png"), arcname="pack.png")
pack.write(os.path.join(os.path.dirname(
__file__), "LICENSE"), arcname="LICENSE")
pack.writestr("LICENSE", self.__handle_license())
pack.writestr("pack.mcmeta", dumps(
mcmeta, indent=4, ensure_ascii=False))
# dump lang file into pack
Expand Down Expand Up @@ -261,6 +260,11 @@ def __generate_legacy_content(self, content: dict) -> str:
legacy_lang_data[k] = content[v]
return ''.join(f'{k}={v}\n' for k, v in legacy_lang_data.items())

def __handle_license(self):
return ''.join(map(lambda item: item[1],
filter(lambda item: 12 < item[0] < 394,
enumerate(open(os.path.join(os.path.dirname(__file__), "LICENSE"), 'r', encoding='utf8')))))


class module_checker(object):
def __init__(self):
Expand Down

0 comments on commit 05c4a15

Please sign in to comment.