Skip to content

Commit 7e8892f

Browse files
committed
correct platform values, right ?
1 parent 349bfd0 commit 7e8892f

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

build.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,14 @@
4141
# TODO: retrieve the version number from git
4242
# TODO: give each file a different version number possibly (that of the latest released change)
4343
VERSION_NUMBER = "0.0.1"
44-
THIS_REPOSITORY = "https://github.com/Neradoc/Neradoc-Circuitpython-Keyboard-Layouts"
44+
THIS_REPOSITORY = "https://github.com/Neradoc/Circuitpython_Keyboard_Layouts"
4545

4646
PLATFORMS = ["mpy6", "mpy7"]
47+
PLATFORM_NAMES = {
48+
"py": "py",
49+
"mpy6": "6.x-mpy",
50+
"mpy7": "7.x-mpy",
51+
}
4752

4853
# https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/mpy-cross/
4954
# TODO: identify current OS and pick one
@@ -71,7 +76,7 @@
7176

7277
def fmt(path, platform="py"):
7378
"""shortcut for the py directory"""
74-
return path.format(platform=platform)
79+
return path.format(platform=PLATFORM_NAMES[platform])
7580

7681

7782
# find in python
@@ -98,8 +103,8 @@ def init_directories():
98103

99104
# cleanup build directories
100105
for platform in ["py"] + PLATFORMS:
101-
bun_dir = BUNDLE_DIR.format(platform=platform)
102-
zip_file = BUNDLE_ZIP.format(platform=platform)
106+
bun_dir = BUNDLE_DIR.format(platform=PLATFORM_NAMES[platform])
107+
zip_file = BUNDLE_ZIP.format(platform=PLATFORM_NAMES[platform])
103108
if os.path.isdir(bun_dir):
104109
shutil.rmtree(bun_dir)
105110
if os.path.isfile(zip_file):
@@ -158,8 +163,8 @@ def make_the_mpy_bundles():
158163
# duplicate the py dir to mpy6 and mpy7
159164
for platform in PLATFORMS:
160165
cross = os.path.join(BUILD_DEPS, MPYCROSS[platform])
161-
bun_dir = BUNDLE_DIR.format(platform=platform)
162-
lib_dir = BUNDLE_LIB_DIR.format(platform=platform)
166+
bun_dir = BUNDLE_DIR.format(platform=PLATFORM_NAMES[platform])
167+
lib_dir = BUNDLE_LIB_DIR.format(platform=PLATFORM_NAMES[platform])
163168
shutil.copytree(fmt(BUNDLE_DIR), bun_dir)
164169
# run mpy-cross in each of those
165170
for lib_file in glob.glob(os.path.join(lib_dir, "*.py")):
@@ -172,8 +177,8 @@ def do_the_zips():
172177
"""finally create the zip files for release"""
173178
# now do the zips
174179
for platform in ["py"] + PLATFORMS:
175-
bun_dir = BUNDLE_DIR.format(platform=platform)
176-
zip_file = BUNDLE_ZIP.format(platform=platform)
180+
bun_dir = BUNDLE_DIR.format(platform=PLATFORM_NAMES[platform])
181+
zip_file = BUNDLE_ZIP.format(platform=PLATFORM_NAMES[platform])
177182
all_files = list_all_files(bun_dir)
178183
with zipfile.ZipFile(zip_file, "w") as bundle:
179184
# metadata (bundler version)

0 commit comments

Comments
 (0)