annotate pylons_app/lib/filters.py @ 83:db39d0ca5308

implemented Shortlog as seperate controller, filters rewrite. Little html fixes
author Marcin Kuzminski <marcin@python-blog.com>
date Sun, 18 Apr 2010 11:23:10 +0200
parents 928416088790
children 9f6300b96380
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
74
cdf4fda66dd9 Started summary page. Added filters to templates. used by n,self.f.filtername prefixed by n to disable other filters. Few other fixes found
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff changeset
1 from mercurial import util
83
db39d0ca5308 implemented Shortlog as seperate controller,
Marcin Kuzminski <marcin@python-blog.com>
parents: 80
diff changeset
2 from mercurial.templatefilters import age as _age, person as _person
74
cdf4fda66dd9 Started summary page. Added filters to templates. used by n,self.f.filtername prefixed by n to disable other filters. Few other fixes found
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff changeset
3
83
db39d0ca5308 implemented Shortlog as seperate controller,
Marcin Kuzminski <marcin@python-blog.com>
parents: 80
diff changeset
4 age = lambda x:_age(x)
74
cdf4fda66dd9 Started summary page. Added filters to templates. used by n,self.f.filtername prefixed by n to disable other filters. Few other fixes found
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff changeset
5 capitalize = lambda x: x.capitalize()
cdf4fda66dd9 Started summary page. Added filters to templates. used by n,self.f.filtername prefixed by n to disable other filters. Few other fixes found
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff changeset
6 date = lambda x: util.datestr(x)
cdf4fda66dd9 Started summary page. Added filters to templates. used by n,self.f.filtername prefixed by n to disable other filters. Few other fixes found
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff changeset
7 email = util.email
83
db39d0ca5308 implemented Shortlog as seperate controller,
Marcin Kuzminski <marcin@python-blog.com>
parents: 80
diff changeset
8 person = lambda x: _person(x)
db39d0ca5308 implemented Shortlog as seperate controller,
Marcin Kuzminski <marcin@python-blog.com>
parents: 80
diff changeset
9 hgdate = lambda x: "%d %d" % x
db39d0ca5308 implemented Shortlog as seperate controller,
Marcin Kuzminski <marcin@python-blog.com>
parents: 80
diff changeset
10 isodate = lambda x: util.datestr(x, '%Y-%m-%d %H:%M %1%2')
db39d0ca5308 implemented Shortlog as seperate controller,
Marcin Kuzminski <marcin@python-blog.com>
parents: 80
diff changeset
11 isodatesec = lambda x: util.datestr(x, '%Y-%m-%d %H:%M:%S %1%2')
db39d0ca5308 implemented Shortlog as seperate controller,
Marcin Kuzminski <marcin@python-blog.com>
parents: 80
diff changeset
12 localdate = lambda x: (x[0], util.makedate()[1])
db39d0ca5308 implemented Shortlog as seperate controller,
Marcin Kuzminski <marcin@python-blog.com>
parents: 80
diff changeset
13 rfc822date = lambda x: util.datestr(x, "%a, %d %b %Y %H:%M:%S %1%2")
db39d0ca5308 implemented Shortlog as seperate controller,
Marcin Kuzminski <marcin@python-blog.com>
parents: 80
diff changeset
14 rfc3339date = lambda x: util.datestr(x, "%Y-%m-%dT%H:%M:%S%1:%2")
db39d0ca5308 implemented Shortlog as seperate controller,
Marcin Kuzminski <marcin@python-blog.com>
parents: 80
diff changeset
15 time_ago = lambda x: util.datestr(_age(x), "%a, %d %b %Y %H:%M:%S %1%2")