sim_explorer.utils.misc

Functions

from_xml(file[, sub])

Retrieve the Element root from a zipped file (retrieve sub), or an xml file (sub unused).

match_with_wildcard(findtxt, matchtxt)

Check whether 'findtxt' matches 'matchtxt'.

sim_explorer.utils.misc.from_xml(file: Path, sub: str | None = None) Element

Retrieve the Element root from a zipped file (retrieve sub), or an xml file (sub unused). If xpath is provided only the xpath matching element (using findall) is returned.

sim_explorer.utils.misc.match_with_wildcard(findtxt: str, matchtxt: str) bool

Check whether ‘findtxt’ matches ‘matchtxt’.

Parameters:
  • findtxt (str) – the text string which is checked. It can contain wildcard characters ‘*’, matching zero or more of any character.

  • matchtxt (str) – the text agains findtxt is checked

Returns: True/False