Hello community,

here is the log from the commit of package python-tomlkit for openSUSE:Factory 
checked in at 2019-12-07 15:19:25
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-tomlkit (Old)
 and      /work/SRC/openSUSE:Factory/.python-tomlkit.new.4691 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-tomlkit"

Sat Dec  7 15:19:25 2019 rev:3 rq:751845 version:0.5.8

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-tomlkit/python-tomlkit.changes    
2019-10-10 11:51:37.719610520 +0200
+++ /work/SRC/openSUSE:Factory/.python-tomlkit.new.4691/python-tomlkit.changes  
2019-12-07 15:22:59.935732045 +0100
@@ -1,0 +2,6 @@
+Thu Nov 28 17:52:19 CET 2019 - Matej Cepl <[email protected]>
+
+- Update to 0.5.8:
+  - Added support for producing multiline arrays
+
+-------------------------------------------------------------------

Old:
----
  tomlkit-0.5.7.tar.gz

New:
----
  tomlkit-0.5.8.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-tomlkit.spec ++++++
--- /var/tmp/diff_new_pack.M6NYyh/_old  2019-12-07 15:23:00.511731965 +0100
+++ /var/tmp/diff_new_pack.M6NYyh/_new  2019-12-07 15:23:00.515731964 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-tomlkit
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-tomlkit
-Version:        0.5.7
+Version:        0.5.8
 Release:        0
 Summary:        Style preserving TOML library
 License:        MIT

++++++ tomlkit-0.5.7.tar.gz -> tomlkit-0.5.8.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tomlkit-0.5.7/PKG-INFO new/tomlkit-0.5.8/PKG-INFO
--- old/tomlkit-0.5.7/PKG-INFO  1970-01-01 01:00:00.000000000 +0100
+++ new/tomlkit-0.5.8/PKG-INFO  1970-01-01 01:00:00.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: tomlkit
-Version: 0.5.7
+Version: 0.5.8
 Summary: Style preserving TOML library
 Home-page: https://github.com/sdispater/tomlkit
 License: MIT
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tomlkit-0.5.7/pyproject.toml 
new/tomlkit-0.5.8/pyproject.toml
--- old/tomlkit-0.5.7/pyproject.toml    2019-10-04 14:55:19.154915600 +0200
+++ new/tomlkit-0.5.8/pyproject.toml    2019-10-11 16:27:47.492856000 +0200
@@ -1,6 +1,6 @@
 [tool.poetry]
 name = "tomlkit"
-version = "0.5.7"
+version = "0.5.8"
 description = "Style preserving TOML library"
 authors = ["Sébastien Eustace <[email protected]>"]
 license = "MIT"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tomlkit-0.5.7/setup.py new/tomlkit-0.5.8/setup.py
--- old/tomlkit-0.5.7/setup.py  1970-01-01 01:00:00.000000000 +0100
+++ new/tomlkit-0.5.8/setup.py  1970-01-01 01:00:00.000000000 +0100
@@ -22,7 +22,7 @@
 
 setup_kwargs = {
     'name': 'tomlkit',
-    'version': '0.5.7',
+    'version': '0.5.8',
     'description': 'Style preserving TOML library',
     'long_description': '[github_release]: 
https://img.shields.io/github/release/sdispater/tomlkit.svg?logo=github&logoColor=white\n[pypi_version]:
 
https://img.shields.io/pypi/v/tomlkit.svg?logo=python&logoColor=white\n[python_versions]:
 
https://img.shields.io/pypi/pyversions/tomlkit.svg?logo=python&logoColor=white\n[github_license]:
 
https://img.shields.io/github/license/sdispater/tomlkit.svg?logo=github&logoColor=white\n[travisci]:
 
https://img.shields.io/travis/com/sdispater/tomlkit/master.svg?logo=travis&logoColor=white&label=Travis%20CI\n[appveyor]:
 
https://img.shields.io/appveyor/ci/sdispater/tomlkit/master.svg?logo=appveyor&logoColor=white&label=AppVeyor\n<!--Codecov
 logo not offered by shields.io or simpleicons.org, this is Codecov\'s SVG 
image modified to be white-->\n[codecov]: 
https://img.shields.io/codecov/c/github/sdispater/tomlkit/master.svg?logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNDgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CgogPGc+CiAgPHRpdGxlPmJhY2tncm91bmQ8L3RpdGxlPgogIDxyZWN0IGZpbGw9Im5vbmUiIGlkPSJjYW52YXNfYmFja2dyb3VuZCIgaGVpZ2h0PSI0MDIiIHdpZHRoPSI1ODIiIHk9Ii0xIiB4PSItMSIvPgogPC9nPgogPGc+CiAgPHRpdGxlPkxheWVyIDE8L3RpdGxlPgogIDxwYXRoIGlkPSJzdmdfMSIgZmlsbC1ydWxlPSJldmVub2RkIiBmaWxsPSIjZmZmZmZmIiBkPSJtMjUuMDE0LDBjLTEzLjc4NCwwLjAxIC0yNS4wMDQsMTEuMTQ5IC0yNS4wMTQsMjQuODMybDAsMC4wNjJsNC4yNTQsMi40ODJsMC4wNTgsLTAuMDM5YTEyLjIzOCwxMi4yMzggMCAwIDEgOS4wNzgsLTEuOTI4YTExLjg0NCwxMS44NDQgMCAwIDEgNS45OCwyLjk3NWwwLjczLDAuNjhsMC40MTMsLTAuOTA0YzAuNCwtMC44NzQgMC44NjIsLTEuNjk2IDEuMzc0LC0yLjQ0M2MwLjIwNiwtMC4zIDAuNDMzLC0wLjYwNCAwLjY5MiwtMC45MjlsMC40MjcsLTAuNTM1bC0wLjUyNiwtMC40NGExNy40NSwxNy40NSAwIDAgMCAtOC4xLC0zLjc4MWExNy44NTMsMTcuODUzIDAgMCAwIC04LjM3NSwwLjQ5Y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AuMDEsMC4xMyAwLjAyMywwLjI1OSAwLjAzNiwwLjM4OGMwLjAxNSwwLjE1OCAwLjAzNCwwLjMxNiAwLjA1MywwLjQ3MWwwLjAxMSwwLjA4OGwwLjAyOCwwLjIxNGMwLjAzNywwLjI2NCAwLjA4LDAuNTI1IDAuMTMsMC43ODdjMC41MDMsMi42MzcgMS43Niw1LjI3NCAzLjYzNSw3LjYyNWwwLjA4NSwwLjEwNmwwLjA4NywtMC4xMDRjMC43NDgsLTAuODg0IDIuNjAzLC0zLjY4NyAyLjc2LC01LjM2OWwwLjAwMywtMC4wMzFsLTAuMDE1LC0wLjAyOGExMS43MzYsMTEuNzM2IDAgMCAxIC0xLjMzMywtNS40MDdjMCwtNi4yODQgNC45NCwtMTEuNTAyIDExLjI0MywtMTEuODhsMC40MTQsLTAuMDE1YzIuNTYxLC0wLjA1OCA1LjA2NCwwLjY3MyA3LjIzLDIuMTM2bDAuMDU4LDAuMDM5bDQuMTk3LC0yLjQ0bDAuMDU1LC0wLjAzM2wwLC0wLjA2MmMwLjAwNiwtNi42MzIgLTIuNTkyLC0xMi44NjUgLTcuMzE0LC0xNy41NTFjLTQuNzE2LC00LjY3OSAtMTAuOTkxLC03LjI1NSAtMTcuNjcyLC03LjI1NSIvPgogPC9nPgo8L3N2Zz4=&label=Codecov\n\n[![GitHub
 
Release][github_release]](https://github.com/sdispater/tomlkit/releases/)\n[![PyPI
 Version][pypi_version]](https://pypi.python.org/pypi/tomlkit/)\n[![Python 
Versions][python_versions]](https://pypi.python.org/pypi/tomlkit/)\n[![License][github_license]](https://github.com/sdispater/tomlkit/blob/master/LICENSE)\n<br>\n[![Travis
 
CI][travisci]](https://travis-ci.com/sdispater/tomlkit)\n[![AppVeyor][appveyor]](https://ci.appveyor.com/project/sdispater/tomlkit)\n[![Codecov][codecov]](https://codecov.io/gh/sdispater/tomlkit)\n\n#
 TOML Kit - Style-preserving TOML library for Python\n\nTOML Kit is a 
**0.5.0-compliant** [TOML](https://github.com/toml-lang/toml) library.\n\nIt 
includes a parser that preserves all comments, indentations, whitespace and 
internal element ordering,\nand makes them accessible and editable via an 
intuitive API.\n\nYou can also create new TOML documents from scratch using the 
provided helpers.\n\nPart of the implementation as been adapted, improved and 
fixed from [Molten](https://github.com/LeopoldArkham/Molten).\n\n## 
Usage\n\n### Parsing\n\nTOML Kit comes with a fast and style-preserving parser 
to help you access\nthe content of TOML files and strings.\n\n```python\n>>> 
from tomlkit import dumps\n>>> from tomlkit import parse  # you can also use 
loads\n\n>>> content = """[table]\n... foo = "bar"  # String\n... """\n>>> doc 
= parse(content)\n\n# doc is a TOMLDocument instance that holds all the 
information\n# about the TOML string.\n# It behaves like a standard 
dictionary.\n\n>>> assert doc["table"]["foo"] == "bar"\n\n# The string 
generated from the document is exactly the same\n# as the original string\n>>> 
assert dumps(doc) == content\n```\n\n### Modifying\n\nTOML Kit provides an 
intuitive API to modify TOML documents.\n\n```python\n>>> from tomlkit import 
dumps\n>>> from tomlkit import parse\n>>> from tomlkit import table\n\n>>> doc 
= parse("""[table]\n... foo = "bar"  # String\n... """)\n\n>>> 
doc["table"]["baz"] = 13\n\n>>> dumps(doc)\n"""[table]\nfoo = "bar"  # 
String\nbaz = 13\n"""\n\n# Add a new table\n>>> tab = table()\n>>> 
tab.add("array", [1, 2, 3])\n\n>>> doc["table2"] = tab\n\n>>> 
dumps(doc)\n"""[table]\nfoo = "bar"  # String\nbaz = 13\n\n[table2]\narray = 
[1, 2, 3]\n"""\n\n# Remove the newly added table\n>>> doc.remove("table2")\n# 
del doc["table2] is also possible\n```\n\n### Writing\n\nYou can also write a 
new TOML document from scratch.\n\nLet\'s say we want to create this following 
document:\n\n```toml\n# This is a TOML document.\n\ntitle = "TOML 
Example"\n\n[owner]\nname = "Tom Preston-Werner"\norganization = "GitHub"\nbio 
= "GitHub Cofounder & CEO\\nLikes tater tots and beer."\ndob = 
1979-05-27T07:32:00Z # First class dates? Why not?\n\n[database]\nserver = 
"192.168.1.1"\nports = [ 8001, 8001, 8002 ]\nconnection_max = 5000\nenabled = 
true\n```\n\nIt can be created with the following code:\n\n```python\n>>> from 
tomlkit import comment\n>>> from tomlkit import document\n>>> from tomlkit 
import nl\n>>> from tomlkit import table\n\n>>> doc = document()\n>>> 
doc.add(comment("This is a TOML document."))\n>>> doc.add(nl())\n>>> 
doc.add("title", "TOML Example")\n# Using doc["title"] = "TOML Example" is also 
possible\n\n>>> owner = table()\n>>> owner.add("name", "Tom 
Preston-Werner")\n>>> owner.add("organization", "GitHub")\n>>> owner.add("bio", 
"GitHub Cofounder & CEO\\nLikes tater tots and beer.")\n>>> owner.add("dob", 
datetime(1979, 5, 27, 7, 32, tzinfo=utc))\n>>> owner["dob"].comment("First 
class dates? Why not?")\n\n# Adding the table to the document\n>>> 
doc.add("owner", owner)\n\n>>> database = table()\n>>> database["server"] = 
"192.168.1.1"\n>>> database["ports"] = [8001, 8001, 8002]\n>>> 
database["connection_max"] = 5000\n>>> database["enabled"] = True\n\n>>> 
doc["database"] = database\n```\n\n\n## Installation\n\nIf you are using 
[Poetry](https://poetry.eustace.io),\nadd `tomlkit` to your `pyproject.toml` 
file by using:\n\n```bash\npoetry add tomlkit\n```\n\nIf not, you can use 
`pip`:\n\n```bash\npip install tomlkit\n```\n',
     'author': 'Sébastien Eustace',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tomlkit-0.5.7/tests/test_items.py 
new/tomlkit-0.5.8/tests/test_items.py
--- old/tomlkit-0.5.7/tests/test_items.py       2019-10-04 13:23:10.779448500 
+0200
+++ new/tomlkit-0.5.8/tests/test_items.py       2019-10-11 15:16:20.351260700 
+0200
@@ -173,6 +173,29 @@
     )
 
 
+def test_array_multiline():
+    t = item([1, 2, 3, 4, 5, 6, 7, 8])
+    t.multiline(True)
+
+    expected = """\
+[
+    1,
+    2,
+    3,
+    4,
+    5,
+    6,
+    7,
+    8,
+]"""
+
+    assert expected == t.as_string()
+
+    t = item([])
+
+    assert "[]" == t.as_string()
+
+
 def test_dicts_are_converted_to_tables():
     t = item({"foo": {"bar": "baz"}})
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tomlkit-0.5.7/tomlkit/__init__.py 
new/tomlkit-0.5.8/tomlkit/__init__.py
--- old/tomlkit-0.5.7/tomlkit/__init__.py       2019-10-04 14:56:25.487911000 
+0200
+++ new/tomlkit-0.5.8/tomlkit/__init__.py       2019-10-11 16:28:40.078169600 
+0200
@@ -22,4 +22,4 @@
 from .api import ws
 
 
-__version__ = "0.5.7"
+__version__ = "0.5.8"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tomlkit-0.5.7/tomlkit/items.py 
new/tomlkit-0.5.8/tomlkit/items.py
--- old/tomlkit-0.5.7/tomlkit/items.py  2019-10-04 14:42:00.685706900 +0200
+++ new/tomlkit-0.5.8/tomlkit/items.py  2019-10-11 14:55:39.704120200 +0200
@@ -744,7 +744,7 @@
     An array literal
     """
 
-    def __init__(self, value, trivia):  # type: (list, Trivia) -> None
+    def __init__(self, value, trivia, multiline=False):  # type: (list, 
Trivia) -> None
         super(Array, self).__init__(trivia)
 
         list.__init__(
@@ -752,6 +752,7 @@
         )
 
         self._value = value
+        self._multiline = multiline
 
     @property
     def discriminant(self):  # type: () -> int
@@ -773,8 +774,23 @@
 
         return len(set(discriminants)) == 1
 
+    def multiline(self, multiline):  # type: (bool) -> self
+        self._multiline = multiline
+
+        return self
+
     def as_string(self):  # type: () -> str
-        return "[{}]".format("".join(v.as_string() for v in self._value))
+        if not self._multiline:
+            return "[{}]".format("".join(v.as_string() for v in self._value))
+
+        s = "[\n" + self.trivia.indent + " " * 4
+        s += (",\n" + self.trivia.indent + " " * 4).join(
+            v.as_string() for v in self._value if not isinstance(v, Whitespace)
+        )
+        s += ",\n"
+        s += "]"
+
+        return s
 
     def append(self, _item):  # type: () -> None
         if self._value:


Reply via email to