Update of /cvsroot/freevo/freevo/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18812
Modified Files:
item.py
Log Message:
some attr fixes/movements
Index: item.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/item.py,v
retrieving revision 1.69
retrieving revision 1.70
diff -C2 -d -r1.69 -r1.70
*** item.py 14 Feb 2004 15:06:25 -0000 1.69
--- item.py 15 Feb 2004 15:23:55 -0000 1.70
***************
*** 10,13 ****
--- 10,16 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.70 2004/02/15 15:23:55 dischi
+ # some attr fixes/movements
+ #
# Revision 1.69 2004/02/14 15:06:25 dischi
# add basic sort function
***************
*** 458,487 ****
return the specific attribute
"""
- if attr == 'runtime':
- length = None
-
- if self.info['runtime'] and self.info['runtime'] != 'None':
- length = self.info['runtime']
- elif self.info['length'] and self.info['length'] != 'None':
- length = self.info['length']
- if not length and hasattr(self, 'length'):
- length = self.length
- if not length:
- return ''
-
- if isinstance(length, int) or isinstance(length, float) or \
- isinstance(length, long):
- length = str(int(round(length) / 60))
- if length.find('min') == -1:
- length = '%s min' % length
- if length.find('/') > 0:
- length = length[:length.find('/')].rstrip()
- if length.find(':') > 0:
- length = length[length.find(':')+1:]
- if length == '0 min':
- return ''
- return length
-
-
if attr == 'length':
try:
--- 461,464 ----
***************
*** 502,505 ****
--- 479,497 ----
+ if attr == 'length:min':
+ try:
+ length = int(self.info['length'])
+ except ValueError:
+ return self.info['length']
+ except:
+ try:
+ length = int(self.length)
+ except:
+ return ''
+ if length == 0:
+ return ''
+ return '%d min' % (length / 60)
+
+
if attr[:4] == 'len(' and attr[-1] == ')':
r = None
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog