Kevin Chan avatar Kevin Chan committed 81953cb

Added missing imports (from garage.html_utils import strip_tags, unescape).

Comments (0)

Files changed (1)

garage/slugify.py

 Functions to create slugs.
 
 * created: 2011-02-15 Kevin Chan <kefin@makedostudio.com>
-* updated: 2013-01-05 kchan
+* updated: 2013-01-12 kchan
 """
 
 import re
 from django.core.exceptions import ValidationError
 
 from garage import get_setting
-
+from garage.html_utils import strip_tags, unescape
 
 
 # general slugify function
     """Strip accents from string and return ascii version."""
     return normalize('NFKD', unicode(s)).encode('ASCII', 'ignore')
 
-# def slugify(s, delete_chars=SlugDeleteChars):
-#     """Slugify string."""
-#     from garage.utils import trim
-#     from garage.html_utils import strip_html, unescape
-#     s = s.strip("\r\n")
-#     s = s.replace("\n", " ")
-#     s = trim(s)
-#     s = strip_html(strip_accents(unescape(s)))
-#     s = s.replace("–", "-")
-#     s = s.replace("—", "-")
-#     s = s.replace("&amp;", " and ")
-#     s = s.replace("&", " and ")
-#     s = re.sub(r'([0-9]+)%', '\\1-percent', s)
-#     s = s.translate(string.maketrans(' _','--'), delete_chars).lower()
-#     s = re.sub(r'--+', '-', s)
-#     s = s.strip('-')
-#     return s
-
 
 def slugify(s, delete_chars=SlugDeleteChars, subst_char=SubstChar):
     """
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.