|
12 | 12 | # See the License for the specific language governing permissions and
|
13 | 13 | # limitations under the License.
|
14 | 14 |
|
15 |
| -from collections import OrderedDict |
| 15 | +from typing import Any, Dict |
16 | 16 |
|
17 | 17 | from appium import version as appium_version
|
18 | 18 |
|
19 | 19 |
|
20 |
| -def appium_bytes(value, encoding): |
21 |
| - """Return a bytes-like object |
22 |
| -
|
23 |
| - Has _appium_ prefix to avoid overriding built-in bytes. |
24 |
| -
|
25 |
| - Args: |
26 |
| - value (str): A value to convert |
27 |
| - encoding (str): A encoding which will convert to |
28 |
| -
|
29 |
| - Returns: |
30 |
| - str: A bytes-like object |
31 |
| - """ |
32 |
| - |
33 |
| - try: |
34 |
| - return bytes(value, encoding) # Python 3 |
35 |
| - except TypeError: |
36 |
| - return value # Python 2 |
37 |
| - |
38 |
| - |
39 |
| -def extract_const_attributes(cls): |
| 20 | +def extract_const_attributes(cls: type) -> Dict[str, Any]: |
40 | 21 | """Return dict with constants attributes and values in the class(e.g. {'VAL1': 1, 'VAL2': 2})
|
41 | 22 |
|
42 | 23 | Args:
|
43 | 24 | cls (type): Class to be extracted constants
|
44 | 25 |
|
45 | 26 | Returns:
|
46 |
| - OrderedDict: dict with constants attributes and values in the class |
| 27 | + dict: dict with constants attributes and values in the class |
47 | 28 | """
|
48 |
| - return OrderedDict( |
49 |
| - [(attr, value) for attr, value in vars(cls).items() if not callable(getattr(cls, attr)) and attr.isupper()]) |
| 29 | + return dict([(attr, value) for attr, value in vars(cls).items() |
| 30 | + if not callable(getattr(cls, attr)) and attr.isupper()]) |
50 | 31 |
|
51 | 32 |
|
52 |
| -def library_version(): |
| 33 | +def library_version() -> str: |
53 | 34 | """Return a version of this python library
|
54 | 35 | """
|
55 | 36 |
|
|
0 commit comments