This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
====================================
Python usable definiton of MPRIS2
====================================

This is my lib to help developers work with MPRIS2 and python

See Mpris2 site (http://specifications.freedesktop.org/mpris-spec/2.2/)

See also:
========

pympris (https://github.com/wistful/pympris)


Example:
========

Here is some examples, that shows how to work with this lib.


Configure dbus and mainloop
---------------------------

>>> # configure mainloop (not required if you wont expect signals)
>>> from dbus.mainloop.glib import DBusGMainLoop
>>> DBusGMainLoop(set_as_default=True)


Discover your player mpris uri
------------------------------

>>> # you can use get_players_uri to get current running players uri
>>> from mpris2 import get_players_uri
>>> # next raise StopIteration if not found
>>> uri = next(get_players_uri())


Connect to player
-----------------

>>> # create you player
>>> from mpris2 import Player
>>> player = Player(dbus_interface_info={'dbus_uri': uri})


Call methods
------------


>>> player.Next() # play next media


Get attributes
--------------

>>> print(player.Metadata) #current media data


Wait signal
-----------


>>> def another_handler(self, *args, **kw):
>>> print(args, kw)
>>>
>>> player.PropertiesChanged = another_handler
>>> # python3
>>> import gi.repository.GLib
>>> mloop = gi.repository.GLib.MainLoop()
>>> mloop.run()


Other examples:
---------------

>>> # old versions mainloop
>>> import gobject
>>> mloop = gobject.MainLoop()

>>> # list all running players
>>> from mpris2 import get_players_uri
>>> print([uri for uri in get_players_uri()])
>>> # get_players_uri can be called with filter parameter
>>> get_players_uri('.+rhythmbox')
>>> # you can set it yourself
>>> uri = 'org.mpris.MediaPlayer2.gmusicbrowser'
>>> # or use one predefined
>>> from mpris2 import SomePlayers, Interfaces
>>> uri = '.'.join([Interfaces.MEDIA_PLAYER, SomePlayers.GMUSICBROWSER])

>>> # test other interfaces
>>> from mpris2 import MediaPlayer2
>>> mp2 = MediaPlayer2(dbus_interface_info={'dbus_uri': uri})
>>> # not all players implement this:
>>> from mpris2 import Playlists, TrackList
>>> pls = Playlists(dbus_interface_info={'dbus_uri': uri})
>>> tl = TrackList(dbus_interface_info={'dbus_uri': uri})
Release History

Release History

1.0.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.9

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
mpris2-1.0.2.tar.gz (20.9 kB) Copy SHA256 Checksum SHA256 Source May 31, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting