You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`name`|`str`|| Name of the demonstration directory |
34
34
|`base_dir`|`str`|`"./demonstrations"`| Base directory containing all demonstrations directories |
35
35
|`json_backend`|`str`|`"auto"`| Backend to use to load JSON files. Can be either 'auto', 'json', 'orjson', or 'ujson'. For the 'auto' option, it will try to import 'orjson' first, then 'ujson', then 'json'. Both 'orjson' and 'ujson' are faster than 'json', but they must be installed first, via `pip install orjson` or `pip install ujson`. |
36
+
|`encoding`|`str`|`None`| Encoding to use when reading and writing files. If None, it will use the system's default encoding. |
36
37
37
38
38
39
#### `Demonstration.__repr__`
@@ -126,7 +127,7 @@ checking that all required files exist.
@@ -141,6 +142,7 @@ Load a JSON file from the demonstration directory
141
142
|`filename`|`str`|| Name of the file to load |
142
143
|`backend`|`str`|`None`| Backend to use to load the JSON file. Can be either None, 'auto', 'json', 'orjson', or 'ujson'. If 'auto', it will try to import 'orjson' first, then 'ujson', then 'json'. If None, it will use the json_backend specified in the constructor. |
143
144
|`default`|`Any`|`None`| Default value to return if the file does not exist. If None, it will raise an error. |
145
+
|`encoding`|`str`|`None`| Encoding to use when reading the file. If None, it will default to the Demonstration's encoding specified in the constructor, or the system's default encoding if it was not specified. |
|`check_hash`|`bool`|`False`| Whether to validate the HTML hash before using cached XPaths. |
786
788
|`parser`|`str`|`"lxml"`| The parser backend to use for HTML parsing. Currently, only 'lxml' is supported. |
787
789
|`json_backend`|`str`|`"auto"`| The backend to use for loading and saving JSON. If 'auto', chooses the best available option. |
790
+
|`encoding`|`str`|`None`| Encoding to use when reading the file. If None, it will default to the Demonstration's encoding specified in the constructor, or the system's default encoding if it was not specified. |
788
791
789
792
790
793
##### Returns
@@ -798,7 +801,7 @@ A dictionary mapping unique IDs (from `uid_key`) to their corresponding XPaths i
@@ -756,6 +756,7 @@ for a given turn, then we will find the previous turn that has candidates.
756
756
|`demos`|`list`|| The list of demonstrations to select the turns from. |
757
757
|`candidates`|`dict`|`None`| The candidates for all turns, as a dictionary of lists. If None, then the candidates will not be used. Defaults to None. |
758
758
|`num_candidates`|`int`|`20`| The number of candidates to select for each turn. Defaults to 20. |
759
+
|`remove_turns_without_elements`|`bool`|`True`| Whether to remove turns that do not have elements. Defaults to True. |
@@ -560,7 +560,7 @@ A string or dictionary representing the timestamp.
560
560
### `format_change`
561
561
562
562
```
563
-
weblinx.utils.format.format_change(turn, formatters=(<_ast.Name object at 0x7feacdfde4c0>, <_ast.Name object at 0x7feacdfde5b0>, <_ast.Name object at 0x7feacdfde5e0>), return_as="dict")
563
+
weblinx.utils.format.format_change(turn, formatters=(<_ast.Name object at 0x7fac2032da60>, <_ast.Name object at 0x7fac2032db50>, <_ast.Name object at 0x7fac2032db80>), return_as="dict")
564
564
```
565
565
566
566
#### Description
@@ -577,7 +577,7 @@ when the input is changed, for example, in an input, select or textarea.
577
577
| Name | Type | Default | Description |
578
578
| ---- | ---- | ------- | ----------- |
579
579
|`turn`|`Turn`|| The turn object to be represented as either a string or a dictionary. |
580
-
|`formatters`| `` |`(<_ast.Name object at 0x7feacdfde4c0>, <_ast.Name object at 0x7feacdfde5b0>, <_ast.Name object at 0x7feacdfde5e0>)`| A tuple of functions to be used to format the turn. The functions will be called in order, and each function should return a dictionary (not a string), which will be merged into the final output. The functions should take the turn as the first argument, and return a dictionary. |
580
+
|`formatters`| `` |`(<_ast.Name object at 0x7fac2032da60>, <_ast.Name object at 0x7fac2032db50>, <_ast.Name object at 0x7fac2032db80>)`| A tuple of functions to be used to format the turn. The functions will be called in order, and each function should return a dictionary (not a string), which will be merged into the final output. The functions should take the turn as the first argument, and return a dictionary. |
581
581
|`return_as`|`str`|`"dict"`| Whether to return the formatted element as a string or a dictionary. |
582
582
583
583
@@ -592,7 +592,7 @@ A string or dictionary representing the turn.
592
592
### `format_click`
593
593
594
594
```
595
-
weblinx.utils.format.format_click(turn, formatters=(<_ast.Name object at 0x7feacdfdecd0>, <_ast.Name object at 0x7feacdfdec70>, <_ast.Name object at 0x7feace01d040>), return_as="dict")
595
+
weblinx.utils.format.format_click(turn, formatters=(<_ast.Name object at 0x7fac2032a610>, <_ast.Name object at 0x7fac2032a520>, <_ast.Name object at 0x7fac2032a670>), return_as="dict")
596
596
```
597
597
598
598
#### Description
@@ -605,7 +605,7 @@ Format a turn with intent click into a readable format.
605
605
| Name | Type | Default | Description |
606
606
| ---- | ---- | ------- | ----------- |
607
607
|`turn`|`Turn`|| The turn object to be represented as either a string or a dictionary. |
608
-
|`formatters`| `` |`(<_ast.Name object at 0x7feacdfdecd0>, <_ast.Name object at 0x7feacdfdec70>, <_ast.Name object at 0x7feace01d040>)`| A tuple of functions to be used to format the turn. The functions will be called in order, and each function should return a dictionary (not a string), which will be merged into the final output. The functions should take the turn as the first argument, and return a dictionary. |
608
+
|`formatters`| `` |`(<_ast.Name object at 0x7fac2032a610>, <_ast.Name object at 0x7fac2032a520>, <_ast.Name object at 0x7fac2032a670>)`| A tuple of functions to be used to format the turn. The functions will be called in order, and each function should return a dictionary (not a string), which will be merged into the final output. The functions should take the turn as the first argument, and return a dictionary. |
609
609
|`return_as`|`str`|`"dict"`| Whether to return the formatted element as a string or a dictionary. |
610
610
611
611
@@ -678,7 +678,7 @@ A string or dictionary representing the turn.
678
678
### `format_hover`
679
679
680
680
```
681
-
weblinx.utils.format.format_hover(turn, formatters=(<_ast.Name object at 0x7feace004a90>, <_ast.Name object at 0x7feace004ac0>, <_ast.Name object at 0x7feace004af0>), return_as="dict")
681
+
weblinx.utils.format.format_hover(turn, formatters=(<_ast.Name object at 0x7fac20343040>, <_ast.Name object at 0x7fac20343070>, <_ast.Name object at 0x7fac203430a0>), return_as="dict")
682
682
```
683
683
684
684
#### Description
@@ -691,7 +691,7 @@ This behaves similarly to format_click, but for hover events.
691
691
| Name | Type | Default | Description |
692
692
| ---- | ---- | ------- | ----------- |
693
693
|`turn`|`Turn`|| The turn object to be represented as either a string or a dictionary. |
694
-
|`formatters`|`list or tuple`|`(<_ast.Name object at 0x7feace004a90>, <_ast.Name object at 0x7feace004ac0>, <_ast.Name object at 0x7feace004af0>)`| A tuple of functions to be used to format the turn. The functions will be called in order, and each function should return a dictionary (not a string), which will be merged into the final output. The functions should take the turn as the first argument, and return a dictionary. |
694
+
|`formatters`|`list or tuple`|`(<_ast.Name object at 0x7fac20343040>, <_ast.Name object at 0x7fac20343070>, <_ast.Name object at 0x7fac203430a0>)`| A tuple of functions to be used to format the turn. The functions will be called in order, and each function should return a dictionary (not a string), which will be merged into the final output. The functions should take the turn as the first argument, and return a dictionary. |
695
695
|`return_as`|`str`|`"dict"`| Whether to return the formatted element as a string or a dictionary. |
696
696
697
697
@@ -807,7 +807,7 @@ Similar to format_mouse_xy, but for scroll events.
807
807
### `format_submit`
808
808
809
809
```
810
-
weblinx.utils.format.format_submit(turn, formatters=(<_ast.Name object at 0x7feace0245b0>, <_ast.Name object at 0x7feace0245e0>), return_as="dict")
810
+
weblinx.utils.format.format_submit(turn, formatters=(<_ast.Name object at 0x7fac20160b20>, <_ast.Name object at 0x7fac20160b50>), return_as="dict")
811
811
```
812
812
813
813
#### Description
@@ -820,7 +820,7 @@ Format a turn with intent submit into a readable format.
820
820
| Name | Type | Default | Description |
821
821
| ---- | ---- | ------- | ----------- |
822
822
| `turn` | `Turn` | | The turn object to be represented as either a string or a dictionary. |
823
-
| `formatters` | `` | `(<_ast.Name object at 0x7feace0245b0>, <_ast.Name object at 0x7feace0245e0>)` | A tuple of functions to be used to format the turn. The functions will be called in order, and each function should return a dictionary (not a string), which will be merged into the final output. The functions should take the turn as the first argument, and return a dictionary. |
823
+
| `formatters` | `` | `(<_ast.Name object at 0x7fac20160b20>, <_ast.Name object at 0x7fac20160b50>)` | A tuple of functions to be used to format the turn. The functions will be called in order, and each function should return a dictionary (not a string), which will be merged into the final output. The functions should take the turn as the first argument, and return a dictionary. |
824
824
| `return_as` | `str` | `"dict"` | Whether to return the formatted element as a string or a dictionary. |
825
825
826
826
@@ -837,7 +837,7 @@ Format a turn with intent tabcreate, tabremove or tabswitch into a readable form
837
837
### `format_text_input`
838
838
839
839
```
840
-
weblinx.utils.format.format_text_input(turn, formatters=(<_ast.Name object at 0x7feace033ca0>, <_ast.Name object at 0x7feace033df0>, <_ast.Name object at 0x7feace033f10>), return_as="dict")
840
+
weblinx.utils.format.format_text_input(turn, formatters=(<_ast.Name object at 0x7fac20152220>, <_ast.Name object at 0x7fac20152340>, <_ast.Name object at 0x7fac20152490>), return_as="dict")
841
841
```
842
842
843
843
#### Description
@@ -854,7 +854,7 @@ is changed.
854
854
| Name | Type | Default | Description |
855
855
| ---- | ---- | ------- | ----------- |
856
856
| `turn` | `Turn` | | The turn object to be represented as either a string or a dictionary. |
857
-
| `formatters` | `` | `(<_ast.Name object at 0x7feace033ca0>, <_ast.Name object at 0x7feace033df0>, <_ast.Name object at 0x7feace033f10>)` | A tuple of functions to be used to format the turn. The functions will be called in order, and each function should return a dictionary (not a string), which will be merged into the final output. The functions should take the turn as the first argument, and return a dictionary. |
857
+
| `formatters` | `` | `(<_ast.Name object at 0x7fac20152220>, <_ast.Name object at 0x7fac20152340>, <_ast.Name object at 0x7fac20152490>)` | A tuple of functions to be used to format the turn. The functions will be called in order, and each function should return a dictionary (not a string), which will be merged into the final output. The functions should take the turn as the first argument, and return a dictionary. |
858
858
| `return_as` | `str` | `"dict"` | Whether to return the formatted element as a string or a dictionary. |
859
859
860
860
@@ -869,7 +869,7 @@ A string or dictionary representing the turn.
869
869
### `format_intent_automatically`
870
870
871
871
```
872
-
weblinx.utils.format.format_intent_automatically(turn, format_change=<_ast.Name object at 0x7feace039c40>, format_click=<_ast.Name object at 0x7feace039c70>, format_copy=<_ast.Name object at 0x7feace039ca0>, format_hover=<_ast.Name object at 0x7feace039cd0>, format_load=<_ast.Name object at 0x7feace039d00>, format_paste=<_ast.Name object at 0x7feace039d30>, format_say=<_ast.Name object at 0x7feace039d60>, format_scroll=<_ast.Name object at 0x7feace039d90>, format_submit=<_ast.Name object at 0x7feace039dc0>, format_tab=<_ast.Name object at 0x7feace039df0>, format_text_input=<_ast.Name object at 0x7feace039e20>, return_as="dict")
872
+
weblinx.utils.format.format_intent_automatically(turn, format_change=<_ast.Name object at 0x7fac201621f0>, format_click=<_ast.Name object at 0x7fac20162220>, format_copy=<_ast.Name object at 0x7fac20162250>, format_hover=<_ast.Name object at 0x7fac20162280>, format_load=<_ast.Name object at 0x7fac201622b0>, format_paste=<_ast.Name object at 0x7fac201622e0>, format_say=<_ast.Name object at 0x7fac20162310>, format_scroll=<_ast.Name object at 0x7fac20162340>, format_submit=<_ast.Name object at 0x7fac20162370>, format_tab=<_ast.Name object at 0x7fac201623a0>, format_text_input=<_ast.Name object at 0x7fac201623d0>, return_as="dict")
0 commit comments