Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-cmd2 for openSUSE:Factory 
checked in at 2021-12-25 20:16:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-cmd2 (Old)
 and      /work/SRC/openSUSE:Factory/.python-cmd2.new.2520 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-cmd2"

Sat Dec 25 20:16:26 2021 rev:42 rq:941446 version:2.3.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-cmd2/python-cmd2.changes  2021-12-09 
19:45:31.117130637 +0100
+++ /work/SRC/openSUSE:Factory/.python-cmd2.new.2520/python-cmd2.changes        
2021-12-25 20:16:29.853242373 +0100
@@ -1,0 +2,6 @@
+Sat Dec 11 22:08:57 UTC 2021 - Dirk M??ller <dmuel...@suse.com>
+
+- update to 2.3.3:
+  * Added clearer exception handling to `BorderedTable` and `SimpleTable`.
+
+-------------------------------------------------------------------

Old:
----
  cmd2-2.3.2.tar.gz

New:
----
  cmd2-2.3.3.tar.gz

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

Other differences:
------------------
++++++ python-cmd2.spec ++++++
--- /var/tmp/diff_new_pack.nJ4PWi/_old  2021-12-25 20:16:30.733243090 +0100
+++ /var/tmp/diff_new_pack.nJ4PWi/_new  2021-12-25 20:16:30.737243093 +0100
@@ -19,7 +19,7 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define         skip_python2 1
 Name:           python-cmd2
-Version:        2.3.2
+Version:        2.3.3
 Release:        0
 Summary:        Extra features for standard library's cmd module
 License:        MIT

++++++ cmd2-2.3.2.tar.gz -> cmd2-2.3.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cmd2-2.3.2/CHANGELOG.md new/cmd2-2.3.3/CHANGELOG.md
--- old/cmd2-2.3.2/CHANGELOG.md 2021-11-22 21:38:30.000000000 +0100
+++ new/cmd2-2.3.3/CHANGELOG.md 2021-11-29 21:21:02.000000000 +0100
@@ -1,3 +1,7 @@
+## 2.3.3 (November 29, 2021)
+* Enhancements
+  * Added clearer exception handling to `BorderedTable` and `SimpleTable`.
+
 ## 2.3.2 (November 22, 2021)
 * Bug Fixes
   * Fixed issue where a `ns_provider` could be passed `None` instead of its 
correct `cmd2.Cmd` or `CommandSet` value.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cmd2-2.3.2/PKG-INFO new/cmd2-2.3.3/PKG-INFO
--- old/cmd2-2.3.2/PKG-INFO     2021-11-22 21:46:04.188333500 +0100
+++ new/cmd2-2.3.3/PKG-INFO     2021-11-29 21:28:57.115700200 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: cmd2
-Version: 2.3.2
+Version: 2.3.3
 Summary: cmd2 - quickly build feature-rich and user-friendly interactive 
command line applications in Python
 Home-page: https://github.com/python-cmd2/cmd2
 Author: Catherine Devlin
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cmd2-2.3.2/cmd2/table_creator.py 
new/cmd2-2.3.3/cmd2/table_creator.py
--- old/cmd2-2.3.2/cmd2/table_creator.py        2021-11-22 15:07:52.000000000 
+0100
+++ new/cmd2-2.3.3/cmd2/table_creator.py        2021-11-24 16:53:59.000000000 
+0100
@@ -440,7 +440,7 @@
         :param post_line: string to print after each line of a row. This can 
be used for padding after
                           the last cell's text and a right row border. 
(Defaults to blank)
         :return: row string
-        :raises: ValueError if data isn't the same length as self.cols
+        :raises: ValueError if row_data isn't the same length as self.cols
         :raises: TypeError if fill_char is more than one character (not 
including ANSI style sequences)
         :raises: ValueError if fill_char, pre_line, inter_cell, or post_line 
contains an unprintable
                  character like a newline
@@ -682,7 +682,11 @@
 
         :param row_data: data with an entry for each column in the row
         :return: data row string
+        :raises: ValueError if row_data isn't the same length as self.cols
         """
+        if len(row_data) != len(self.cols):
+            raise ValueError("Length of row_data must match length of cols")
+
         fill_char = self.apply_data_bg(SPACE)
         inter_cell = self.apply_data_bg(self.column_spacing * SPACE)
 
@@ -969,7 +973,11 @@
 
         :param row_data: data with an entry for each column in the row
         :return: data row string
+        :raises: ValueError if row_data isn't the same length as self.cols
         """
+        if len(row_data) != len(self.cols):
+            raise ValueError("Length of row_data must match length of cols")
+
         fill_char = self.apply_data_bg(SPACE)
 
         pre_line = self.apply_border_color('???') + 
self.apply_data_bg(self.padding * SPACE)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cmd2-2.3.2/cmd2.egg-info/PKG-INFO 
new/cmd2-2.3.3/cmd2.egg-info/PKG-INFO
--- old/cmd2-2.3.2/cmd2.egg-info/PKG-INFO       2021-11-22 21:46:03.000000000 
+0100
+++ new/cmd2-2.3.3/cmd2.egg-info/PKG-INFO       2021-11-29 21:28:56.000000000 
+0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: cmd2
-Version: 2.3.2
+Version: 2.3.3
 Summary: cmd2 - quickly build feature-rich and user-friendly interactive 
command line applications in Python
 Home-page: https://github.com/python-cmd2/cmd2
 Author: Catherine Devlin
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cmd2-2.3.2/tests/test_table_creator.py 
new/cmd2-2.3.3/tests/test_table_creator.py
--- old/cmd2-2.3.2/tests/test_table_creator.py  2021-11-22 15:07:52.000000000 
+0100
+++ new/cmd2-2.3.3/tests/test_table_creator.py  2021-11-24 16:53:59.000000000 
+0100
@@ -316,7 +316,7 @@
             tc.generate_row(row_data=row_data, is_header=False, **kwargs)
         assert "{} contains an unprintable character".format(arg) in 
str(excinfo.value)
 
-    # data with too many columns
+    # Data with too many columns
     row_data = ['Data 1', 'Extra Column']
     with pytest.raises(ValueError) as excinfo:
         tc.generate_row(row_data=row_data, is_header=False)
@@ -504,6 +504,17 @@
     assert st.total_width() == 34
 
 
+def test_simple_generate_data_row_exceptions():
+    column_1 = Column("Col 1")
+    tc = SimpleTable([column_1])
+
+    # Data with too many columns
+    row_data = ['Data 1', 'Extra Column']
+    with pytest.raises(ValueError) as excinfo:
+        tc.generate_data_row(row_data=row_data)
+    assert "Length of row_data must match length of cols" in str(excinfo.value)
+
+
 def test_bordered_table_creation():
     column_1 = Column("Col 1", width=15)
     column_2 = Column("Col 2", width=15)
@@ -635,6 +646,17 @@
     assert bt.total_width() == 37
 
 
+def test_bordered_generate_data_row_exceptions():
+    column_1 = Column("Col 1")
+    tc = BorderedTable([column_1])
+
+    # Data with too many columns
+    row_data = ['Data 1', 'Extra Column']
+    with pytest.raises(ValueError) as excinfo:
+        tc.generate_data_row(row_data=row_data)
+    assert "Length of row_data must match length of cols" in str(excinfo.value)
+
+
 def test_alternating_table_creation():
     column_1 = Column("Col 1", width=15)
     column_2 = Column("Col 2", width=15)

Reply via email to