…t to build "git clean -fdx" dos a good job, too, no need to do overwork.
…in the egg Previously, all data in `data_files` and `package_data` were installed along the Python's code, which might not be actually wanted (that's true at least for man pages for examples). This tentatively fixes #5 ("Installer puts $installdir/share stuff in wrong place"). Following an answer from PJ Eby at http://mail.python.org/pipermail/distutils-sig/2011-December/018218.html
Now that icons are stored within the egg and that we can use pkg_resources to find them, this also remove a bunch of lines which wer trying to guess where was the icons.
Before, it was required to pass by the .call() method. Now, we can call directly the command we are interested in, which is more convenient and much clearer. .call() is still availabl, since it has a "complex" logic inside, and used for two calls which only the MPD command to execute from a string as argument.
There's still a lot of things to do: * remove the explicit call() method and implements __getattribute__ instead to proxy the calls to the underlying mpd.MPDClient() object * rename the object MPDH into something nicer * implement a nice object to remove the crufty calls to mpdh.get(): currsong() should return some more high level than now, which knows how to handle song information (adapter around the result of mpd.currentsong()) * try to remove the prevsonginfo/prevstatus/prevcon from main.py
The launch script has been moved to the 'sonata' package, as the rest of the code, an put into a dedicated function, that is launch now by a very simple script at the top level. It will allow to 'import sonata' from the source repository and having the right behavior ('sonata' will by the package not the top level script). Additionnaly, Sonata now depends on setuptools/distribute to generate automatically a good startup script. Both the commited one and the one created by setuptools can be used.
The trick is to transform HTML entities, like '<' into '<', so that we don't have to expect one or the other in the code, we always have the 'nicest' representation.
…s it clearer
Previously, this was done in the main module, which had to guess a bit how the lyrics system was working: the lyrics file had to be deleted before fetching the new lyrics, and the call to the function which located the lyrics file was buggy. This fixes the following error on fetching a song throught the "Search" button: Traceback (most recent call last): File ".../sonata/info.py", line 221, in on_link_click self.on_link_click_cb(linktype) File ".../sonata/main.py", line 3242, in on_link_click self.on_lyrics_search(None) File ".../sonata/main.py", line 2214, in on_lyrics_search consts.LYRICS_LOCATION_HOME) File ".../sonata/info.py", line 534, in target_lyrics_filename os.path.join(*file_map[lyrics_loc])) File "/usr/lib/python2.6/posixpath.py", line 65, in join if b.startswith('/'): AttributeError: 'NoneType' object has no attribute 'startswith' Now, we let the lyrics system handle all of this, and we ask it to force the fetching, even if a lyrics file already existed.
Fix not showing (or showing at strange position) sonata if it's not sticky ('Show window on all workspaces' option isn't set) and before clicking on tray icon sonata was not on the current workspace.
Improve handling of multi-CD albums: - revert 8cb4b55 that fixes the problem with showing multi-CD albums multiple times, but it breaks artwork caching for album view. As the album path is ignored we search artwork with path=None and as the result when Artwork.artwork_get_local_image is called with songpath=None it looks for artwork in the directory of current song. So all the albums get the same artwork and the art_cache is broken. - add Base.get_multicd_album_root_dir method to get album root directory for tracks from multi-CD albums. For example, if track is located in 'artist/album/CD 2' directory than the method returns 'artist/album'. This method is used in artwork search algorithm (to look for artwork in album root directory but not in CD's subdirectory) and while populating album view (to merge all CDs into single album entry).