Clean organization name for use as filename
(org_name)
| 27 | return False |
| 28 | |
| 29 | def clean_org_name(org_name): |
| 30 | """Clean organization name for use as filename""" |
| 31 | # Remove 'From ' prefix |
| 32 | if org_name.startswith('From '): |
| 33 | org_name = org_name[5:] |
| 34 | |
| 35 | # Replace problematic characters |
| 36 | org_name = org_name.replace('/', '_') |
| 37 | org_name = org_name.replace('\\', '_') |
| 38 | org_name = org_name.replace(':', '_') |
| 39 | org_name = org_name.replace('*', '_') |
| 40 | org_name = org_name.replace('?', '_') |
| 41 | org_name = org_name.replace('"', '_') |
| 42 | org_name = org_name.replace('<', '_') |
| 43 | org_name = org_name.replace('>', '_') |
| 44 | org_name = org_name.replace('|', '_') |
| 45 | org_name = org_name.strip() |
| 46 | |
| 47 | return org_name |
| 48 | |
| 49 | def clean_json_string(obj): |
| 50 | """Remove newlines from JSON string""" |
no outgoing calls
no test coverage detected