Mercurial > kallithea
view pylons_app/lib/filters.py @ 211:a3a7c3e03b76 rhodecode-0.0.0.7.3
version bump. Bugfix when changelog parameter was not an int. Added limit for 100 changelogs to view at once.
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Mon, 24 May 2010 00:58:26 +0200 |
parents | 9f6300b96380 |
children | 3782a6d698af |
line wrap: on
line source
from mercurial import util from mercurial.templatefilters import age as _age, person as _person from string import punctuation def clean_repo(repo_name): for x in punctuation: if x != '_': repo_name = repo_name.replace(x, '') repo_name = repo_name.lower().strip() return repo_name.replace(' ', '_') age = lambda x:_age(x) capitalize = lambda x: x.capitalize() date = lambda x: util.datestr(x) email = util.email person = lambda x: _person(x) hgdate = lambda x: "%d %d" % x isodate = lambda x: util.datestr(x, '%Y-%m-%d %H:%M %1%2') isodatesec = lambda x: util.datestr(x, '%Y-%m-%d %H:%M:%S %1%2') localdate = lambda x: (x[0], util.makedate()[1]) rfc822date = lambda x: util.datestr(x, "%a, %d %b %Y %H:%M:%S %1%2") rfc3339date = lambda x: util.datestr(x, "%Y-%m-%dT%H:%M:%S%1:%2") time_ago = lambda x: util.datestr(_age(x), "%a, %d %b %Y %H:%M:%S %1%2")