Update of /cvsroot/freevo/freevo/src/helpers
In directory sc8-pr-cvs1:/tmp/cvs-serv22708
Modified Files:
cache.py
Log Message:
add rebuild option
Index: cache.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/helpers/cache.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** cache.py 23 Aug 2003 12:51:42 -0000 1.6
--- cache.py 26 Sep 2003 11:28:59 -0000 1.7
***************
*** 12,15 ****
--- 12,18 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.7 2003/09/26 11:28:59 dischi
+ # add rebuild option
+ #
# Revision 1.6 2003/08/23 12:51:42 dischi
# removed some old CVS log messages
***************
*** 75,79 ****
return result
! def cache_directories():
import mmpython
--- 78,82 ----
return result
! def cache_directories(rebuild=True):
import mmpython
***************
*** 84,88 ****
mmpython.mediainfo.DEBUG = 0
mmpython.factory.DEBUG = 0
!
all_dirs = []
print 'caching directories...'
--- 87,96 ----
mmpython.mediainfo.DEBUG = 0
mmpython.factory.DEBUG = 0
!
! if rebuild:
! print 'deleting cache files'
! for f in ([ os.path.join(mmcache, fname) for fname in os.listdir(mmcache) ]):
! if os.path.isfile(f):
! os.unlink(f)
all_dirs = []
print 'caching directories...'
***************
*** 90,94 ****
os.path.walk(d, cache_helper, all_dirs)
for d in all_dirs:
! print d
mmpython.cache_dir(d)
--- 98,102 ----
os.path.walk(d, cache_helper, all_dirs)
for d in all_dirs:
! print '%4d/%-4d %s' % (all_dirs.index(d)+1, len(all_dirs), d)
mmpython.cache_dir(d)
***************
*** 101,109 ****
print 'cache all files in your data directories.'
print
! print 'this script has no options (yet)'
print
sys.exit(0)
delete_old_files()
! cache_directories()
--- 109,123 ----
print 'cache all files in your data directories.'
print
! print 'usage freevo cache [--rebuild]'
! print 'If the --rebuild option is given, Freevo will delete the cache first'
! print 'to rebuild the cache from start. Caches from discs won\'t be affected'
print
sys.exit(0)
delete_old_files()
!
! if len(sys.argv)>1 and sys.argv[1] == '--rebuild':
! cache_directories(1)
! else:
! cache_directories(0)
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog