Converts a regular string into one usuable in the add-on Parameters: string (str): string to be converted Returns: (str): converted string
(string: str)
| 46 | return f"\'{enum}\'" |
| 47 | |
| 48 | def str_to_py_str(string: str) -> str: |
| 49 | """ |
| 50 | Converts a regular string into one usuable in the add-on |
| 51 | |
| 52 | Parameters: |
| 53 | string (str): string to be converted |
| 54 | |
| 55 | Returns: |
| 56 | (str): converted string |
| 57 | """ |
| 58 | repr_str = repr(string) |
| 59 | if repr_str.startswith("'") and repr_str.endswith("'"): |
| 60 | repr_str = "\"" + repr_str[1:-1].replace('\"', '\\"') + "\"" |
| 61 | return repr_str |
| 62 | |
| 63 | def vec1_to_py_str(vec1) -> str: |
| 64 | """ |
no outgoing calls
no test coverage detected