Total Complexity | 11 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | # -*- coding: utf-8 -*- |
||
|
|||
2 | |||
3 | try: |
||
4 | import logging |
||
5 | import sys |
||
6 | import re |
||
7 | except ImportError as err: |
||
8 | logging.error('Error %s import module: %s', __name__, err) |
||
9 | logging.exception('Exception occurred') |
||
10 | |||
11 | sys.exit(128) |
||
12 | |||
13 | |||
14 | def compare_strings(string1, string2=''): |
||
15 | # New string |
||
16 | if (string1 is '' or string1 is None) and (string2 is not '' and string2 is not None): |
||
17 | return 'N' |
||
18 | # Deleted string |
||
19 | elif (string1 is not '' and string1 is not None) and (string2 is '' or string2 is None): |
||
20 | return 'D' |
||
21 | # Modified string |
||
22 | elif str(string1) != str(string2): |
||
23 | return 'M' |
||
24 | # Equal string |
||
25 | elif str(string1) == str(string2): |
||
26 | return 'E' |
||
27 |