예제 #1
0
    def description(self):
        """The playlist's description.

        Will return :class:`None` if the description is unset.
        """
        description = lib.sp_playlist_get_description(self._sp_playlist)
        return utils.to_unicode_or_none(description)
예제 #2
0
파일: playlist.py 프로젝트: jcranston/juke
    def description(self):
        """The playlist's description.

        Will return :class:`None` if the description is unset.
        """
        description = lib.sp_playlist_get_description(self._sp_playlist)
        return utils.to_unicode_or_none(description)
예제 #3
0
파일: config.py 프로젝트: tupy/pyspotify
    def proxy(self):
        """URL to the proxy server that should be used.

        Defaults to :class:`None`.

        The format is protocol://host:port where protocol is
        http/https/socks4/socks5.
        """
        return utils.to_unicode_or_none(self._sp_session_config.proxy)
예제 #4
0
    def proxy(self):
        """URL to the proxy server that should be used.

        Defaults to :class:`None`.

        The format is protocol://host:port where protocol is
        http/https/socks4/socks5.
        """
        return utils.to_unicode_or_none(self._sp_session_config.proxy)
예제 #5
0
파일: config.py 프로젝트: tupy/pyspotify
    def device_id(self):
        """Device ID for offline synchronization and logging purposes.

        Defaults to :class:`None`.

        The Device ID must be unique to the particular device instance, i.e. no
        two units must supply the same Device ID. The Device ID must not change
        between sessions or power cycles. Good examples is the device's MAC
        address or unique serial number.
        """
        return utils.to_unicode_or_none(self._sp_session_config.device_id)
예제 #6
0
    def device_id(self):
        """Device ID for offline synchronization and logging purposes.

        Defaults to :class:`None`.

        The Device ID must be unique to the particular device instance, i.e. no
        two units must supply the same Device ID. The Device ID must not change
        between sessions or power cycles. Good examples is the device's MAC
        address or unique serial number.
        """
        return utils.to_unicode_or_none(self._sp_session_config.device_id)
예제 #7
0
파일: config.py 프로젝트: tupy/pyspotify
    def proxy_password(self):
        """Password to authenticate with proxy server.

        Defaults to :class:`None`.
        """
        return utils.to_unicode_or_none(self._sp_session_config.proxy_password)
예제 #8
0
파일: config.py 프로젝트: tupy/pyspotify
    def user_agent(self):
        """A string with the name of your client.

        Defaults to ``pyspotify 2.x.y``.
        """
        return utils.to_unicode_or_none(self._sp_session_config.user_agent)
예제 #9
0
 def message(self):
     """A message attached to the track. Typically used in the inbox."""
     message = lib.sp_playlist_track_message(self._sp_playlist, self._index)
     return utils.to_unicode_or_none(message)
예제 #10
0
 def test_anything_else_fails(self):
     with self.assertRaises(ValueError):
         utils.to_unicode_or_none('æøå')
예제 #11
0
    def test_char_becomes_bytes(self):
        result = utils.to_unicode_or_none(
            spotify.ffi.new('char[]', 'æøå'.encode('utf-8'))
        )

        self.assertEqual(result, 'æøå')
예제 #12
0
 def test_null_becomes_none(self):
     self.assertEqual(utils.to_unicode_or_none(spotify.ffi.NULL), None)
예제 #13
0
    def proxy_password(self):
        """Password to authenticate with proxy server.

        Defaults to :class:`None`.
        """
        return utils.to_unicode_or_none(self._sp_session_config.proxy_password)
예제 #14
0
    def user_agent(self):
        """A string with the name of your client.

        Defaults to ``pyspotify 2.x.y``.
        """
        return utils.to_unicode_or_none(self._sp_session_config.user_agent)