Update of /cvsroot/freevo/freevo/src/util
In directory sc8-pr-cvs1:/tmp/cvs-serv14616

Modified Files:
        misc.py 
Log Message:
add smartsort patch from Eirik Meland

Index: misc.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/util/misc.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** misc.py     11 Oct 2003 11:20:11 -0000      1.1
--- misc.py     14 Oct 2003 17:03:38 -0000      1.2
***************
*** 11,14 ****
--- 11,17 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.2  2003/10/14 17:03:38  dischi
+ # add smartsort patch from Eirik Meland
+ #
  # Revision 1.1  2003/10/11 11:20:11  dischi
  # move util.py into a directory and split it into two files
***************
*** 264,277 ****
  def smartsort(x,y): # A compare function for use in list.sort()
      """
!     Compares strings after stripping off 'The' to be "smarter"
!     Also obviously ignores the full path when looking for 'The' 
      """
      m = os.path.basename(x)
      n = os.path.basename(y)
      
!     if m.find('The ') == 0:
!         m = m.replace('The ','',1)
!     if n.find('The ') == 0:
!         n = n.replace('The ','',1)
  
      return cmp(m.upper(),n.upper()) # be case insensitive
--- 267,282 ----
  def smartsort(x,y): # A compare function for use in list.sort()
      """
!     Compares strings after stripping off 'The' and 'A' to be 'smarter'
!     Also obviously ignores the full path when looking for 'The' and 'A' 
      """
      m = os.path.basename(x)
      n = os.path.basename(y)
      
!     for word in ('The', 'A'):
!         word += ' '
!         if m.find(word) == 0:
!             m = m.replace(word, '', 1)
!         if n.find(word) == 0:
!             n = n.replace(word, '', 1)
  
      return cmp(m.upper(),n.upper()) # be case insensitive




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to