From: Ivan Frade Date: Sun, 28 Jun 2009 05:20:19 +0000 (+0300) Subject: PIL as mandatory dependency, libxml optional X-Git-Tag: mussorgsky-0.1-1~13 X-Git-Url: http://git.maemo.org/git/?a=commitdiff_plain;h=c0232df0b305ddc991ac5958a4904da4aa2b57ce;hp=f254dbcb5acd11e5ab9125d3abfbec926ee6d95c;p=mussorgsky PIL as mandatory dependency, libxml optional --- diff --git a/debian/control b/debian/control index 8bd2de8..ae993b4 100644 --- a/debian/control +++ b/debian/control @@ -11,8 +11,8 @@ Package: mussorgsky Architecture: all Depends: ${python:Depends}, python-mutagen, python-hildon, python-dbus, tracker, python-gst0.10, - python2.5-gobject -Optional: python2.5-libxml2, python-imaging + python2.5-gobject, python-imaging +Optional: python2.5-libxml2 XB-Python-Version: current, >=2.5 Description: Music Organizer, audio files metadata editor Mussorgsky is a tool to set the basic metadata in the audio files diff --git a/src/album_art.py b/src/album_art.py index 1933d72..007c929 100755 --- a/src/album_art.py +++ b/src/album_art.py @@ -1,16 +1,21 @@ #!/usr/bin/env python2.5 import urllib2, urllib -import libxml2 import os from album_art_spec import getCoverArtFileName, getCoverArtThumbFileName, get_thumb_filename_for_path import dbus, time import string try: + import libxml2 + libxml_available = True +except ImportError: + libxml_available = False + +try: import PIL import Image pil_available = True -except ImportException: +except ImportError: pil_available = False @@ -70,10 +75,14 @@ class MussorgskyAlbumArt: print "Failed doing thumbnail. Probably album art is not an image!" os.remove (filename) return (None, None) - + return (filename, thumbnail) def __last_fm (self, artist, album): + + if (not libxml_available): + return None + if (not album or len (album) < 1): return None