Skip to content

Commit a8b4909

Browse files
philippjfrrmorshea
authored andcommitted
Replace rstrip with correct handling
1 parent 37f2def commit a8b4909

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

idom/client/manage.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,16 @@ def web_module_exists(package_name: str) -> bool:
3535

3636

3737
def web_module_names() -> Set[str]:
38-
return {
39-
str(rel_pth.as_posix()).rstrip(".js")
40-
for rel_pth in (
41-
pth.relative_to(WEB_MODULES_DIR) for pth in WEB_MODULES_DIR.glob("**/*.js")
42-
)
43-
if Path("common") not in rel_pth.parents
44-
}
38+
names = []
39+
for pth in WEB_MODULES_DIR.glob("**/*.js"):
40+
for rel_pth in pth.relative_to(WEB_MODULES_DIR):
41+
if Path("common") not in rel_pth.parents:
42+
continue
43+
module_path = str(rel_pth.as_posix())
44+
if module_path.endswith('.js'):
45+
module_path = module_path[:-3]
46+
names.append(module_path)
47+
return set(names)
4548

4649

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

0 commit comments

Comments
 (0)