Skip to content
This repository has been archived by the owner on Jun 15, 2022. It is now read-only.

Commit

Permalink
Format with autopep8
Browse files Browse the repository at this point in the history
  • Loading branch information
jodal committed Apr 2, 2015
1 parent b2b382a commit d5dba9d
Show file tree
Hide file tree
Showing 28 changed files with 47 additions and 0 deletions.
2 changes: 2 additions & 0 deletions setup.py
Expand Up @@ -20,13 +20,15 @@ def get_version(filename):


class CFFIBuild(build):

def finalize_options(self):
from spotify import ffi
self.distribution.ext_modules = [ffi.verifier.get_extension()]
build.finalize_options(self)


class CFFIInstall(install):

def finalize_options(self):
from spotify import ffi
self.distribution.ext_modules = [ffi.verifier.get_extension()]
Expand Down
2 changes: 2 additions & 0 deletions spotify/album.py
Expand Up @@ -17,6 +17,7 @@


class Album(object):

"""A Spotify album.
You can get an album from a track or an artist, or you can create an
Expand Down Expand Up @@ -187,6 +188,7 @@ def browse(self, callback=None):


class AlbumBrowser(object):

"""An album browser for a Spotify album.
You can get an album browser from any :class:`Album` instance by calling
Expand Down
2 changes: 2 additions & 0 deletions spotify/artist.py
Expand Up @@ -17,6 +17,7 @@


class Artist(object):

"""A Spotify artist.
You can get artists from tracks and albums, or you can create an
Expand Down Expand Up @@ -149,6 +150,7 @@ def browse(self, type=None, callback=None):


class ArtistBrowser(object):

"""An artist browser for a Spotify artist.
You can get an artist browser from any :class:`Artist` instance by calling
Expand Down
2 changes: 2 additions & 0 deletions spotify/audio.py
Expand Up @@ -15,6 +15,7 @@

class AudioBufferStats(collections.namedtuple(
'AudioBufferStats', ['samples', 'stutter'])):

"""Stats about the application's audio buffers."""
pass

Expand All @@ -30,6 +31,7 @@ class SampleType(utils.IntEnum):


class AudioFormat(object):

"""A Spotify audio format object.
You'll never need to create an instance of this class yourself, but you'll
Expand Down
1 change: 1 addition & 0 deletions spotify/config.py
Expand Up @@ -10,6 +10,7 @@


class Config(object):

"""The session config.
Create an instance and assign to its attributes to configure. Then use the
Expand Down
1 change: 1 addition & 0 deletions spotify/connection.py
Expand Up @@ -15,6 +15,7 @@


class Connection(object):

"""Connection controller.
You'll never need to create an instance of this class yourself. You'll find
Expand Down
3 changes: 3 additions & 0 deletions spotify/error.py
Expand Up @@ -12,6 +12,7 @@


class Error(Exception):

"""A Spotify error.
This is the superclass of all custom exceptions raised by pyspotify.
Expand All @@ -36,6 +37,7 @@ class ErrorType(utils.IntEnum):


class LibError(Error):

"""A libspotify error.
Where many libspotify functions return error codes that must be checked
Expand Down Expand Up @@ -68,6 +70,7 @@ def __ne__(self, other):


class Timeout(Error):

"""Exception raised by an operation not completing within the given
timeout."""

Expand Down
1 change: 1 addition & 0 deletions spotify/eventloop.py
Expand Up @@ -21,6 +21,7 @@


class EventLoop(threading.Thread):

"""Event loop for automatically processing events from libspotify.
The event loop is a :class:`~threading.Thread` that listens to
Expand Down
1 change: 1 addition & 0 deletions spotify/image.py
Expand Up @@ -18,6 +18,7 @@


class Image(object):

"""A Spotify image.
You can get images from :meth:`Album.cover`, :meth:`Artist.portrait`,
Expand Down
1 change: 1 addition & 0 deletions spotify/inbox.py
Expand Up @@ -15,6 +15,7 @@


class InboxPostResult(object):

"""The result object returned by :meth:`Session.inbox_post_tracks`."""

@serialized
Expand Down
1 change: 1 addition & 0 deletions spotify/link.py
Expand Up @@ -17,6 +17,7 @@


class Link(object):

"""A Spotify object link.
Call the :meth:`~Session.get_link` method on your :class:`Session` instance
Expand Down
2 changes: 2 additions & 0 deletions spotify/offline.py
Expand Up @@ -10,6 +10,7 @@


class Offline(object):

"""Offline sync controller.
You'll never need to create an instance of this class yourself. You'll find
Expand Down Expand Up @@ -53,6 +54,7 @@ def time_left(self):


class OfflineSyncStatus(object):

"""A Spotify offline sync status object.
You'll never need to create an instance of this class yourself. You'll find
Expand Down
1 change: 1 addition & 0 deletions spotify/player.py
Expand Up @@ -17,6 +17,7 @@ class PlayerState(object):


class Player(object):

"""Playback controller.
You'll never need to create an instance of this class yourself. You'll find
Expand Down
2 changes: 2 additions & 0 deletions spotify/playlist.py
Expand Up @@ -17,6 +17,7 @@


class Playlist(utils.EventEmitter):

"""A Spotify playlist.
You can get playlists from the :attr:`~Session.playlist_container`,
Expand Down Expand Up @@ -397,6 +398,7 @@ def off(self, event=None, listener=None):


class PlaylistEvent(object):

"""Playlist events.
Using :class:`Playlist` objects, you can register listener functions to be
Expand Down
4 changes: 4 additions & 0 deletions spotify/playlist_container.py
Expand Up @@ -20,6 +20,7 @@


class PlaylistContainer(collections.MutableSequence, utils.EventEmitter):

"""A Spotify playlist container.
The playlist container can be accessed as a regular Python collection to
Expand Down Expand Up @@ -407,6 +408,7 @@ def off(self, event=None, listener=None):


class PlaylistContainerEvent(object):

"""Playlist container events.
Using :class:`PlaylistContainer` objects, you can register listener
Expand Down Expand Up @@ -476,6 +478,7 @@ def container_loaded(playlist_container):


class _PlaylistContainerCallbacks(object):

"""Internal class."""

@classmethod
Expand Down Expand Up @@ -549,6 +552,7 @@ def container_loaded(sp_playlistcontainer, userdata):

class PlaylistFolder(collections.namedtuple(
'PlaylistFolder', ['id', 'name', 'type'])):

"""An object marking the start or end of a playlist folder."""
pass

Expand Down
1 change: 1 addition & 0 deletions spotify/playlist_track.py
Expand Up @@ -14,6 +14,7 @@


class PlaylistTrack(object):

"""A playlist track with metadata specific to the playlist.
Use :attr:`~spotify.Playlist.tracks_with_metadata` to get a list of
Expand Down
1 change: 1 addition & 0 deletions spotify/playlist_unseen_tracks.py
Expand Up @@ -16,6 +16,7 @@


class PlaylistUnseenTracks(collections.Sequence):

"""A list of unseen tracks in a playlist.
The list may contain items that are :class:`None`.
Expand Down
2 changes: 2 additions & 0 deletions spotify/search.py
Expand Up @@ -17,6 +17,7 @@


class Search(object):

"""A Spotify search result.
Call the :meth:`~Session.search` method on your :class:`Session` instance
Expand Down Expand Up @@ -339,6 +340,7 @@ def _search_complete_callback(sp_search, handle):


class SearchPlaylist(object):

"""A playlist matching a search query."""

name = None
Expand Down
3 changes: 3 additions & 0 deletions spotify/session.py
Expand Up @@ -19,6 +19,7 @@


class Session(utils.EventEmitter):

"""The Spotify session.
If no ``config`` is provided, the default config is used.
Expand Down Expand Up @@ -606,6 +607,7 @@ def get_toplist(


class SessionEvent(object):

"""Session events.
Using the :class:`Session` object, you can register listener functions to
Expand Down Expand Up @@ -879,6 +881,7 @@ def logged_in(session, error_type):


class _SessionCallbacks(object):

"""Internal class."""

@classmethod
Expand Down
3 changes: 3 additions & 0 deletions spotify/sink.py
Expand Up @@ -11,6 +11,7 @@


class Sink(object):

def on(self):
"""Turn on the audio sink.
Expand Down Expand Up @@ -44,6 +45,7 @@ def _close(self):


class AlsaSink(Sink):

"""Audio sink for systems using ALSA, e.g. most Linux systems.
This audio sink requires `pyalsaaudio
Expand Down Expand Up @@ -122,6 +124,7 @@ def _close(self):


class PortAudioSink(Sink):

"""Audio sink for `PortAudio <http://www.portaudio.com/>`_.
PortAudio is available for many platforms, including Linux, OS X, and
Expand Down
1 change: 1 addition & 0 deletions spotify/social.py
Expand Up @@ -11,6 +11,7 @@


class Social(object):

"""Social sharing controller.
You'll never need to create an instance of this class yourself. You'll find
Expand Down
1 change: 1 addition & 0 deletions spotify/toplist.py
Expand Up @@ -17,6 +17,7 @@


class Toplist(object):

"""A Spotify toplist of artists, albums or tracks that are currently most
popular worldwide or in a specific region.
Expand Down
1 change: 1 addition & 0 deletions spotify/track.py
Expand Up @@ -12,6 +12,7 @@


class Track(object):

"""A Spotify track.
You can get tracks from playlists or albums, or you can create a
Expand Down
1 change: 1 addition & 0 deletions spotify/user.py
Expand Up @@ -10,6 +10,7 @@


class User(object):

"""A Spotify user.
You can get users from the session, or you can create a :class:`User`
Expand Down
4 changes: 4 additions & 0 deletions spotify/utils.py
Expand Up @@ -23,6 +23,7 @@


class EventEmitter(object):

"""Mixin for adding event emitter functionality to a class."""

def __init__(self):
Expand Down Expand Up @@ -110,10 +111,12 @@ def call(self, event, *event_args):

class _Listener(collections.namedtuple(
'Listener', ['callback', 'user_args'])):

"""An listener of events from an :class:`EventEmitter`"""


class IntEnum(int):

"""An enum type for values mapping to integers.
Tries to stay as close as possible to the enum type specified in
Expand Down Expand Up @@ -256,6 +259,7 @@ def load(session, obj, timeout=None):


class Sequence(collections.Sequence):

"""Helper class for making sequences from a length and getitem function.
The ``sp_obj`` is assumed to already have gotten an extra reference through
Expand Down
1 change: 1 addition & 0 deletions tests/test_config.py
Expand Up @@ -11,6 +11,7 @@


class ConfigTest(unittest.TestCase):

def setUp(self):
self.config = spotify.Config()

Expand Down
1 change: 1 addition & 0 deletions tests/test_lib.py
Expand Up @@ -6,6 +6,7 @@


class LibTest(unittest.TestCase):

def test_sp_error_message(self):
self.assertEqual(
spotify.ffi.string(spotify.lib.sp_error_message(0)),
Expand Down
1 change: 1 addition & 0 deletions tests/test_loadable.py
Expand Up @@ -23,6 +23,7 @@ def load(self, timeout=None):


class FooWithError(Foo):

@property
def error(self):
return spotify.Error(spotify.Error.OK)
Expand Down

0 comments on commit d5dba9d

Please sign in to comment.