behave_manners.pagelems.helpers module

class Integer(value)

Bases: object

Mutable integer implementation

Useful for counters, that need to be passed by reference

class XPath(xpath, complete=True)

Bases: object

Dummy class to wrap an xpath string

Attribute complete:
 mark if this XPath should reliably locate elements or have less reliable results.
count_calls(fn)

Wrapper for function, keeping a count of fn’s calls

prepend_xpath(pre, xpath, glue=False)

Prepend some xpath to another, properly joining the slashes

textescape(tstr)
to_bool(v)

Convert boolean-like value of html attribute to python True/False

Example truthy values (for attr in <b> ):
<b attr> <b attr=”1”> <b attr=”true”> <b attr=”anything”>
example falsy values:
<b attr=”0”> <b attr=”false”> <b attr=”False”>