Hello community, here is the log from the commit of package python-python-mpv for openSUSE:Factory checked in at 2018-07-28 12:44:18 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-python-mpv (Old) and /work/SRC/openSUSE:Factory/.python-python-mpv.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-python-mpv" Sat Jul 28 12:44:18 2018 rev:4 rq:625715 version:0.3.9 Changes: -------- --- /work/SRC/openSUSE:Factory/python-python-mpv/python-python-mpv.changes 2018-05-11 09:14:26.166860243 +0200 +++ /work/SRC/openSUSE:Factory/.python-python-mpv.new/python-python-mpv.changes 2018-07-28 12:44:21.592876278 +0200 @@ -1,0 +2,5 @@ +Thu Jul 26 18:38:59 UTC 2018 - aloi...@gmx.com + +- Update to version 0.3.9 (no changelog supplied) + +------------------------------------------------------------------- Old: ---- python-mpv-0.3.8.tar.gz New: ---- python-mpv-0.3.9.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-python-mpv.spec ++++++ --- /var/tmp/diff_new_pack.c9nOcB/_old 2018-07-28 12:44:22.248877470 +0200 +++ /var/tmp/diff_new_pack.c9nOcB/_new 2018-07-28 12:44:22.248877470 +0200 @@ -18,10 +18,10 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-python-mpv -Version: 0.3.8 +Version: 0.3.9 Release: 0 Summary: Python interface to the mpv media player -License: AGPL-3.0+ +License: AGPL-3.0-or-later Group: Development/Languages/Python Url: https://github.com/jaseg/python-mpv Source0: https://files.pythonhosted.org/packages/source/p/python-mpv/python-mpv-%{version}.tar.gz ++++++ python-mpv-0.3.8.tar.gz -> python-mpv-0.3.9.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-mpv-0.3.8/PKG-INFO new/python-mpv-0.3.9/PKG-INFO --- old/python-mpv-0.3.8/PKG-INFO 2017-12-24 22:46:56.000000000 +0100 +++ new/python-mpv-0.3.9/PKG-INFO 2018-07-25 12:08:50.000000000 +0200 @@ -1,12 +1,11 @@ -Metadata-Version: 1.1 +Metadata-Version: 2.1 Name: python-mpv -Version: 0.3.8 +Version: 0.3.9 Summary: A python interface to the mpv media player Home-page: https://github.com/jaseg/python-mpv Author: jaseg Author-email: git...@jaseg.net License: AGPLv3+ -Description-Content-Type: UNKNOWN Description: UNKNOWN Keywords: mpv,library,video,audio,player,display,multimedia Platform: UNKNOWN @@ -21,3 +20,4 @@ Classifier: Programming Language :: Python :: 3.5 Classifier: Topic :: Multimedia :: Sound/Audio :: Players Classifier: Topic :: Multimedia :: Video :: Display +Provides-Extra: screenshot_raw diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-mpv-0.3.8/README.rst new/python-mpv-0.3.9/README.rst --- old/python-mpv-0.3.8/README.rst 2017-08-23 09:06:47.000000000 +0200 +++ new/python-mpv-0.3.9/README.rst 2017-12-25 13:32:27.000000000 +0100 @@ -36,6 +36,19 @@ .. _`issue`: https://github.com/jaseg/python-mpv/issues .. _`pull request`: https://github.com/jaseg/python-mpv/pulls +Supported Platforms +................... + +**Linux**, **Windows** and **OSX** all seem to work mostly fine. For some notes on the installation on Windows see +`this comment`__. Shared library handling is quite bad on windows, so expect some pain there. On OSX there seems to be +some bug int the event logic. See `issue 36`_ and `issue 61`_ for details. Creating a pyQT window and having mpv draw +into it seems to be a workaround (about 10loc), but in case you want this fixed please weigh in on the issue tracker +since right now there is not many OSX users. + +.. __: https://github.com/jaseg/python-mpv/issues/60#issuecomment-352719773 +.. _`issue 61`: https://github.com/jaseg/python-mpv/issues/61 +.. _`issue 36`: https://github.com/jaseg/python-mpv/issues/36 + Usage ----- @@ -45,7 +58,6 @@ player = mpv.MPV(ytdl=True) player.play('https://youtu.be/DOmdB7D-pUU') - Threading ~~~~~~~~~ @@ -63,6 +75,9 @@ Advanced Usage ~~~~~~~~~~~~~~ +Logging, Properties, Python Key Bindings, Screenshots and youtube-dl +.................................................................... + .. code:: python #!/usr/bin/env python3 @@ -99,6 +114,9 @@ del player +Playlist handling +................. + .. code:: python #!/usr/bin/env python3 @@ -117,7 +135,42 @@ print(player.playlist) player.wait_for_playback() -Coding conventions +PyQT embedding +.............. + +.. code:: python + + #!/usr/bin/env python3 + import mpv + import sys + + from PyQt5.QtWidgets import * + from PyQt5.QtCore import * + + class Test(QMainWindow): + def __init__(self, parent=None): + super().__init__(parent) + self.container = QWidget(self) + self.setCentralWidget(self.container) + self.container.setAttribute(Qt.WA_DontCreateNativeAncestors) + self.container.setAttribute(Qt.WA_NativeWindow) + player = mpv.MPV(wid=str(int(self.container.winId())), + vo='x11', # You may not need this + log_handler=print, + loglevel='debug') + player.play('test.webm') + + app = QApplication(sys.argv) + + # This is necessary since PyQT stomps over the locale settings needed by libmpv. + # This needs to happen after importing PyQT before creating the first mpv.MPV instance. + import locale + locale.setlocale(locale.LC_NUMERIC, 'C') + win = Test() + win.show() + sys.exit(app.exec_()) + +Coding Conventions ------------------ The general aim is `PEP 8`_, with liberal application of the "consistency" section. 120 cells line width. Four spaces. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-mpv-0.3.8/mpv.py new/python-mpv-0.3.9/mpv.py --- old/python-mpv-0.3.8/mpv.py 2017-12-24 22:31:54.000000000 +0100 +++ new/python-mpv-0.3.9/mpv.py 2018-07-25 12:02:23.000000000 +0200 @@ -196,18 +196,31 @@ @staticmethod def node_cast_value(v, fmt=MpvFormat.NODE, decoder=identity_decoder): - return { - MpvFormat.NONE: lambda v: None, - 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) + if fmt == MpvFormat.NONE: + return None + elif fmt == MpvFormat.STRING: + return decoder(v.string) + elif fmt == MpvFormat.OSD_STRING: + return v.string.decode('utf-8') + elif fmt == MpvFormat.FLAG: + return bool(v.flag) + elif fmt == MpvFormat.INT64: + return v.int64 + elif fmt == MpvFormat.DOUBLE: + return v.double + else: + if not v.node: # Check for null pointer + return None + if fmt == MpvFormat.NODE: + return v.node.contents.node_value(decoder) + elif fmt == MpvFormat.NODE_ARRAY: + return v.list.contents.array_value(decoder) + elif fmt == MpvFormat.NODE_MAP: + return v.map.contents.dict_value(decoder) + elif fmt == MpvFormat.BYTE_ARRAY: + return v.byte_array.contents.bytes_value() + else: + raise TypeError('Unknown MPV node format {}. Please submit a bug report.'.format(fmt)) class MpvNodeUnion(Union): _fields_ = [('string', c_char_p), @@ -742,7 +755,7 @@ """Mapped mpv osd command, see man mpv(1).""" self.command('osd') - def show_text(self, string, duration='-', level=None): + def show_text(self, string, duration='-1', level=None): """Mapped mpv show_text command, see man mpv(1).""" self.command('show_text', string, duration, level) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-mpv-0.3.8/python_mpv.egg-info/PKG-INFO new/python-mpv-0.3.9/python_mpv.egg-info/PKG-INFO --- old/python-mpv-0.3.8/python_mpv.egg-info/PKG-INFO 2017-12-24 22:46:56.000000000 +0100 +++ new/python-mpv-0.3.9/python_mpv.egg-info/PKG-INFO 2018-07-25 12:08:50.000000000 +0200 @@ -1,12 +1,11 @@ -Metadata-Version: 1.1 +Metadata-Version: 2.1 Name: python-mpv -Version: 0.3.8 +Version: 0.3.9 Summary: A python interface to the mpv media player Home-page: https://github.com/jaseg/python-mpv Author: jaseg Author-email: git...@jaseg.net License: AGPLv3+ -Description-Content-Type: UNKNOWN Description: UNKNOWN Keywords: mpv,library,video,audio,player,display,multimedia Platform: UNKNOWN @@ -21,3 +20,4 @@ Classifier: Programming Language :: Python :: 3.5 Classifier: Topic :: Multimedia :: Sound/Audio :: Players Classifier: Topic :: Multimedia :: Video :: Display +Provides-Extra: screenshot_raw diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-mpv-0.3.8/setup.py new/python-mpv-0.3.9/setup.py --- old/python-mpv-0.3.8/setup.py 2017-12-24 22:46:17.000000000 +0100 +++ new/python-mpv-0.3.9/setup.py 2018-07-25 12:07:26.000000000 +0200 @@ -3,7 +3,7 @@ from setuptools import setup setup( name = 'python-mpv', - version = '0.3.8', + version = '0.3.9', py_modules = ['mpv'], description = 'A python interface to the mpv media player', url = 'https://github.com/jaseg/python-mpv',