Update of /cvsroot/freevo/freevo/src/audio
In directory sc8-pr-cvs1:/tmp/cvs-serv20198/audio
Modified Files:
__init__.py audioitem.py
Log Message:
changes, related to item.py changes
Index: __init__.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/audio/__init__.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** __init__.py 29 Dec 2003 22:09:18 -0000 1.15
--- __init__.py 31 Dec 2003 16:42:40 -0000 1.16
***************
*** 10,13 ****
--- 10,16 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.16 2003/12/31 16:42:40 dischi
+ # changes, related to item.py changes
+ #
# Revision 1.15 2003/12/29 22:09:18 dischi
# move to new Item attributes
***************
*** 62,65 ****
--- 65,69 ----
#endif
+ import os
import re
***************
*** 72,75 ****
--- 76,83 ----
+ def cover_filter(x):
+ return re.search(config.AUDIO_COVER_REGEXP, x, re.IGNORECASE)
+
+
class PluginInterface(plugin.MimetypePlugin):
"""
***************
*** 129,157 ****
"""
if not diritem.image:
- images = ()
- covers = ()
- files =()
-
- def image_filter(x):
- return re.match('.*(jpg|png)$', x, re.IGNORECASE)
- def cover_filter(x):
- return re.search(config.AUDIO_COVER_REGEXP, x, re.IGNORECASE)
-
# Pick an image if it is the only image in this dir, or it matches
# the configurable regexp
! try:
! files = vfs.listdir(diritem.dir)
! except OSError:
! print "oops, os.listdir() error"
! traceback.print_exc()
! images = filter(image_filter, files)
! image = None
! if len(images) == 1:
! image = vfs.join(diritem.dir, images[0])
! elif len(images) > 1:
! covers = filter(cover_filter, images)
if covers:
! image = vfs.join(diritem.dir, covers[0])
! diritem.image = image
--- 137,150 ----
"""
if not diritem.image:
# Pick an image if it is the only image in this dir, or it matches
# the configurable regexp
! files = util.find_matches(vfs.listdir(diritem.dir), ('jpg', 'gif', 'png'
))
!
! if len(files) == 1:
! diritem.image = os.path.join(diritem.dir, files[0])
! elif len(files) > 1:
! covers = filter(cover_filter, files)
if covers:
! diritem.image = os.path.join(diritem.dir, covers[0])
Index: audioitem.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/audio/audioitem.py,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** audioitem.py 30 Dec 2003 15:34:42 -0000 1.44
--- audioitem.py 31 Dec 2003 16:42:40 -0000 1.45
***************
*** 10,13 ****
--- 10,16 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.45 2003/12/31 16:42:40 dischi
+ # changes, related to item.py changes
+ #
# Revision 1.44 2003/12/30 15:34:42 dischi
# remove unneeded copy function
***************
*** 97,101 ****
# Let's try to find if there is any image in the current directory
# that could be used as a cover
! if self.filename and not self.image:
images = ()
covers = ()
--- 100,105 ----
# Let's try to find if there is any image in the current directory
# that could be used as a cover
! if self.filename and not self.image and not \
! (self.parent and self.parent.type == 'dir'):
images = ()
covers = ()
***************
*** 108,113 ****
# Pick an image if it is the only image in this dir, or it matches
# the configurable regexp
try:
! files = os.listdir(self.dirname)
except OSError:
print "oops, os.listdir() error"
--- 112,118 ----
# Pick an image if it is the only image in this dir, or it matches
# the configurable regexp
+ dirname = os.path.dirname(self.filename)
try:
! files = os.listdir(dirname)
except OSError:
print "oops, os.listdir() error"
***************
*** 116,124 ****
image = None
if len(images) == 1:
! image = os.path.join(self.dirname, images[0])
elif len(images) > 1:
covers = filter(cover_filter, images)
if covers:
! image = os.path.join(self.dirname, covers[0])
self.image = image
--- 121,129 ----
image = None
if len(images) == 1:
! image = os.path.join(dirname, images[0])
elif len(images) > 1:
covers = filter(cover_filter, images)
if covers:
! image = os.path.join(dirname, covers[0])
self.image = image
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog