Conditions | 2 |
Total Lines | 12 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 0 |
1 | #!/usr/bin/python |
||
29 | 1 | @staticmethod |
|
30 | 1 | def unicode_translate(text, chars="", replacement="") -> str: |
|
31 | """Replacement for the string.maketrans function |
||
32 | |||
33 | :type text: str |
||
34 | :type chars: str |
||
35 | :type replacement: str |
||
36 | :return: |
||
37 | """ |
||
38 | 1 | for char in chars: |
|
39 | 1 | text = text.replace(char, replacement[chars.index(char)]) |
|
40 | 1 | return text |
|
41 | |||
57 |