Mercurial > hg > lxmldump
comparison lxmldump.py @ 26:420f13925f20
Rename a variable.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 25 May 2021 11:39:36 +0300 |
parents | 8a6738f67106 |
children | d77ab8a300b1 |
comparison
equal
deleted
inserted
replaced
25:8a6738f67106 | 26:420f13925f20 |
---|---|
87 print(u"\nQuitting due to SIGINT / Ctrl+C!") | 87 print(u"\nQuitting due to SIGINT / Ctrl+C!") |
88 sys.exit(1) | 88 sys.exit(1) |
89 | 89 |
90 | 90 |
91 ## Annotate string | 91 ## Annotate string |
92 def pkk_str_annotate(mtag, mtext): | 92 def pkk_str_annotate(mtag, mstr): |
93 if pkk_cfg.annotate and mtag in pkk_element_annotation_map: | 93 if pkk_cfg.annotate and mtag in pkk_element_annotation_map: |
94 if pkk_cfg.mode in pkk_element_annotation_map[mtag]: | 94 if pkk_cfg.mode in pkk_element_annotation_map[mtag]: |
95 mmode = pkk_cfg.mode | 95 mmode = pkk_cfg.mode |
96 else: | 96 else: |
97 mmode = PKK_MODE_NORMAL | 97 mmode = PKK_MODE_NORMAL |
98 | 98 |
99 return pkk_element_annotation_map[mtag][mmode][0] + mtext + pkk_element_annotation_map[mtag][mmode][1] | 99 return pkk_element_annotation_map[mtag][mmode][0] + mstr + pkk_element_annotation_map[mtag][mmode][1] |
100 else: | 100 else: |
101 return mtext | 101 return mstr |
102 | 102 |
103 | 103 |
104 ## Clean string by removing tabs and newlines | 104 ## Clean string by removing tabs and newlines |
105 def pkk_str_clean(mstr): | 105 def pkk_str_clean(mstr): |
106 return re.sub(r'[\n\r\t]', '', mstr) | 106 return re.sub(r'[\n\r\t]', '', mstr) |