diff --git a/apps/tools/librelingo_tools/lili.py b/apps/tools/librelingo_tools/lili.py index ab2ed693454e..a4bde07f5ba2 100755 --- a/apps/tools/librelingo_tools/lili.py +++ b/apps/tools/librelingo_tools/lili.py @@ -69,10 +69,15 @@ def guess_path_to_course(path_to_course): return path_to_course -def skillfile_filter(path): - match = re.search(r"^([a-z0-9]+)/skills/([a-z0-9_-]+)\.yaml$", path) +def parse_skill_path(path): + match = re.search(r"^([a-zA-Z0-9-]+)/skills/([a-zA-Z0-9_-]+)\.yaml$", path) if not match: raise Exception(f"unrecoginized skill path: '{path}'") + return match + + +def skillfile_filter(path): + match = parse_skill_path(path) # return match.group(1) + '/' + match.group(2) return match.group(2) @@ -147,9 +152,7 @@ def export_skill_html_pages(course, count, reldir, html_dir): skill=skill, repository_url=get_repository_url(course), ) - match = re.search(r"^([a-z0-9]+)/skills/([a-z0-9_-]+).yaml", skill.filename) - if match is None: - exit(skill.filename) + match = parse_skill_path(skill.filename) module_name = match.group(1) file_name = match.group(2) dir_path = os.path.join(html_dir, "course", module_name, "skills")