--- a/buildout.cfg Mon Dec 03 10:27:22 2018 +0100
+++ b/buildout.cfg Fri Dec 07 13:53:52 2018 +0100
@@ -96,4 +96,4 @@
eggs = pyams_utils [test]
[versions]
-pyams_utils = 0.1.24
+pyams_utils = 0.1.24.1
--- a/docs/HISTORY.txt Mon Dec 03 10:27:22 2018 +0100
+++ b/docs/HISTORY.txt Fri Dec 07 13:53:52 2018 +0100
@@ -1,6 +1,10 @@
Changelog
=========
+0.1.24.1
+--------
+ - added 'order' attribute to INode interface
+
0.1.24
------
- added Pygments utilities
--- a/setup.py Mon Dec 03 10:27:22 2018 +0100
+++ b/setup.py Fri Dec 07 13:53:52 2018 +0100
@@ -25,7 +25,7 @@
README = os.path.join(DOCS, 'README.txt')
HISTORY = os.path.join(DOCS, 'HISTORY.txt')
-version = '0.1.24'
+version = '0.1.24.1'
long_description = open(README).read() + '\n\n' + open(HISTORY).read()
tests_require = [
--- a/src/pyams_utils/context.py Mon Dec 03 10:27:22 2018 +0100
+++ b/src/pyams_utils/context.py Fri Dec 07 13:53:52 2018 +0100
@@ -24,7 +24,7 @@
"""Interface based context selector
This selector can be used as a subscriber predicate to define
- an interface that the context must support for the event to be applied:
+ an interface that the context must support for the event to be applied::
.. code-block:: python
--- a/src/pyams_utils/url.py Mon Dec 03 10:27:22 2018 +0100
+++ b/src/pyams_utils/url.py Fri Dec 07 13:53:52 2018 +0100
@@ -12,9 +12,6 @@
__docformat__ = 'restructuredtext'
-
-# import standard library
-
from pyramid.encode import url_quote, urlencode
from pyramid.url import QUERY_SAFE, resource_url
from zope.interface import Interface
@@ -25,13 +22,13 @@
from pyams_utils.unicode import translate_string
-def generate_url(title):
+def generate_url(title, min_word_length=2):
"""Generate an SEO-friendly content URL from it's title
The original title is translated to remove accents, converted to lowercase, and words
shorter than three characters are removed; terms are joined by hyphens.
"""
- return '-'.join(filter(lambda x: len(x) > 2,
+ return '-'.join(filter(lambda x: len(x) >= min_word_length,
translate_string(title, escape_slashes=True, force_lower=True, spaces='-',
remove_punctuation=True, keep_chars='-').split('-')))