Update of /cvsroot/freevo/freevo/src/audio
In directory sc8-pr-cvs1:/tmp/cvs-serv23782/audio
Modified Files:
__init__.py audioitem.py
Log Message:
move to new Item attributes
Index: __init__.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/audio/__init__.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** __init__.py 8 Dec 2003 15:59:39 -0000 1.14
--- __init__.py 29 Dec 2003 22:09:18 -0000 1.15
***************
*** 10,13 ****
--- 10,16 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.15 2003/12/29 22:09:18 dischi
+ # move to new Item attributes
+ #
# Revision 1.14 2003/12/08 15:59:39 mikeruelle
# change cwd to get
***************
*** 185,193 ****
a.name = fxd.getattr(node, 'title', a.name)
! a.xml_file = fxd.getattr(None, 'filename', '')
a.image = fxd.childcontent(node, 'cover-img')
a.url = fxd.childcontent(node, 'url')
if a.image:
! a.image = vfs.join(vfs.dirname(a.xml_file), a.image)
a.mplayer_options = fxd.childcontent(node, 'mplayer_options')
--- 188,196 ----
a.name = fxd.getattr(node, 'title', a.name)
! a.fxd_file = fxd.getattr(None, 'filename', '')
a.image = fxd.childcontent(node, 'cover-img')
a.url = fxd.childcontent(node, 'url')
if a.image:
! a.image = vfs.join(vfs.dirname(a.fxd_file), a.image)
a.mplayer_options = fxd.childcontent(node, 'mplayer_options')
Index: audioitem.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/audio/audioitem.py,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** audioitem.py 12 Dec 2003 19:20:46 -0000 1.42
--- audioitem.py 29 Dec 2003 22:09:18 -0000 1.43
***************
*** 10,13 ****
--- 10,16 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.43 2003/12/29 22:09:18 dischi
+ # move to new Item attributes
+ #
# Revision 1.42 2003/12/12 19:20:46 dischi
# use util functions to get the image
***************
*** 59,63 ****
from player import PlayerGUI
from item import Item
- import mmpython
--- 62,65 ----
***************
*** 67,89 ****
"""
! def __init__(self, file, parent, name = None, scan = True):
! if scan:
! if parent and parent.media:
! url = 'cd://%s:%s:%s' % (parent.media.devicename,
parent.media.mountdir,
! file[len(parent.media.mountdir)+1:])
! else:
! url = file
! Item.__init__(self, parent, mmpython.parse(url))
! else:
! Item.__init__(self, parent)
!
! self.filename = file[:]
! self.url = None
if name:
self.name = name
! elif not self.name:
! self.name = util.getname(file)
! self.type = 'audio'
!
self.start = 0
self.elapsed = 0
--- 69,81 ----
"""
! def __init__(self, url, parent, name=None, scan=True):
! Item.__init__(self, parent, info=scan)
!
! self.type = 'audio'
! self.set_url(url, info=scan)
!
if name:
self.name = name
!
self.start = 0
self.elapsed = 0
***************
*** 93,96 ****
--- 85,90 ----
self.valid = 1
+ self.mplayer_options = ''
+
try:
self.length = self.info['length']
***************
*** 98,109 ****
self.length = 0
- self.image = util.getimage(os.path.dirname(file)+'/cover', self.image)
-
- # Allow per mp3 covers. As per Chris' request ;)
- self.image = util.getimage(file[:file.rfind('.')], self.image)
-
# Let's try to find if there is any image in the current directory
# that could be used as a cover
! if file and not self.image and not file.find('://') != -1:
images = ()
covers = ()
--- 92,98 ----
self.length = 0
# 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 = ()
***************
*** 117,121 ****
# the configurable regexp
try:
! files = os.listdir(os.path.dirname(file))
except OSError:
print "oops, os.listdir() error"
--- 106,110 ----
# the configurable regexp
try:
! files = os.listdir(self.dirname)
except OSError:
print "oops, os.listdir() error"
***************
*** 124,132 ****
image = None
if len(images) == 1:
! image = os.path.join(os.path.dirname(file), images[0])
elif len(images) > 1:
covers = filter(cover_filter, images)
if covers:
! image = os.path.join(os.path.dirname(file), covers[0])
self.image = image
--- 113,121 ----
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
***************
*** 146,150 ****
self.pause = obj.pause
self.valid = obj.valid
! self.url = obj.url
--- 135,140 ----
self.pause = obj.pause
self.valid = obj.valid
!
! self.mplayer_options = obj.mplayer_options
***************
*** 155,167 ****
"""
if mode == 'date':
! return '%s%s' % (os.stat(self.filename).st_ctime, self.filename)
! return self.filename
! def getattr(self, attr):
"""
return the specific attribute as string or an empty string
"""
! if attr == 'length' and self.length:
# maybe the length was wrong
if self.length < self.elapsed:
--- 145,158 ----
"""
if mode == 'date':
! if self.filename:
! return '%s%s' % (os.stat(self.filename).st_ctime, self.filename)
! return self.url
! def __getitem__(self, key):
"""
return the specific attribute as string or an empty string
"""
! if key == 'length' and self.length:
# maybe the length was wrong
if self.length < self.elapsed:
***************
*** 169,176 ****
return '%d:%02d' % (int(self.length / 60), int(self.length % 60))
! if attr == 'elapsed':
return '%d:%02d' % (int(self.elapsed / 60), int(self.elapsed % 60))
! return Item.getattr(self, attr)
--- 160,167 ----
return '%d:%02d' % (int(self.length / 60), int(self.length % 60))
! if key == 'elapsed':
return '%d:%02d' % (int(self.elapsed / 60), int(self.elapsed % 60))
! return Item.__getitem__(self, key)
-------------------------------------------------------
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