Mercurial > kallithea
comparison pylons_app/lib/filters.py @ 260:6ada8c223374
made global funcion to clean repo names, and remove all special chars from the name.
Switched message slug into webhelpers function
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sun, 06 Jun 2010 21:54:54 +0200 |
parents | 3782a6d698af |
children |
comparison
equal
deleted
inserted
replaced
259:dee1913f7f5a | 260:6ada8c223374 |
---|---|
24 @author: marcink | 24 @author: marcink |
25 """ | 25 """ |
26 | 26 |
27 from mercurial import util | 27 from mercurial import util |
28 from mercurial.templatefilters import age as _age, person as _person | 28 from mercurial.templatefilters import age as _age, person as _person |
29 from string import punctuation | |
30 | |
31 def clean_repo(repo_name): | |
32 for x in punctuation: | |
33 if x != '_': | |
34 repo_name = repo_name.replace(x, '') | |
35 repo_name = repo_name.lower().strip() | |
36 return repo_name.replace(' ', '_') | |
37 | 29 |
38 age = lambda x:_age(x) | 30 age = lambda x:_age(x) |
39 capitalize = lambda x: x.capitalize() | 31 capitalize = lambda x: x.capitalize() |
40 date = lambda x: util.datestr(x) | 32 date = lambda x: util.datestr(x) |
41 email = util.email | 33 email = util.email |