forked from indymedia/epicyon
Tidying
parent
9fb5eec345
commit
4cef99cb55
13
shares.py
13
shares.py
|
@ -23,12 +23,15 @@ def getValidSharedItemID(displayName: str) -> str:
|
||||||
"""Removes any invalid characters from the display name to
|
"""Removes any invalid characters from the display name to
|
||||||
produce an item ID
|
produce an item ID
|
||||||
"""
|
"""
|
||||||
displayName = displayName.replace(' ', '').replace('+', '-')
|
removeChars = (' ', '\n', '\r')
|
||||||
displayName = displayName.replace('/', '-').replace('\\', '-')
|
for ch in removeChars:
|
||||||
displayName = displayName.replace('.', '_').replace('?', '-')
|
displayName = displayName.replace(ch, '')
|
||||||
displayName = displayName.replace('\n', '').replace('\r', '')
|
removeChars2 = ('+', '/', '\\', '?', '&')
|
||||||
|
for ch in removeChars2:
|
||||||
|
displayName = displayName.replace(ch, '-')
|
||||||
|
displayName = displayName.replace('.', '_')
|
||||||
displayName = displayName.replace("’", "'")
|
displayName = displayName.replace("’", "'")
|
||||||
return displayName.replace('&', '-')
|
return displayName
|
||||||
|
|
||||||
|
|
||||||
def removeShare(baseDir: str, nickname: str, domain: str,
|
def removeShare(baseDir: str, nickname: str, domain: str,
|
||||||
|
|
Loading…
Reference in New Issue