Skip to content

Commit

Permalink
Merge branch 'master' into feature-1788-browser-compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
teajaymars committed Mar 30, 2012
2 parents c2b1089 + a89bba5 commit 25a9a44
Show file tree
Hide file tree
Showing 75 changed files with 30,029 additions and 13,638 deletions.
34 changes: 34 additions & 0 deletions bin/running_stats.py
@@ -1,3 +1,37 @@
'''Tool for a script to keep track changes performed on a large number
of objects.
StatsCount - when you are counting incidences of a small set of outcomes
StatsList - when you also want to remember an ID associated with each incidence
Examples:
from running_stats import StatsCount
package_stats = StatsCount()
for package in packages:
if package.enabled:
package.delete()
package_stats.increment('deleted')
else:
package_stats.increment('not deleted')
print package_stats.report()
> deleted: 30
> not deleted: 70
from running_stats import StatsList
package_stats = StatsList()
for package in packages:
if package.enabled:
package.delete()
package_stats.add('deleted', package.name)
else:
package_stats.add('not deleted' package.name)
print package_stats.report()
> deleted: 30 pollution-uk, flood-regions, river-quality, ...
> not deleted: 70 spending-bristol, ...
'''

import copy

class StatsCount(dict):
Expand Down
9 changes: 7 additions & 2 deletions ckan/config/environment.py
Expand Up @@ -17,9 +17,10 @@
from pylons.i18n.translation import ugettext
from genshi.template import TemplateLoader
from genshi.filters.i18n import Translator
from paste.deploy.converters import asbool

import ckan.lib.app_globals as app_globals
import ckan.lib.helpers
import ckan.lib.helpers as h
from ckan.config.routing import make_map
from ckan import model
from ckan import plugins
Expand Down Expand Up @@ -97,7 +98,11 @@ def find_controller(self, controller):

config['routes.map'] = make_map()
config['pylons.app_globals'] = app_globals.Globals()
config['pylons.h'] = ckan.lib.helpers
if asbool(config.get('ckan.restrict_template_vars', 'false')):
import ckan.lib.helpers_clean
config['pylons.h'] = ckan.lib.helpers_clean
else:
config['pylons.h'] = h

## redo template setup to use genshi.search_path (so remove std template setup)
template_paths = [paths['templates'][0]]
Expand Down
Binary file modified ckan/i18n/bg/LC_MESSAGES/ckan.mo
Binary file not shown.

0 comments on commit 25a9a44

Please sign in to comment.