HiveMinds / HiveMinds/appcommander

Determine why the `\u200e\u200f\...` artifacts may occasionally occur at `.xml`.

Open
#9 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

See:

```py
@typechecked
def dict_contains_other_dict(sub: Dict, main: Dict) -> bool:
"""Returns true if the sub dict is a subset of the main dict."""
for sub_key, sub_val in sub.items():
if sub_key not in main.keys():
return False
# An artifact like:
# "@text": "VPN Mode \u200e\u200f\u200e\u200e\u200e\u200e\u200e\u200f
# \u200e\u200f\u200f\u200f\u200e\u200e\u200e\u200e\u200e\u200e\u200f\
# u200e\u200e\u200f\u200e\u200e\u200e\u200e\u200f\u200f\u200f\u200f\
# u200f\u200e\u200e\u200f\u200f\u200e\u200e\u200e\u200f\u200e\u200e\
# u200f\u200e\u200e\u200e\u200e\u200e\u200e\u200f\u200e\u200f\u200f\
# u200f\u200e\u200e\u200e\u200e\u200e\u200e\u200f\u200e\u200f\u200e\
# u200e\u200e\u200e\u200e\u200e\u200e\u200f\u200e\u200e\u200e\u200e\
# u200f\u200e\u200e\u200e\u200f\u200f\u200f\u200f\u200f\u200e\u200e\
# u200f\u200f\u200e\u200f\u200f\u200e\u200e\u200e\u200eON\u200e\u200f
# \u200e\u200e\u200f\u200e",
# may occur at random. Therefore, the "in" option is included.
# TODO: determine why these artifacts may occur and/or remove them.
if sub_val != main[sub_key] and sub_val not in main[sub_key]:
return False
return True
```

Either filter the artifact out, or prevent it from occurring, than you can do exact matches on `requirement_object` instead of `i frequirement_object in screen_dict`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.