Hello community, here is the log from the commit of package python-python-mpv for openSUSE:Factory checked in at 2018-05-11 09:14:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-python-mpv (Old) and /work/SRC/openSUSE:Factory/.python-python-mpv.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-python-mpv" Fri May 11 09:14:19 2018 rev:3 rq:605460 version:0.3.8 Changes: -------- --- /work/SRC/openSUSE:Factory/python-python-mpv/python-python-mpv.changes 2017-11-27 22:15:52.572155349 +0100 +++ /work/SRC/openSUSE:Factory/.python-python-mpv.new/python-python-mpv.changes 2018-05-11 09:14:26.166860243 +0200 @@ -1,0 +2,5 @@ +Tue May 8 15:55:55 UTC 2018 - [email protected] + +- Update to version 0.3.8 (no changelog supplied) + +------------------------------------------------------------------- Old: ---- python-mpv-0.3.6.tar.gz New: ---- python-mpv-0.3.8.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-python-mpv.spec ++++++ --- /var/tmp/diff_new_pack.vfYfwI/_old 2018-05-11 09:14:27.526810978 +0200 +++ /var/tmp/diff_new_pack.vfYfwI/_new 2018-05-11 09:14:27.530810833 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-python-mpv # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,12 +18,12 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-python-mpv -Version: 0.3.6 +Version: 0.3.8 Release: 0 Summary: Python interface to the mpv media player License: AGPL-3.0+ Group: Development/Languages/Python -URL: https://github.com/jaseg/python-mpv +Url: https://github.com/jaseg/python-mpv Source0: https://files.pythonhosted.org/packages/source/p/python-mpv/python-mpv-%{version}.tar.gz Source99: %{name}-rpmlintrc BuildRequires: %{python_module devel} ++++++ python-mpv-0.3.6.tar.gz -> python-mpv-0.3.8.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-mpv-0.3.6/PKG-INFO new/python-mpv-0.3.8/PKG-INFO --- old/python-mpv-0.3.6/PKG-INFO 2017-09-19 12:12:54.000000000 +0200 +++ new/python-mpv-0.3.8/PKG-INFO 2017-12-24 22:46:56.000000000 +0100 @@ -1,21 +1,20 @@ Metadata-Version: 1.1 Name: python-mpv -Version: 0.3.6 +Version: 0.3.8 Summary: A python interface to the mpv media player Home-page: https://github.com/jaseg/python-mpv Author: jaseg Author-email: [email protected] License: AGPLv3+ +Description-Content-Type: UNKNOWN Description: UNKNOWN Keywords: mpv,library,video,audio,player,display,multimedia Platform: UNKNOWN Classifier: Development Status :: 4 - Beta -Classifier: Environment :: Win32 (MS Windows) Classifier: Environment :: X11 Applications Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+) Classifier: Natural Language :: English -Classifier: Operating System :: Microsoft :: Windows Classifier: Operating System :: POSIX Classifier: Programming Language :: C Classifier: Programming Language :: Python :: 3.6 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-mpv-0.3.6/mpv.py new/python-mpv-0.3.8/mpv.py --- old/python-mpv-0.3.6/mpv.py 2017-09-19 12:11:39.000000000 +0200 +++ new/python-mpv-0.3.8/mpv.py 2017-12-24 22:31:54.000000000 +0100 @@ -191,27 +191,37 @@ return cast(self.data, POINTER(c_char))[:self.size] class MpvNode(Structure): - _fields_ = [('val', c_longlong), - ('format', MpvFormat)] - def node_value(self, decoder=identity_decoder): - return MpvNode.node_cast_value(byref(c_void_p(self.val)), self.format.value, decoder) + return MpvNode.node_cast_value(self.val, self.format.value, decoder) @staticmethod def node_cast_value(v, fmt=MpvFormat.NODE, decoder=identity_decoder): return { MpvFormat.NONE: lambda v: None, - MpvFormat.STRING: lambda v: decoder(cast(v, POINTER(c_char_p)).contents.value), - MpvFormat.OSD_STRING: lambda v: cast(v, POINTER(c_char_p)).contents.value.decode('utf-8'), - MpvFormat.FLAG: lambda v: bool(cast(v, POINTER(c_int)).contents.value), - MpvFormat.INT64: lambda v: cast(v, POINTER(c_longlong)).contents.value, - MpvFormat.DOUBLE: lambda v: cast(v, POINTER(c_double)).contents.value, - MpvFormat.NODE: lambda v: cast(v, POINTER(MpvNode)).contents.node_value(decoder), - MpvFormat.NODE_ARRAY: lambda v: cast(v, POINTER(POINTER(MpvNodeList))).contents.contents.array_value(decoder), - MpvFormat.NODE_MAP: lambda v: cast(v, POINTER(POINTER(MpvNodeList))).contents.contents.dict_value(decoder), - MpvFormat.BYTE_ARRAY: lambda v: cast(v, POINTER(POINTER(MpvByteArray))).contents.contents.bytes_value(), + MpvFormat.STRING: lambda v: decoder(v.string), + MpvFormat.OSD_STRING: lambda v: v.string.decode('utf-8'), + MpvFormat.FLAG: lambda v: bool(v.flag), + MpvFormat.INT64: lambda v: v.int64, + MpvFormat.DOUBLE: lambda v: v.double, + MpvFormat.NODE: lambda v: v.node.contents.node_value(decoder) if v.node else None, + MpvFormat.NODE_ARRAY: lambda v: v.list.contents.array_value(decoder) if v.list else None, + MpvFormat.NODE_MAP: lambda v: v.map.contents.dict_value(decoder) if v.map else None, + MpvFormat.BYTE_ARRAY: lambda v: v.byte_array.contents.bytes_value() if v.byte_array else None, }[fmt](v) +class MpvNodeUnion(Union): + _fields_ = [('string', c_char_p), + ('flag', c_int), + ('int64', c_int64), + ('double', c_double), + ('node', POINTER(MpvNode)), + ('list', POINTER(MpvNodeList)), + ('map', POINTER(MpvNodeList)), + ('byte_array', POINTER(MpvByteArray))] + +MpvNode._fields_ = [('val', MpvNodeUnion), + ('format', MpvFormat)] + MpvNodeList._fields_ = [('num', c_int), ('values', POINTER(MpvNode)), ('keys', POINTER(c_char_p))] @@ -241,7 +251,7 @@ class MpvEventProperty(Structure): _fields_ = [('name', c_char_p), ('format', MpvFormat), - ('data', c_void_p)] + ('data', MpvNodeUnion)] def as_dict(self, decoder=identity_decoder): value = MpvNode.node_cast_value(self.data, self.format.value, decoder) return {'name': self.name.decode('utf-8'), @@ -409,11 +419,11 @@ keys=None, values=( MpvNode * len(l))( *[ MpvNode( format=MpvFormat.STRING, - val=cast(pointer(p), POINTER(c_longlong)).contents) # NOTE: ctypes is kinda crappy here + val=MpvNodeUnion(string=p)) for p in char_ps ])) node = MpvNode( format=MpvFormat.NODE_ARRAY, - val=addressof(node_list)) + val=MpvNodeUnion(list=pointer(node_list))) return char_ps, node_list, node, cast(pointer(node), c_void_p) @@ -607,11 +617,10 @@ def node_command(self, name, *args, decoder=strict_decoder): _1, _2, _3, pointer = _make_node_str_list([name, *args]) out = cast(create_string_buffer(sizeof(MpvNode)), POINTER(MpvNode)) - outptr = out #byref(out) ppointer = cast(pointer, POINTER(MpvNode)) - _mpv_command_node(self.handle, ppointer, outptr) - rv = MpvNode.node_cast_value(outptr, MpvFormat.NODE, decoder) - _mpv_free_node_contents(outptr) + _mpv_command_node(self.handle, ppointer, out) + rv = out.contents.node_value(decoder=decoder) + _mpv_free_node_contents(out) return rv def seek(self, amount, reference="relative", precision="default-precise"): @@ -1023,14 +1032,18 @@ # Property accessors def _get_property(self, name, decoder=strict_decoder, fmt=MpvFormat.NODE): - out = cast(create_string_buffer(sizeof(c_void_p)), c_void_p) - outptr = byref(out) + out = create_string_buffer(sizeof(MpvNode)) try: - cval = _mpv_get_property(self.handle, name.encode('utf-8'), fmt, outptr) - rv = MpvNode.node_cast_value(outptr, fmt, decoder) - if fmt is MpvFormat.NODE: - _mpv_free_node_contents(outptr) - return rv + cval = _mpv_get_property(self.handle, name.encode('utf-8'), fmt, out) + + if fmt is MpvFormat.OSD_STRING: + return cast(out, POINTER(c_char_p)).contents.value.decode('utf-8') + elif fmt is MpvFormat.NODE: + rv = cast(out, POINTER(MpvNode)).contents.node_value(decoder=decoder) + _mpv_free_node_contents(out) + return rv + else: + raise TypeError('_get_property only supports NODE and OSD_STRING formats.') except PropertyUnavailableError as ex: return None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-mpv-0.3.6/python_mpv.egg-info/PKG-INFO new/python-mpv-0.3.8/python_mpv.egg-info/PKG-INFO --- old/python-mpv-0.3.6/python_mpv.egg-info/PKG-INFO 2017-09-19 12:12:54.000000000 +0200 +++ new/python-mpv-0.3.8/python_mpv.egg-info/PKG-INFO 2017-12-24 22:46:56.000000000 +0100 @@ -1,21 +1,20 @@ Metadata-Version: 1.1 Name: python-mpv -Version: 0.3.6 +Version: 0.3.8 Summary: A python interface to the mpv media player Home-page: https://github.com/jaseg/python-mpv Author: jaseg Author-email: [email protected] License: AGPLv3+ +Description-Content-Type: UNKNOWN Description: UNKNOWN Keywords: mpv,library,video,audio,player,display,multimedia Platform: UNKNOWN Classifier: Development Status :: 4 - Beta -Classifier: Environment :: Win32 (MS Windows) Classifier: Environment :: X11 Applications Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+) Classifier: Natural Language :: English -Classifier: Operating System :: Microsoft :: Windows Classifier: Operating System :: POSIX Classifier: Programming Language :: C Classifier: Programming Language :: Python :: 3.6 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-mpv-0.3.6/setup.py new/python-mpv-0.3.8/setup.py --- old/python-mpv-0.3.6/setup.py 2017-09-19 12:12:10.000000000 +0200 +++ new/python-mpv-0.3.8/setup.py 2017-12-24 22:46:17.000000000 +0100 @@ -3,7 +3,7 @@ from setuptools import setup setup( name = 'python-mpv', - version = '0.3.6', + version = '0.3.8', py_modules = ['mpv'], description = 'A python interface to the mpv media player', url = 'https://github.com/jaseg/python-mpv', @@ -17,12 +17,10 @@ 'multimedia'], classifiers = [ 'Development Status :: 4 - Beta', - 'Environment :: Win32 (MS Windows)', 'Environment :: X11 Applications', 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)', 'Natural Language :: English', - 'Operating System :: Microsoft :: Windows', 'Operating System :: POSIX', 'Programming Language :: C', 'Programming Language :: Python :: 3.6',
