Hello community, here is the log from the commit of package python-pyvdr for openSUSE:Factory checked in at 2020-07-10 14:13:10 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pyvdr (Old) and /work/SRC/openSUSE:Factory/.python-pyvdr.new.3060 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pyvdr" Fri Jul 10 14:13:10 2020 rev:2 rq:819827 version:0.2.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pyvdr/python-pyvdr.changes 2020-03-16 10:18:20.395587275 +0100 +++ /work/SRC/openSUSE:Factory/.python-pyvdr.new.3060/python-pyvdr.changes 2020-07-10 14:13:14.067599029 +0200 @@ -1,0 +2,6 @@ +Thu Jul 9 19:27:33 UTC 2020 - Martin Hauke <[email protected]> + +- Update to version 0.2.1 + * Fix Regex for parsing of instant timers + +------------------------------------------------------------------- Old: ---- pyvdr-0.2.0.tar.gz New: ---- pyvdr-0.2.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pyvdr.spec ++++++ --- /var/tmp/diff_new_pack.RcKScN/_old 2020-07-10 14:13:15.883604993 +0200 +++ /var/tmp/diff_new_pack.RcKScN/_new 2020-07-10 14:13:15.887605007 +0200 @@ -1,6 +1,7 @@ # # spec file for package python-pyvdr # +# Copyright (c) 2020 SUSE LLC # Copyright (c) 2020, Martin Hauke <[email protected]> # # All modifications and additions to the file contributed by third parties @@ -19,7 +20,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-pyvdr -Version: 0.2.0 +Version: 0.2.1 Release: 0 Summary: Python library for accessing a Linux VDR via SVDRP License: MIT ++++++ pyvdr-0.2.0.tar.gz -> pyvdr-0.2.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyvdr-0.2.0/.gitignore new/pyvdr-0.2.1/.gitignore --- old/pyvdr-0.2.0/.gitignore 2020-03-11 19:45:55.000000000 +0100 +++ new/pyvdr-0.2.1/.gitignore 2020-07-09 16:45:38.000000000 +0200 @@ -6,4 +6,5 @@ .pytest_cache/ .vscode/ pyvdr/__pycache__/ -test/__pycache__/ \ No newline at end of file +test/__pycache__/.cache +.cache/ \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyvdr-0.2.0/pyvdr/pyvdr.py new/pyvdr-0.2.1/pyvdr/pyvdr.py --- old/pyvdr-0.2.0/pyvdr/pyvdr.py 2020-03-11 19:45:55.000000000 +0100 +++ new/pyvdr-0.2.1/pyvdr/pyvdr.py 2020-07-09 16:45:38.000000000 +0200 @@ -36,7 +36,7 @@ disk_stat_parts = re.match( r'(\d*)\w. (\d*)\w. (\d*)', disk_stat_response.Value, re.M | re.I) - + self.svdrp.disconnect() if disk_stat_parts: return [disk_stat_parts.group(1), disk_stat_parts.group(2), @@ -72,7 +72,7 @@ def _parse_timer_response(response): timer = {} m = re.match( - r'^(\d) (\d):(\d):(\d{4}-\d{2}-\d{2}):(\d{4}):(\d{4}):(\d+):(\d+):(.*):(.*)$', + r'^(\d) (\d{1,2}):(\d):(\d{4}-\d{2}-\d{2}):(\d{4}):(\d{4}):(\d+):(\d+):(.*):(.*)$', response.Value, re.M | re.I) @@ -92,6 +92,7 @@ self.svdrp.connect() self.svdrp.send_cmd("LSTT") responses = self.svdrp.get_response() + self.svdrp.disconnect() for response in responses: if response.Code != '250': continue @@ -109,15 +110,13 @@ if response.Code != '250': continue timer = self._parse_timer_response(response) + self.svdrp.disconnect() if self._check_timer_recording_flag(timer, FLAG_TIMER_INSTANT_RECORDING): timer['instant'] = True - self.svdrp.disconnect() return timer if self._check_timer_recording_flag(timer, FLAG_TIMER_RECORDING): - self.svdrp.disconnect() return timer - self.svdrp.disconnect() return None def get_channel_epg_info(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyvdr-0.2.0/setup.py new/pyvdr-0.2.1/setup.py --- old/pyvdr-0.2.0/setup.py 2020-03-11 19:45:55.000000000 +0100 +++ new/pyvdr-0.2.1/setup.py 2020-07-09 16:45:38.000000000 +0200 @@ -1,11 +1,18 @@ from setuptools import setup +with open("README.md", "r") as fh: + long_description = fh.read() + setup(name='pyvdr', - version='0.2.0', + version='0.2.1', description='Python library for accessing a Linux VDR via SVDRP', + long_description=long_description, + long_description_content_type="text/markdown", url='http://github.com/baschno/pyvdr', author='baschno', author_email='[email protected]', license='MIT', packages=['pyvdr'], - zip_safe=False) \ No newline at end of file + zip_safe=False, + python_requires='>=3.6', +) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyvdr-0.2.0/test/test_PYVDR.py new/pyvdr-0.2.1/test/test_PYVDR.py --- old/pyvdr-0.2.0/test/test_PYVDR.py 2020-03-11 19:45:55.000000000 +0100 +++ new/pyvdr-0.2.1/test/test_PYVDR.py 2020-07-09 16:45:38.000000000 +0200 @@ -2,6 +2,7 @@ from unittest.mock import MagicMock from pyvdr import PYVDR from pyvdr import pyvdr +from pyvdr.svdrp import response_data class TestPYVDR(unittest.TestCase): @@ -42,5 +43,47 @@ self.assertTrue(self.func._check_timer_recording_flag(t_active_and_instant_recording, pyvdr.FLAG_TIMER_RECORDING), "Timer recording") self.assertTrue(self.func._check_timer_recording_flag(t_active_and_instant_recording, pyvdr.FLAG_TIMER_INSTANT_RECORDING), "Timer instant recording") + def test__parse_searchtimer_response(self): + response = response_data( + "250", + "-", + "3 1:7:2020-07-13:1858:2025:50:99:Das perfekte Dinner~2020.07.13-19|00-Mo:<epgsearch><channel>7 - VOX</channel><searchtimer>das perfekte dinner</searchtimer><start>1594659480</start><stop>1594664700</stop><s-id>0</s-id><eventid>4572</eventid></epgsearch>" + ) + timer = self.func._parse_timer_response(response) + self.assertEqual( + timer, + { + 'status': '1', + 'channel': '7', + 'date': '2020-07-13', + 'name': 'Das perfekte Dinner~2020.07.13-19|00-Mo', + 'description': '', + 'series': True, + 'instant': False + } + ) + + def test__parse_instanttimer_response(self): + response = response_data( + "250", + "-", + "4 11:1:2020-07-08:2215:0145:50:99:@Tagesthemen mit Wetter:" + ) + timer = self.func._parse_timer_response(response) + + self.assertEqual( + timer, + { + 'status': '11', + 'channel': '1', + 'date': '2020-07-08', + 'name': '@Tagesthemen mit Wetter', + 'description': '', + 'series': False, + 'instant': False + } + ) + + if __name__ == '__main__': unittest.main()
