Hello community,
here is the log from the commit of package python-python-slugify for
openSUSE:Factory checked in at 2019-08-27 10:26:07
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-python-slugify (Old)
and /work/SRC/openSUSE:Factory/.python-python-slugify.new.7948 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-python-slugify"
Tue Aug 27 10:26:07 2019 rev:6 rq:726219 version:3.0.3
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-python-slugify/python-python-slugify.changes
2019-05-27 08:39:26.467046281 +0200
+++
/work/SRC/openSUSE:Factory/.python-python-slugify.new.7948/python-python-slugify.changes
2019-08-27 10:26:07.931920065 +0200
@@ -1,0 +2,7 @@
+Mon Aug 26 11:27:46 UTC 2019 - Antonio Larrosa <[email protected]>
+
+- Update to 3.0.3:
+ * Add Options to readme
+ * Add more unit tests
+
+-------------------------------------------------------------------
Old:
----
python-slugify-3.0.2.tar.gz
New:
----
python-slugify-3.0.3.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-python-slugify.spec ++++++
--- /var/tmp/diff_new_pack.Sb5GNy/_old 2019-08-27 10:26:08.475920025 +0200
+++ /var/tmp/diff_new_pack.Sb5GNy/_new 2019-08-27 10:26:08.475920025 +0200
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-python-slugify
-Version: 3.0.2
+Version: 3.0.3
Release: 0
Summary: Slugify application that handles Unicode
License: MIT
++++++ python-slugify-3.0.2.tar.gz -> python-slugify-3.0.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-slugify-3.0.2/CHANGELOG.md
new/python-slugify-3.0.3/CHANGELOG.md
--- old/python-slugify-3.0.2/CHANGELOG.md 2019-03-31 16:15:13.000000000
+0200
+++ new/python-slugify-3.0.3/CHANGELOG.md 2019-07-28 05:02:18.000000000
+0200
@@ -1,3 +1,7 @@
+## 3.0.3
+ - Add Options to readme
+ - Add more unit tests
+
## 3.0.2
- Add official support of Py 3.7
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-slugify-3.0.2/PKG-INFO
new/python-slugify-3.0.3/PKG-INFO
--- old/python-slugify-3.0.2/PKG-INFO 2019-03-31 16:15:19.000000000 +0200
+++ new/python-slugify-3.0.3/PKG-INFO 2019-07-28 05:02:27.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: python-slugify
-Version: 3.0.2
+Version: 3.0.3
Summary: A Python Slugify application that handles Unicode
Home-page: https://github.com/un33k/python-slugify
Author: Val Neekman
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-slugify-3.0.2/README.md
new/python-slugify-3.0.3/README.md
--- old/python-slugify-3.0.2/README.md 2019-03-03 18:41:22.000000000 +0100
+++ new/python-slugify-3.0.3/README.md 2019-07-28 05:02:18.000000000 +0200
@@ -19,82 +19,116 @@
However, there is an alternative decoding package called
[Unidecode](https://github.com/avian2/unidecode) *(GPL)*. It can be installed
as `python-slugify[unidecode]` for those who prefer it.
-
How to install
====================
easy_install python-slugify |OR| easy_install python-slugify[unidecode]
-- OR --
pip install python-slugify |OR| pip install python-slugify[unidecode]
+Options
+===================
+```python
+def slugify(
+ text,
+ entities=True,
+ decimal=True,
+ hexadecimal=True,
+ max_length=0,
+ word_boundary=False,
+ separator='-',
+ save_order=False,
+ stopwords=(),
+ regex_pattern=None,
+ lowercase=True,
+ replacements=()
+ ):
+ """
+ Make a slug from the given text.
+ :param text (str): initial text
+ :param entities (bool): converts html entities to unicode (foo & bar ->
foo-bar)
+ :param decimal (bool): converts html decimal to unicode (Ž -> Ž -> z)
+ :param hexadecimal (bool): converts html hexadecimal to unicode (Ž ->
Ž -> z)
+ :param max_length (int): output string length
+ :param word_boundary (bool): truncates to end of full words (length may be
shorter than max_length)
+ :param save_order (bool): if parameter is True and max_length > 0 return
whole words in the initial order
+ :param separator (str): separator between words
+ :param stopwords (iterable): words to discount
+ :param regex_pattern (str): regex pattern for allowed characters
+ :param lowercase (bool): activate case sensitivity by setting it to False
+ :param replacements (iterable): list of replacement rules e.g. [['|', 'or'],
['%', 'percent']]
+ :return (str): slugify text
+ """
+```
+
How to use
====================
- ```python
- from slugify import slugify
+```python
+from slugify import slugify
- txt = "This is a test ---"
- r = slugify(txt)
- self.assertEqual(r, "this-is-a-test")
-
- txt = '影師嗎'
- r = slugify(txt)
- self.assertEqual(r, "ying-shi-ma")
-
- txt = 'C\'est déjà l\'été.'
- r = slugify(txt)
- self.assertEqual(r, "c-est-deja-l-ete")
-
- txt = 'Nín hǎo. Wǒ shì zhōng guó rén'
- r = slugify(txt)
- self.assertEqual(r, "nin-hao-wo-shi-zhong-guo-ren")
-
- txt = 'Компьютер'
- r = slugify(txt)
- self.assertEqual(r, "kompiuter")
-
- txt = 'jaja---lol-méméméoo--a'
- r = slugify(txt, max_length=9)
- self.assertEqual(r, "jaja-lol")
-
- txt = 'jaja---lol-méméméoo--a'
- r = slugify(txt, max_length=15, word_boundary=True)
- self.assertEqual(r, "jaja-lol-a")
-
- txt = 'jaja---lol-méméméoo--a'
- r = slugify(txt, max_length=20, word_boundary=True, separator=".")
- self.assertEqual(r, "jaja.lol.mememeoo.a")
-
- txt = 'one two three four five'
- r = slugify(txt, max_length=13, word_boundary=True, save_order=True)
- self.assertEqual(r, "one-two-three")
-
- txt = 'the quick brown fox jumps over the lazy dog'
- r = slugify(txt, stopwords=['the'])
- self.assertEqual(r, 'quick-brown-fox-jumps-over-lazy-dog')
-
- txt = 'the quick brown fox jumps over the lazy dog in a hurry'
- r = slugify(txt, stopwords=['the', 'in', 'a', 'hurry'])
- self.assertEqual(r, 'quick-brown-fox-jumps-over-lazy-dog')
-
- txt = 'thIs Has a stopword Stopword'
- r = slugify(txt, stopwords=['Stopword'], lowercase=False)
- self.assertEqual(r, 'thIs-Has-a-stopword')
-
- txt = "___This is a test___"
- regex_pattern = r'[^-a-z0-9_]+'
- r = slugify(txt, regex_pattern=regex_pattern)
- self.assertEqual(r, "___this-is-a-test___")
-
- txt = "___This is a test___"
- regex_pattern = r'[^-a-z0-9_]+'
- r = slugify(txt, separator='_', regex_pattern=regex_pattern)
- self.assertNotEqual(r, "_this_is_a_test_")
-
- txt = '10 | 20 %'
- r = slugify(txt, replacements=[['|', 'or'], ['%', 'percent']])
- self.assertEqual(r, "10-or-20-percent")
+txt = "This is a test ---"
+r = slugify(txt)
+self.assertEqual(r, "this-is-a-test")
+
+txt = '影師嗎'
+r = slugify(txt)
+self.assertEqual(r, "ying-shi-ma")
+
+txt = 'C\'est déjà l\'été.'
+r = slugify(txt)
+self.assertEqual(r, "c-est-deja-l-ete")
+
+txt = 'Nín hǎo. Wǒ shì zhōng guó rén'
+r = slugify(txt)
+self.assertEqual(r, "nin-hao-wo-shi-zhong-guo-ren")
+
+txt = 'Компьютер'
+r = slugify(txt)
+self.assertEqual(r, "kompiuter")
+
+txt = 'jaja---lol-méméméoo--a'
+r = slugify(txt, max_length=9)
+self.assertEqual(r, "jaja-lol")
+
+txt = 'jaja---lol-méméméoo--a'
+r = slugify(txt, max_length=15, word_boundary=True)
+self.assertEqual(r, "jaja-lol-a")
+
+txt = 'jaja---lol-méméméoo--a'
+r = slugify(txt, max_length=20, word_boundary=True, separator=".")
+self.assertEqual(r, "jaja.lol.mememeoo.a")
+
+txt = 'one two three four five'
+r = slugify(txt, max_length=13, word_boundary=True, save_order=True)
+self.assertEqual(r, "one-two-three")
+
+txt = 'the quick brown fox jumps over the lazy dog'
+r = slugify(txt, stopwords=['the'])
+self.assertEqual(r, 'quick-brown-fox-jumps-over-lazy-dog')
+
+txt = 'the quick brown fox jumps over the lazy dog in a hurry'
+r = slugify(txt, stopwords=['the', 'in', 'a', 'hurry'])
+self.assertEqual(r, 'quick-brown-fox-jumps-over-lazy-dog')
+
+txt = 'thIs Has a stopword Stopword'
+r = slugify(txt, stopwords=['Stopword'], lowercase=False)
+self.assertEqual(r, 'thIs-Has-a-stopword')
+
+txt = "___This is a test___"
+regex_pattern = r'[^-a-z0-9_]+'
+r = slugify(txt, regex_pattern=regex_pattern)
+self.assertEqual(r, "___this-is-a-test___")
+
+txt = "___This is a test___"
+regex_pattern = r'[^-a-z0-9_]+'
+r = slugify(txt, separator='_', regex_pattern=regex_pattern)
+self.assertNotEqual(r, "_this_is_a_test_")
+
+txt = '10 | 20 %'
+r = slugify(txt, replacements=[['|', 'or'], ['%', 'percent']])
+self.assertEqual(r, "10-or-20-percent")
- ```
+```
For more examples, have a look at the [test.py](test.py) file.
@@ -137,4 +171,4 @@
Sponsors
====================
-[](https://github.com/surgeforward)
+[Surge](https://github.com/surgeforward)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-slugify-3.0.2/python_slugify.egg-info/PKG-INFO
new/python-slugify-3.0.3/python_slugify.egg-info/PKG-INFO
--- old/python-slugify-3.0.2/python_slugify.egg-info/PKG-INFO 2019-03-31
16:15:19.000000000 +0200
+++ new/python-slugify-3.0.3/python_slugify.egg-info/PKG-INFO 2019-07-28
05:02:27.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: python-slugify
-Version: 3.0.2
+Version: 3.0.3
Summary: A Python Slugify application that handles Unicode
Home-page: https://github.com/un33k/python-slugify
Author: Val Neekman
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-slugify-3.0.2/slugify/__init__.py
new/python-slugify-3.0.3/slugify/__init__.py
--- old/python-slugify-3.0.2/slugify/__init__.py 2019-03-31
16:15:13.000000000 +0200
+++ new/python-slugify-3.0.3/slugify/__init__.py 2019-07-28
05:02:18.000000000 +0200
@@ -3,4 +3,4 @@
__author__ = 'Val Neekman @ Neekware Inc. [@vneekman]'
__description__ = 'A Python slugify application that also handles Unicode'
-__version__ = '3.0.2'
+__version__ = '3.0.3'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-slugify-3.0.2/slugify/slugify.py
new/python-slugify-3.0.3/slugify/slugify.py
--- old/python-slugify-3.0.2/slugify/slugify.py 2019-03-31 16:05:11.000000000
+0200
+++ new/python-slugify-3.0.3/slugify/slugify.py 2019-07-28 05:02:18.000000000
+0200
@@ -80,11 +80,11 @@
"""
Make a slug from the given text.
:param text (str): initial text
- :param entities (bool):
- :param decimal (bool):
- :param hexadecimal (bool):
+ :param entities (bool): converts html entities to unicode
+ :param decimal (bool): converts html decimal to unicode
+ :param hexadecimal (bool): converts html hexadecimal to unicode
:param max_length (int): output string length
- :param word_boundary (bool):
+ :param word_boundary (bool): truncates to complete word even if length
ends up shorter than max_length
:param save_order (bool): if parameter is True and max_length > 0 return
whole words in the initial order
:param separator (str): separator between words
:param stopwords (iterable): words to discount
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-slugify-3.0.2/test.py
new/python-slugify-3.0.3/test.py
--- old/python-slugify-3.0.2/test.py 2019-01-04 00:13:14.000000000 +0100
+++ new/python-slugify-3.0.3/test.py 2019-07-28 05:02:18.000000000 +0200
@@ -142,11 +142,36 @@
r = slugify(txt, stopwords=['the'], separator=' ')
self.assertEqual(r, 'quick brown fox jumps over lazy dog')
- def test_html_entities(self):
+ def test_html_entities_on(self):
txt = 'foo & bar'
r = slugify(txt)
self.assertEqual(r, 'foo-bar')
+ def test_html_entities_off(self):
+ txt = 'foo & bar'
+ r = slugify(txt, entities=False)
+ self.assertEqual(r, 'foo-amp-bar')
+
+ def test_html_decimal_on(self):
+ txt = 'Ž'
+ r = slugify(txt, decimal=True)
+ self.assertEqual(r, 'z')
+
+ def test_html_decimal_off(self):
+ txt = 'Ž'
+ r = slugify(txt, entities=False, decimal=False)
+ self.assertEqual(r, '381')
+
+ def test_html_hexadecimal_on(self):
+ txt = 'Ž'
+ r = slugify(txt, hexadecimal=True)
+ self.assertEqual(r, 'z')
+
+ def test_html_hexadecimal_off(self):
+ txt = 'Ž'
+ r = slugify(txt, hexadecimal=False)
+ self.assertEqual(r, 'x17d')
+
def test_starts_with_number(self):
txt = '10 amazing secrets'
r = slugify(txt)