Change hash tag. Thumbs on albums.

This commit is contained in:
Jason A. Donenfeld
2011-05-06 18:55:02 -04:00
parent 88a790e0a2
commit 039f009a15
3 changed files with 75 additions and 9 deletions

View File

@ -14,7 +14,11 @@ def trim_base_custom(path, base):
def trim_base(path):
return trim_base_custom(path, trim_base.base)
def cache_base(path):
path = trim_base(path).replace('/', '-').replace(' ', '_')
path = trim_base(path).replace('/', '-').replace(' ', '_').replace('(', '').replace(')', '').replace('#', '').replace('[', '').replace(']', '').replace('"', '').replace("'", '').replace('_-_', '-').lower()
while path.find("--") != -1:
path = path.replace("--", "-")
while path.find("__") != -1:
path = path.replace("__", "_")
if len(path) == 0:
path = "root"
return path