[ckan-changes] commit/ckan: kindly: [merge] with 1.4.1
Bitbucket
commits-noreply at bitbucket.org
Wed Jun 22 22:11:32 UTC 2011
1 new changeset in ckan:
http://bitbucket.org/okfn/ckan/changeset/99fceab78481/
changeset: 99fceab78481
branch: feature-1141-moderated-edits-ajax
user: kindly
date: 2011-06-23 00:06:19
summary: [merge] with 1.4.1
affected #: 13 files (1.4 KB)
--- a/ckan/config/deployment.ini_tmpl Wed Jun 22 21:54:40 2011 +0100
+++ b/ckan/config/deployment.ini_tmpl Wed Jun 22 23:06:19 2011 +0100
@@ -99,7 +99,7 @@
## extra places to look for templates and public files (comma separated lists)
## any templates/files found will override correspondingly named ones in
## ckan/templates/ and ckan/public
-## (e.g. to override main layout template layout.html or add in css/extra.css)
+## (e.g. to override main layout template layout.html or add extra css files)
# extra_template_paths = %(here)s/my-templates
# extra_public_paths = %(here)s/my-public
@@ -152,12 +152,13 @@
## NB: can have multiline strings just indent following lines
# ckan.template_footer_end =
+# These three settings (ckan.log_dir, ckan.dump_dir and ckan.backup_dir) are
+# all used in cron jobs, not in CKAN itself. CKAN logging is configured
+# in the logging configuration below
# Directory for logs (produced by cron scripts associated with ckan)
ckan.log_dir = %(here)s/log
-
# Directory for JSON/CSV dumps (must match setting in apache config)
ckan.dump_dir = %(here)s/dump
-
# Directory for SQL database backups
ckan.backup_dir = %(here)s/backup
@@ -203,7 +204,7 @@
class = logging.handlers.RotatingFileHandler
formatter = generic
level = NOTSET
-args = ('%(here)s/ckan.log', 'a', 2e7, 9)
+args = ("ckan.log", "a", 20000000, 9)
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s] %(message)s
--- a/ckan/config/environment.py Wed Jun 22 21:54:40 2011 +0100
+++ b/ckan/config/environment.py Wed Jun 22 23:06:19 2011 +0100
@@ -1,6 +1,7 @@
"""Pylons environment configuration"""
import os
from urlparse import urlparse
+import logging
from paste.deploy.converters import asbool
@@ -88,6 +89,11 @@
def template_loaded(template):
translator.setup(template)
+ # Markdown ignores the logger config, so to get rid of excessive
+ # markdown debug messages in the log, set it to the level of the
+ # root logger.
+ logging.getLogger("MARKDOWN").setLevel(logging.getLogger().level)
+
# Create the Genshi TemplateLoader
# config['pylons.app_globals'].genshi_loader = TemplateLoader(
# paths['templates'], auto_reload=True)
--- a/ckan/controllers/user.py Wed Jun 22 21:54:40 2011 +0100
+++ b/ckan/controllers/user.py Wed Jun 22 23:06:19 2011 +0100
@@ -77,10 +77,13 @@
def register(self):
if not self.authorizer.am_authorized(c, model.Action.USER_CREATE, model.System):
abort(401, _('Not authorized to see this page'))
- if request.method == 'POST':
- c.login = request.params.getone('login')
- c.fullname = request.params.getone('fullname')
- c.email = request.params.getone('email')
+ if request.method == 'POST':
+ try:
+ c.login = request.params.getone('login')
+ c.fullname = request.params.getone('fullname')
+ c.email = request.params.getone('email')
+ except KeyError, e:
+ abort(401, _('Missing parameter: %r') % e)
if not c.login:
h.flash_error(_("Please enter a login name."))
return render("user/register.html")
--- a/ckan/forms/common.py Wed Jun 22 21:54:40 2011 +0100
+++ b/ckan/forms/common.py Wed Jun 22 23:06:19 2011 +0100
@@ -1,4 +1,5 @@
import re
+import logging
from formalchemy import helpers as fa_h
import formalchemy
@@ -14,6 +15,8 @@
import ckan.lib.field_types as field_types
import ckan.misc
+log = logging.getLogger(__name__)
+
name_match = re.compile('[a-z0-9_\-]*$')
def name_validator(val, field=None):
# check basic textual rules
@@ -337,7 +340,6 @@
def resource_validator(self, val, field=None):
resources_data = val
- print resources_data
assert isinstance(resources_data, list)
not_nothing_regex = re.compile('\S')
errormsg = _('Package resource(s) incomplete.')
@@ -624,7 +626,7 @@
elif key_parts[2].startswith('newfield'):
newfield_match = self.newfield_re.match(key_parts[2])
if not newfield_match:
- print 'Warning: did not parse newfield correctly: ', key_parts
+ log.warn('Did not parse newfield correctly: %r', key_parts)
continue
new_field_index, key_or_value = newfield_match.groups()
if key_or_value == 'key':
@@ -640,7 +642,7 @@
if not self.params.has_key(key_key):
extra_fields.append(('', value))
else:
- print 'Warning: expected key or value for newfield: ', key
+ log.warn('Expected key or value for newfield: %r' % key)
elif key_parts[2].endswith('-checkbox'):
continue
else:
--- a/ckan/model/authorization_group.py Wed Jun 22 21:54:40 2011 +0100
+++ b/ckan/model/authorization_group.py Wed Jun 22 23:06:19 2011 +0100
@@ -1,4 +1,4 @@
-from datetime import datetime
+import datetime
from meta import *
from core import DomainObject
--- a/ckan/model/group.py Wed Jun 22 21:54:40 2011 +0100
+++ b/ckan/model/group.py Wed Jun 22 23:06:19 2011 +0100
@@ -1,5 +1,3 @@
-from datetime import datetime
-
from meta import *
from core import *
from sqlalchemy.orm import eagerload_all
--- a/ckan/model/rating.py Wed Jun 22 21:54:40 2011 +0100
+++ b/ckan/model/rating.py Wed Jun 22 23:06:19 2011 +0100
@@ -1,5 +1,3 @@
-from datetime import datetime
-
from meta import *
from core import *
from package import *
--- a/ckan/model/user.py Wed Jun 22 21:54:40 2011 +0100
+++ b/ckan/model/user.py Wed Jun 22 23:06:19 2011 +0100
@@ -1,4 +1,4 @@
-from datetime import datetime
+import datetime
import re
import os
from hashlib import sha1
--- a/ckan/public/css/style.css Wed Jun 22 21:54:40 2011 +0100
+++ b/ckan/public/css/style.css Wed Jun 22 23:06:19 2011 +0100
@@ -4,4 +4,3 @@
@import url(buttons.css);
@import url(stars.css);
@import url(tabs.css);
- at import url(extra.css);
--- a/doc/configuration.rst Wed Jun 22 21:54:40 2011 +0100
+++ b/doc/configuration.rst Wed Jun 22 23:06:19 2011 +0100
@@ -376,3 +376,33 @@
ckan.dumps_format = CSV/JSON
If there is a page which allows you to download a dump of the entire catalogue then specify the URL and the format here, so that it can be advertised in the web interface. The dumps_format is just a string for display.
+
+
+log_dir
+-------
+
+Example::
+
+ ckan.log_dir = /var/log/ckan/
+
+This is a directory where CKAN cron scripts (if there are any installed) should write log files to. Note: this setting is nothing to do with the main CKAN log file, whose filepath is set in the [handler_file] args.
+
+
+dump_dir
+--------
+
+Example::
+
+ ckan.dump_dir = /var/lib/ckan/dump/
+
+This is a directory where JSON or CSV dumps of the database are to be written, assuming a script has been installed to do this. Note it is usual to setup the apache config to serve this directory.
+
+
+backup_dir
+----------
+
+Example::
+
+ ckan.backup_dir = /var/backup/ckan/
+
+This is a directory where SQL database backups are to be written, assuming a script has been installed to do this.
Repository URL: https://bitbucket.org/okfn/ckan/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the ckan-changes
mailing list