MCPcopy Create free account
hub / github.com/Syncplay/syncplay / stripfilename

Function stripfilename

syncplay/utils.py:310–324  ·  view source on GitHub ↗
(filename, stripURL)

Source from the content-addressed store, hash-verified

308
309
310def stripfilename(filename, stripURL):
311 if filename:
312 try:
313 filename = filename
314 except UnicodeDecodeError:
315 pass
316 filename = urllib.parse.unquote(filename)
317 if stripURL:
318 try:
319 filename = urllib.parse.unquote(filename.split("/")[-1])
320 except UnicodeDecodeError:
321 filename = urllib.parse.unquote(filename.split("/")[-1])
322 return re.sub(constants.FILENAME_STRIP_REGEX, "", filename)
323 else:
324 return ""
325
326
327def stripRoomName(RoomName):

Callers 2

hashFilenameFunction · 0.85
sameFilenameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected