コード例 #1
0
ファイル: playlist.py プロジェクト: bancran/pyspotify
    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
ファイル: config.py プロジェクト: cwallac/SpotifyWebApp
    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
ファイル: config.py プロジェクト: cwallac/SpotifyWebApp
    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
ファイル: test_utils.py プロジェクト: mdries14887/pyspotify
 def test_anything_else_fails(self):
     with self.assertRaises(ValueError):
         utils.to_unicode_or_none('æøå')
コード例 #11
0
ファイル: test_utils.py プロジェクト: mdries14887/pyspotify
    def test_char_becomes_bytes(self):
        result = utils.to_unicode_or_none(
            spotify.ffi.new('char[]', 'æøå'.encode('utf-8'))
        )

        self.assertEqual(result, 'æøå')
コード例 #12
0
ファイル: test_utils.py プロジェクト: mdries14887/pyspotify
 def test_null_becomes_none(self):
     self.assertEqual(utils.to_unicode_or_none(spotify.ffi.NULL), None)
コード例 #13
0
ファイル: config.py プロジェクト: cwallac/SpotifyWebApp
    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
ファイル: config.py プロジェクト: cwallac/SpotifyWebApp
    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)