MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / guess_mime

Function guess_mime

Scripts/ButSystem.py:3136–3150  ·  view source on GitHub ↗

guess_mime. Internal helper function. This docstring was added automatically to improve maintainability. Args: filename: Parameter. Returns: Varies.

(filename: str)

Source from the content-addressed store, hash-verified

3134 m: Parameter.
3135
3136Returns:
3137 Varies.
3138"""
3139 _msg_store.append(m.group(2))
3140 return m.group(1) + f"__MSG_{len(_msg_store)-1}__" + m.group(3)
3141 body = re.sub(r'(<span\s+class="msg-text"[^>]*>)([\s\S]*?)(</span>)', _msg_hold, body)
3142
3143
3144 # Protect brand/title/logo + special buttons from translation.
3145 # We protect by placeholdering the exact rendered text nodes.
3146 body = body.replace(">Theme<", ">__THEME_BTN__<")
3147 # Language toggle shows the *target* language:
3148 # English UI -> 'Ελληνικά'
3149 # Greek UI -> 'English'
3150 body = body.replace(">English<", ">__LANG_TARGET_EN__<")
3151 body = body.replace(">Ελληνικά<", ">__LANG_TARGET_EL__<")
3152 body = body.replace(">ButSystem<", ">__BRAND__<")
3153

Callers 14

list_dir_entriesFunction · 0.70
downloadFunction · 0.70
view_fileFunction · 0.70
dm_file_streamFunction · 0.70
discussion_file_streamFunction · 0.70
profiler_combineFunction · 0.70
_list_dir_entries_rawFunction · 0.70
admin_user_downloadFunction · 0.70
_upload_filename_mimeFunction · 0.70
_validate_report_uploadFunction · 0.70
_story_store_uploadFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected