[ckan-changes] commit/ckan: 4 new changesets

Bitbucket commits-noreply at bitbucket.org
Thu Jun 23 07:43:03 UTC 2011


4 new changesets in ckan:

http://bitbucket.org/okfn/ckan/changeset/cf85b4f6ff65/
changeset:   cf85b4f6ff65
user:        rgrp
date:        2011-06-17 17:16:24
summary:     [doc/kforge][xs]: remove kforge index page (long irrelevant).
affected #:  1 file (0 bytes)

--- a/doc/kforge/index.html	Fri Jun 17 15:18:23 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<html>
-  <head>
-    <title>CKAN - Comprehensive Knowledge Archive Network</title>
-    <link rel="stylesheet" href="http://m.okfn.org/okftext/css/okftext/text_basic.css" type="text/css" media="screen" charset="utf-8">
-    <meta http-equiv="REFRESH" content="0;url=/ckan/trac">
-  </head>
-  <body>
-    <h1>
-      CKAN
-    </h1>
-    <p>Redirecting to CKAN project homepage: <a href="http://knowledgeforge.net/ckan/trac/">http://knowledgeforge.net/ckan/trac/</a></p>
-  </body>
-</html>
-


http://bitbucket.org/okfn/ckan/changeset/5ef42f04caed/
changeset:   5ef42f04caed
user:        rgrp
date:        2011-06-23 09:21:54
summary:     [controllers/user][xs]: crude spam filter for user registration.
affected #:  1 file (264 bytes)

--- a/ckan/controllers/user.py	Fri Jun 17 16:16:24 2011 +0100
+++ b/ckan/controllers/user.py	Thu Jun 23 08:21:54 2011 +0100
@@ -138,7 +138,12 @@
             c.user_email = request.params.getone('email')
         elif 'save' in request.params:
             try:
-                user.about = request.params.getone('about')
+                about = request.params.getone('about')
+                if 'http://' in about:
+                    msg = 'Edit not allowed as looks like spam. Please avoid links in your description'
+                    h.flash_error(msg)
+                    return render('user/edit.html')
+                user.about = about
                 user.fullname = request.params.getone('fullname')
                 user.email = request.params.getone('email')
                 try:


http://bitbucket.org/okfn/ckan/changeset/cf55d65b7d4a/
changeset:   cf55d65b7d4a
user:        rgrp
date:        2011-06-23 09:33:18
summary:     [doc,refactor][s]: remove design.rst as now at http://wiki.ckan.net/Design_and_Architecture.
affected #:  2 files (10 bytes)

--- a/doc/design.rst	Thu Jun 23 08:21:54 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-===========
-CKAN Design
-===========
-
-Overview
-========
-
-As a system CKAN functions as a synthesis of several different services:
-
-.. image:: ckan-features.png
-  :alt: CKAN Features
-
-CKAN is part of a larger set of tools and services designed to enable automated
-use and reuse of content and data:
-
-.. image:: ckan-vision.png
-  :alt: The Debian of Data Services Stack
-
-Architecture
-============
-
-The key entity in CKAN is a Package. The data model for a package is pretty
-much what you see on: http://www.ckan.net/package/new
-
-This in turn is heavily based on the kind of packaging information provided for
-software but with some modifications. One of our aims is to keep things simple
-and as generic as possible as we have data from a lot of different domains.
-Thus we've tried to keep the core metadata pretty restricted but allow for
-additional info either via tags or via "extra" arbitrary key/value fields. So
-very roughly:
-
- * unique name
- * title
- * url + download url
- * author/maintainer info
- * license
- * notes
- * tags
- * [extendable with "extra" fields]
-
-All, the code is open-source and if you want to see the actual
-model definitions in code see here (probably start with core.py):
-
-<https://bitbucket.org/okfn/ckan/src/default/ckan/model/>
-
-One thing to note here is that all changes to package data are versioned in a
-wiki-like manner. This gives us a lot of flexibility in how we manage access to
-the system (as well as providing features like change logging for free!).
-
-The rdfizing code can be found here:
-
-<https://bitbucket.org/okfn/ckan/src/default/ckan/lib/rdf.py>
-


--- a/doc/index.rst	Thu Jun 23 08:21:54 2011 +0100
+++ b/doc/index.rst	Thu Jun 23 08:33:18 2011 +0100
@@ -11,7 +11,6 @@
    :maxdepth: 2
 
    README
-   design
    deployment
    configuration
    paster


http://bitbucket.org/okfn/ckan/changeset/42426157baa5/
changeset:   42426157baa5
user:        rgrp
date:        2011-06-23 09:42:20
summary:     [merge][xs]: trivial merge to bring default back to a single head (I forgot to push some of my doc changes the other day!).
affected #:  11 files (1.1 KB)

--- a/ckan/config/deployment.ini_tmpl	Thu Jun 23 08:33:18 2011 +0100
+++ b/ckan/config/deployment.ini_tmpl	Thu Jun 23 08:42:20 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
 


--- a/ckan/config/environment.py	Thu Jun 23 08:33:18 2011 +0100
+++ b/ckan/config/environment.py	Thu Jun 23 08:42:20 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/forms/common.py	Thu Jun 23 08:33:18 2011 +0100
+++ b/ckan/forms/common.py	Thu Jun 23 08:42:20 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
@@ -402,14 +405,14 @@
 
         def _serialized_value(self):
             package = self.field.parent.model
-            params = dict(self.params)
+            params = self.params
             new_resources = []
             rest_key = self.name
 
             # REST param format
             # e.g. 'Package-1-resources': [{u'url':u'http://ww...
-            if params.has_key(rest_key) and isinstance(params[rest_key], (list, tuple)):
-                new_resources = params[rest_key][:] # copy, so don't edit orig
+            if params.has_key(rest_key) and any(params.getall(rest_key)):
+                new_resources = params.getall(rest_key)[:] # copy, so don't edit orig
 
             # formalchemy form param format
             # e.g. 'Package-1-resources-0-url': u'http://ww...'
@@ -623,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':
@@ -639,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	Thu Jun 23 08:33:18 2011 +0100
+++ b/ckan/model/authorization_group.py	Thu Jun 23 08:42:20 2011 +0100
@@ -1,4 +1,4 @@
-from datetime import datetime
+import datetime
 
 from meta import *
 from core import DomainObject
@@ -8,7 +8,7 @@
 authorization_group_table = Table('authorization_group', metadata,
     Column('id', UnicodeText, primary_key=True, default=make_uuid),
     Column('name', UnicodeText),
-    Column('created', DateTime, default=datetime.now),
+    Column('created', DateTime, default=datetime.datetime.now),
     )
 
 authorization_group_user_table = Table('authorization_group_user', metadata,


--- a/ckan/model/group.py	Thu Jun 23 08:33:18 2011 +0100
+++ b/ckan/model/group.py	Thu Jun 23 08:42:20 2011 +0100
@@ -1,4 +1,4 @@
-from datetime import datetime
+import datetime
 
 from meta import *
 from core import *
@@ -26,7 +26,7 @@
     Column('name', UnicodeText, nullable=False, unique=True),
     Column('title', UnicodeText),
     Column('description', UnicodeText),
-    Column('created', DateTime, default=datetime.now),
+    Column('created', DateTime, default=datetime.datetime.now),
     )
 
 vdm.sqlalchemy.make_table_stateful(group_table)


--- a/ckan/model/rating.py	Thu Jun 23 08:33:18 2011 +0100
+++ b/ckan/model/rating.py	Thu Jun 23 08:42:20 2011 +0100
@@ -1,4 +1,4 @@
-from datetime import datetime
+import datetime
 
 from meta import *
 from core import *
@@ -14,7 +14,7 @@
                      Column('user_ip_address', UnicodeText), # alternative to user_id if not logged in
                      Column('package_id', UnicodeText, ForeignKey('package.id')),
                      Column('rating', Float),
-                     Column('created', DateTime, default=datetime.now),
+                     Column('created', DateTime, default=datetime.datetime.now),
                      )
 
 class Rating(DomainObject):


--- a/ckan/model/user.py	Thu Jun 23 08:33:18 2011 +0100
+++ b/ckan/model/user.py	Thu Jun 23 08:42:20 2011 +0100
@@ -1,4 +1,4 @@
-from datetime import datetime
+import datetime
 import re
 import os
 from hashlib import sha1
@@ -17,7 +17,7 @@
         Column('fullname', UnicodeText),
         Column('email', UnicodeText),
         Column('apikey', UnicodeText, default=make_uuid),
-        Column('created', DateTime, default=datetime.now),
+        Column('created', DateTime, default=datetime.datetime.now),
         Column('about', UnicodeText),
         )
 


--- a/ckan/public/css/style.css	Thu Jun 23 08:33:18 2011 +0100
+++ b/ckan/public/css/style.css	Thu Jun 23 08:42:20 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	Thu Jun 23 08:33:18 2011 +0100
+++ b/doc/configuration.rst	Thu Jun 23 08:42:20 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.


--- a/test-core.ini	Thu Jun 23 08:33:18 2011 +0100
+++ b/test-core.ini	Thu Jun 23 08:42:20 2011 +0100
@@ -22,7 +22,7 @@
 ckan.site_title = CKAN
 ckan.site_logo = /images/ckan_logo_fullname_long.png
 package_form = standard
-ckan.plugins =
+ckan.plugins = synchronous_search
 licenses_group_url = 
 # pyamqplib or queue
 carrot_messaging_library = queue


--- a/test.ini	Thu Jun 23 08:33:18 2011 +0100
+++ b/test.ini	Thu Jun 23 08:42:20 2011 +0100
@@ -22,6 +22,7 @@
 # run fast.
 faster_db_test_hacks = True
 sqlalchemy.url = sqlite:///
+ckan.plugins = 
 # NB: other test configuration should go in test-core.ini, which is
 #     what the postgres tests use.

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