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

Modified Files:
        fileops.py 
Log Message:
rewrote find_matches. It's not 100% correct because it doesn't use splitext
anymore, but it's _much_ faster now.


Index: fileops.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/util/fileops.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** fileops.py  9 Dec 2003 19:42:23 -0000       1.7
--- fileops.py  12 Dec 2003 19:11:20 -0000      1.8
***************
*** 11,14 ****
--- 11,18 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.8  2003/12/12 19:11:20  dischi
+ # rewrote find_matches. It's not 100% correct because it doesn't use splitext
+ # anymore, but it's _much_ faster now.
+ #
  # Revision 1.7  2003/12/09 19:42:23  dischi
  # more generic resolve_media_mountdir and arg checking for mount functions
***************
*** 64,67 ****
--- 68,72 ----
  import fnmatch
  import traceback
+ import time
  
  if float(sys.version[0:3]) < 2.3:
***************
*** 234,239 ****
      """
      return all files in 'files' that match one of the suffixes in 'suffix_list'
      """
!     return [ fname for fname in files if match_suffix(fname, suffix_list) ]
  
  
--- 239,248 ----
      """
      return all files in 'files' that match one of the suffixes in 'suffix_list'
+     The correct implementation is
+     filter(lambda x: os.path.splitext(x)[1].lower()[1:] in suffix_list, files)
+     but this one should also work and is _much_ faster. On a Duron 800, Python 2.2
+     and 700 photos 0.01 secs insteat of 0.2.
      """
!     return filter(lambda x: x[x.rfind('.')+1:].lower() in suffix_list, files)
  
  




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to