summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <wyskas@gmail.com>2009-03-02 16:39:59 +0100
committerAnton Khirnov <wyskas@gmail.com>2009-03-02 16:39:59 +0100
commit1fc350e98515b4e80ee74382e7bb8e5f4bca493e (patch)
tree460eb06ba1c790b660f8ceb91d79a2cd040ecad8
parentc5aecf3db2c36a179e7c0f3923d4b2bbf86e2797 (diff)
AlbumCover: cosmetics.
-rw-r--r--nephilim/plugins/AlbumCover.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/nephilim/plugins/AlbumCover.py b/nephilim/plugins/AlbumCover.py
index 65e648f..2fe644a 100644
--- a/nephilim/plugins/AlbumCover.py
+++ b/nephilim/plugins/AlbumCover.py
@@ -1,8 +1,6 @@
from PyQt4 import QtGui, QtCore
from PyQt4.QtCore import QVariant
from traceback import print_exc
-import os
-import shutil
import logging
from ..clPlugin import Plugin
@@ -14,13 +12,12 @@ AC_FETCH_LOCAL_DIR = 1
AC_FETCH_AMAZON = 2
class wgAlbumCover(QtGui.QLabel):
- " container for the image"
- cover = None
+ cover = None #cover pixmap
cover_loaded = False
- p = None
+ p = None #plugin
cover_dirname = None
cover_filepath = None
- menu = None
+ menu = None #popup menu
def __init__(self, p):
QtGui.QLabel.__init__(self)
@@ -65,11 +62,11 @@ class wgAlbumCover(QtGui.QLabel):
self.cover_dirname = expand_tags(dirname, (self.p.winMain, song))
filebase = self.p.settings.value(self.p.getName() + '/covername').toString()
self.cover_filepath = '%s/%s'%(self.cover_dirname,
- expand_tags(filebase, (self.p.winMain, song)).replace(os.path.sep, '_'))
+ expand_tags(filebase, (self.p.winMain, song)).replace('/', '_'))
self.fetch_cover(song)
def fetch_cover(self, song):
- if not os.path.exists(self.cover_filepath):
+ if not QtCore.QFile.exists(self.cover_filepath):
for i in (0, 1):
src = self.p.settings.value(self.p.getName() + '/method%i'%i).toInt()[0]
if src == AC_FETCH_LOCAL_DIR: