Mercurial > kallithea
comparison 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 |
comparison
equal
deleted
inserted
replaced
3017:eaa36a2497a9 | 3018:023f7873ef59 |
---|---|
277 return unicode_.encode(to_encoding[0], 'replace') | 277 return unicode_.encode(to_encoding[0], 'replace') |
278 | 278 |
279 return safe_str | 279 return safe_str |
280 | 280 |
281 | 281 |
282 def remove_suffix(s, suffix): | |
283 if s.endswith(suffix): | |
284 s = s[:-1 * len(suffix)] | |
285 return s | |
286 | |
287 | |
288 def remove_prefix(s, prefix): | |
289 if s.startswith(prefix): | |
290 s = s[:-1 * len(prefix)] | |
291 return s | |
292 | |
293 | |
282 def engine_from_config(configuration, prefix='sqlalchemy.', **kwargs): | 294 def engine_from_config(configuration, prefix='sqlalchemy.', **kwargs): |
283 """ | 295 """ |
284 Custom engine_from_config functions that makes sure we use NullPool for | 296 Custom engine_from_config functions that makes sure we use NullPool for |
285 file based sqlite databases. This prevents errors on sqlite. This only | 297 file based sqlite databases. This prevents errors on sqlite. This only |
286 applies to sqlalchemy versions < 0.7.0 | 298 applies to sqlalchemy versions < 0.7.0 |