Skip to content

Commit ee6bcf7

Browse files
Update WebForms.py
1 parent c6b5f5b commit ee6bcf7

1 file changed

Lines changed: 22 additions & 15 deletions

File tree

python/WebForms.py

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,33 +1440,39 @@ class InputPlace:
14401440
UPPER = '-'
14411441
HEAD = '^'
14421442
SCREEN_ORIENTATION = '%'
1443-
1443+
14441444
@staticmethod
14451445
def id(element_id: str) -> str:
14461446
return element_id
1447-
1447+
14481448
@staticmethod
14491449
def name(name: str, index: Optional[int] = None) -> str:
1450-
if index is not None:
1451-
return f'({name}){index}'
1452-
return f'({name})'
1453-
1450+
return f'({name}){index}' if index is not None else f'({name})'
1451+
1452+
@staticmethod
1453+
def all_names(name: str) -> str:
1454+
return f'({name})*'
1455+
14541456
@staticmethod
14551457
def tag(tag_name: str, index: Optional[int] = None) -> str:
1456-
if index is not None:
1457-
return f'<{tag_name}>{index}'
1458-
return f'<{tag_name}>'
1459-
1458+
return f'<{tag_name}>{index}' if index is not None else f'<{tag_name}>'
1459+
1460+
@staticmethod
1461+
def all_tags(tag_name: str) -> str:
1462+
return f'<{tag_name}>*'
1463+
14601464
@staticmethod
14611465
def css_class(class_name: str, index: Optional[int] = None) -> str:
1462-
if index is not None:
1463-
return f'{{{class_name}}}{index}'
1464-
return f'{{{class_name}}}'
1465-
1466+
return f'{{{class_name}}}{index}' if index is not None else f'{{{class_name}}}'
1467+
1468+
@staticmethod
1469+
def all_classes(class_name: str) -> str:
1470+
return f'{{{class_name}}}*'
1471+
14661472
@staticmethod
14671473
def query(query_str: str) -> str:
14681474
return "*" + query_str.replace("=", "$[eq];")
1469-
1475+
14701476
@staticmethod
14711477
def query_all(query_str: str) -> str:
14721478
return "[" + query_str.replace("=", "$[eq];")
@@ -2001,3 +2007,4 @@ def remove_outer(text: str, start_string: str, end_string: str) -> str:
20012007

20022008
def line_break(text: str) -> str:
20032009
return text.replace("\n", "$[sln]")
2010+

0 commit comments

Comments
 (0)