Rebased package
authorThierry Florac <tflorac@ulthar.net>
Fri, 07 Dec 2018 13:53:52 +0100
changeset 292 b338586588ad
parent 288 d2798df7cb42 (current diff)
parent 291 684f08c4789e (diff)
child 293 dd5bb00e9b2b
Rebased package
.hgignore
.hgtags
bootstrap.py
buildout.cfg
docs/HISTORY.txt
docs/README.txt
setup.py
src/pyams_utils.egg-info/PKG-INFO
src/pyams_utils.egg-info/SOURCES.txt
src/pyams_utils.egg-info/requires.txt
src/pyams_utils/__init__.py
src/pyams_utils/adapter.py
src/pyams_utils/attr.py
src/pyams_utils/cache.py
src/pyams_utils/configure.zcml
src/pyams_utils/container.py
src/pyams_utils/context.py
src/pyams_utils/data.py
src/pyams_utils/date.py
src/pyams_utils/decorator.py
src/pyams_utils/dict.py
src/pyams_utils/doctests/README.txt
src/pyams_utils/doctests/request.txt
src/pyams_utils/encoding.py
src/pyams_utils/factory.py
src/pyams_utils/fanstatic.py
src/pyams_utils/html.py
src/pyams_utils/i18n.py
src/pyams_utils/include.py
src/pyams_utils/inherit.py
src/pyams_utils/interfaces/__init__.py
src/pyams_utils/interfaces/inherit.py
src/pyams_utils/interfaces/site.py
src/pyams_utils/interfaces/tree.py
src/pyams_utils/interfaces/url.py
src/pyams_utils/interfaces/zeo.py
src/pyams_utils/intids.py
src/pyams_utils/list.py
src/pyams_utils/locales/fr/LC_MESSAGES/pyams_utils.mo
src/pyams_utils/locales/fr/LC_MESSAGES/pyams_utils.po
src/pyams_utils/locales/pyams_utils.pot
src/pyams_utils/lock.py
src/pyams_utils/progress.py
src/pyams_utils/property.py
src/pyams_utils/protocol/http.py
src/pyams_utils/protocol/xmlrpc.py
src/pyams_utils/registry.py
src/pyams_utils/request.py
src/pyams_utils/schema.py
src/pyams_utils/scripts/zodb.py
src/pyams_utils/session.py
src/pyams_utils/site.py
src/pyams_utils/size.py
src/pyams_utils/tales.py
src/pyams_utils/text.py
src/pyams_utils/timezone/__init__.py
src/pyams_utils/timezone/utility.py
src/pyams_utils/timezone/vocabulary.py
src/pyams_utils/traversing.py
src/pyams_utils/unicode.py
src/pyams_utils/url.py
src/pyams_utils/vocabulary.py
src/pyams_utils/widget/__init__.py
src/pyams_utils/widget/decimal.py
src/pyams_utils/wsgi.py
src/pyams_utils/zodb.py
--- 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('-')))