Update of /cvsroot/freevo/freevo/src
In directory sc8-pr-cvs1:/tmp/cvs-serv15354/src
Modified Files:
util.py
Log Message:
A cmpfunc for doing a "smart sort" which is to say, a sort that ignores
"The" at the beginning of titles. Doesn't do anything yet.
Index: util.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/util.py,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** util.py 8 Jun 2003 05:43:25 -0000 1.28
--- util.py 13 Jun 2003 18:19:57 -0000 1.29
***************
*** 10,13 ****
--- 10,17 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.29 2003/06/13 18:19:57 outlyer
+ # A cmpfunc for doing a "smart sort" which is to say, a sort that ignores
+ # "The" at the beginning of titles. Doesn't do anything yet.
+ #
# Revision 1.28 2003/06/08 05:43:25 outlyer
# Moved 'image-viewer-thumb.jpg' into the thumbnails part of the cachedir
***************
*** 513,517 ****
return s[statvfs.F_BAVAIL] * long(s[statvfs.F_BSIZE])
!
def totalspace(path):
"""
--- 517,534 ----
return s[statvfs.F_BAVAIL] * long(s[statvfs.F_BSIZE])
! def smartsort(x,y): # A compare function for use in list.sort()
! """
! Compares strings after stripping off 'The' to be "smarter"
! """
! if x.find('The ') == 0:
! m = x.replace('The ','',1)
! else:
! m=x
! if y.find('The ') == 0:
! n = y.replace('The ','',1)
! else:
! n=y
! return cmp(m.upper(),n.upper()) # be case insensitive
!
def totalspace(path):
"""
-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog