Skip to content

Commit

Permalink
Replace rstrip with correct handling
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr authored and rmorshea committed Feb 26, 2021
1 parent 37f2def commit a8b4909
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions idom/client/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,16 @@ def web_module_exists(package_name: str) -> bool:


def web_module_names() -> Set[str]:
return {
str(rel_pth.as_posix()).rstrip(".js")
for rel_pth in (
pth.relative_to(WEB_MODULES_DIR) for pth in WEB_MODULES_DIR.glob("**/*.js")
)
if Path("common") not in rel_pth.parents
}
names = []
for pth in WEB_MODULES_DIR.glob("**/*.js"):
for rel_pth in pth.relative_to(WEB_MODULES_DIR):
if Path("common") not in rel_pth.parents:
continue
module_path = str(rel_pth.as_posix())
if module_path.endswith('.js'):
module_path = module_path[:-3]
names.append(module_path)
return set(names)


def add_web_module(package_name: str, source: Union[Path, str]) -> str:
Expand Down

0 comments on commit a8b4909

Please sign in to comment.