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

Modified Files:
        util.py directory.py 
Log Message:
The "Smartsort" code. You can enable it in local_conf, it's disabled
by default. I fixed the smartsort cmpfunc to work a little more 
efficiently though quite frankly, it could probably be optimized better.



Index: util.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/util.py,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** util.py     13 Jun 2003 18:19:57 -0000      1.29
--- util.py     14 Jun 2003 00:09:40 -0000      1.30
***************
*** 10,13 ****
--- 10,18 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.30  2003/06/14 00:09:40  outlyer
+ # The "Smartsort" code. You can enable it in local_conf, it's disabled
+ # by default. I fixed the smartsort cmpfunc to work a little more
+ # efficiently though quite frankly, it could probably be optimized better.
+ #
  # 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
***************
*** 520,532 ****
      """
      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
  
--- 525,538 ----
      """
      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
  

Index: directory.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/directory.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** directory.py        7 Jun 2003 11:28:33 -0000       1.14
--- directory.py        14 Jun 2003 00:09:40 -0000      1.15
***************
*** 10,13 ****
--- 10,18 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.15  2003/06/14 00:09:40  outlyer
+ # The "Smartsort" code. You can enable it in local_conf, it's disabled
+ # by default. I fixed the smartsort cmpfunc to work a little more
+ # efficiently though quite frankly, it could probably be optimized better.
+ #
  # Revision 1.14  2003/06/07 11:28:33  dischi
  # use an id to find the new selected item (e.g. after creating a fxd file
***************
*** 148,152 ****
                           'DIRECTORY_AUTOPLAY_SINGLE_ITEM', 'COVER_DIR',
                           'AUDIO_RANDOM_PLAYLIST', 'FORCE_SKIN_LAYOUT',
!                          'AUDIO_FORMAT_STRING')
          for v in all_variables:
              setattr(self, v, eval('config.%s' % v))
--- 153,158 ----
                           'DIRECTORY_AUTOPLAY_SINGLE_ITEM', 'COVER_DIR',
                           'AUDIO_RANDOM_PLAYLIST', 'FORCE_SKIN_LAYOUT',
!                          'AUDIO_FORMAT_STRING','DIRECTORY_SMART_SORT')
! 
          for v in all_variables:
              setattr(self, v, eval('config.%s' % v))
***************
*** 392,396 ****
                                         self.display_type) ]
  
!         dir_items.sort(lambda l, o: cmp(l.dir.upper(), o.dir.upper()))
  
  
--- 398,406 ----
                                         self.display_type) ]
  
!         if self.DIRECTORY_SMART_SORT:
!             dir_items.sort(lambda l, o: util.smartsort(l.dir,o.dir))
!         else:
!             dir_items.sort(lambda l, o: cmp(l.dir.upper(), o.dir.upper()))
!  
  
  




-------------------------------------------------------
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

Reply via email to