Mercurial > kallithea
diff rhodecode/lib/utils2.py @ 3018:023f7873ef59 beta
added caching layer into RSS/ATOM feeds
- updated code for new LimitedDiffContainers
- invalidate rss/atom cache keys on push
-
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Fri, 23 Nov 2012 11:54:14 +0100 |
parents | 6e76b4892d72 |
children | 6104dfd35b16 |
line wrap: on
line diff
--- a/rhodecode/lib/utils2.py Thu Nov 22 23:04:34 2012 +0100 +++ b/rhodecode/lib/utils2.py Fri Nov 23 11:54:14 2012 +0100 @@ -279,6 +279,18 @@ return safe_str +def remove_suffix(s, suffix): + if s.endswith(suffix): + s = s[:-1 * len(suffix)] + return s + + +def remove_prefix(s, prefix): + if s.startswith(prefix): + s = s[:-1 * len(prefix)] + return s + + def engine_from_config(configuration, prefix='sqlalchemy.', **kwargs): """ Custom engine_from_config functions that makes sure we use NullPool for