Merge branch 'main' of https://github.com/xlang-ai/DesktopEnv
This commit is contained in:
@@ -17,6 +17,9 @@ import difflib
|
||||
|
||||
from .utils import _match_record, _match_value_to_rule
|
||||
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger("desktopenv.metric.general")
|
||||
|
||||
def check_include_exclude(result: str, rules: Dict[str, List[str]]) -> float:
|
||||
if result is None:
|
||||
@@ -184,7 +187,7 @@ def check_accessibility_tree(result: str, rules: List[Dict[str, Any]]) -> float:
|
||||
raise ValueError("At least one of xpath and selectors is required")
|
||||
|
||||
if len(elements) == 0:
|
||||
print("no elements")
|
||||
logger.info("No elements: %s", r["xpath"] if "xpath" in r else r["selectors"])
|
||||
return 0.
|
||||
|
||||
if "text" in r:
|
||||
|
||||
@@ -81,7 +81,7 @@ def check_mp3_meta(result: str, meta: Dict[str, Dict[str, Union[str, V]]]) -> bo
|
||||
for k, r in meta.items():
|
||||
value = id3_dict.get(k, "")
|
||||
if isinstance(value, list):
|
||||
value: str = value[0]
|
||||
value: str = ",".join(value)
|
||||
logger.debug("%s.%s: %s", result, k, value)
|
||||
metric = metric and _match_value_to_rule(value, r)
|
||||
return float(metric)
|
||||
|
||||
Reference in New Issue
Block a user