Skip to content

Commit

Permalink
Merge branch 'master' of github.com:okfn/ckan
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Hammond committed May 28, 2012
2 parents 3b96c33 + 2c959a3 commit 773d4e1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
8 changes: 3 additions & 5 deletions ckan/lib/helpers.py
Expand Up @@ -25,7 +25,6 @@
from routes import redirect_to as _redirect_to
from routes import url_for as _routes_default_url_for
from alphabet_paginate import AlphaPage
from lxml.html import fromstring
import i18n
import ckan.exceptions
from pylons import request
Expand Down Expand Up @@ -470,8 +469,7 @@ def group_name_to_title(name):
def markdown_extract(text, extract_length=190):
if (text is None) or (text.strip() == ''):
return ''
html = fromstring(markdown(text))
plain = html.xpath("string()")
plain = re.sub(r'<.*?>', '', markdown(text))
return unicode(truncate(plain, length=extract_length, indicator='...', whole_word=True))

def icon_url(name):
Expand Down Expand Up @@ -634,7 +632,7 @@ def parse_rfc_2822_date(date_str, assume_utc=True):
RFC 2822 is the date format used in HTTP headers. It should contain timezone
information, but that cannot be relied upon.
If date_str doesn't contain timezone information, then the 'assume_utc' flag
determines whether we assume this string is local (with respect to the
server running this code), or UTC. In practice, what this means is that if
Expand All @@ -643,7 +641,7 @@ def parse_rfc_2822_date(date_str, assume_utc=True):
If timezone information is available in date_str, then the returned datetime
is 'aware', ie - it has an associated tz_info object.
Returns None if the string cannot be parsed as a valid datetime.
"""
time_tuple = email.utils.parsedate_tz(date_str)
Expand Down
7 changes: 3 additions & 4 deletions ckan/lib/search/__init__.py
Expand Up @@ -261,13 +261,12 @@ def check_solr_schema_version(schema_file=None):
url = 'file://%s' % schema_file
res = urllib2.urlopen(url)

from lxml import etree
tree = etree.fromstring(res.read())
import xml.dom.minidom
tree = xml.dom.minidom.parseString(res.read())

version = tree.xpath('//schema/@version')
version = tree.documentElement.getAttribute('version')
if not len(version):
raise SearchError('Could not extract version info from the SOLR schema, using file: \n%s' % url)
version = version[0]

if not version in SUPPORTED_SCHEMA_VERSIONS:
raise SearchError('SOLR schema version not supported: %s. Supported versions are [%s]'
Expand Down
5 changes: 1 addition & 4 deletions doc/install-from-source.rst
Expand Up @@ -125,7 +125,7 @@ WebOb has to be installed explicitly afterwards because by installing pylons wit

Now to install the remaining dependencies in requires/lucid_present.txt and you are using Ubuntu Lucid 10.04 you can install the system versions::

sudo apt-get install python-pybabel python-psycopg2 python-lxml
sudo apt-get install python-pybabel python-psycopg2
sudo apt-get install python-pylons python-repoze.who
sudo apt-get install python-repoze.who-plugins python-tempita python-zope.interface
Expand All @@ -135,9 +135,6 @@ Alternatively, if you are not using Ubuntu Lucid 10.04 you'll need to install th

pip install --ignore-installed -r pyenv/src/ckan/requires/lucid_present.txt

This will take a **long** time. Particularly the install of the ``lxml``
package.

At this point you will need to deactivate and then re-activate your
virtual environment to ensure that all the scripts point to the correct
locations:
Expand Down
3 changes: 1 addition & 2 deletions requires/lucid_present.txt
Expand Up @@ -2,13 +2,12 @@
# apt-get if you are on that platform. If you are using a different platform
# you can install these dependencies via pip instead.
#
# sudo apt-get install python-pybabel python-psycopg2 python-lxml
# sudo apt-get install python-pybabel python-psycopg2
# sudo apt-get install python-pylons python-repoze.who
# sudo apt-get install python-repoze.who-plugins python-tempita python-zope.interface

babel==0.9.4
psycopg2==2.0.13
lxml==2.2.4
# Specifying particular version of WebOb because later version has incompatibility
# with pylons 0.9.7 (change to imports of Multidict)
webob==1.0.8
Expand Down

0 comments on commit 773d4e1

Please sign in to comment.