Update of /cvsroot/freevo/freevo/src/util
In directory sc8-pr-cvs1:/tmp/cvs-serv4451/src/util
Modified Files:
misc.py
Log Message:
Ouch! We definitely need a cache sooner than later. Without the cache
the CPU usage on my Athlon 2000 was going to 40% (sorting, most likely
being a chunk of that)
Index: misc.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/util/misc.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** misc.py 11 Jan 2004 03:22:30 -0000 1.13
--- misc.py 11 Jan 2004 05:45:38 -0000 1.14
***************
*** 11,25 ****
# -----------------------------------------------------------------------
# $Log$
! # Revision 1.13 2004/01/11 03:22:30 outlyer
! # First try at the "Coming Up" page. It only shows up when a directory in the
! # TV menu is selected, but I'm working on a way to have it show up for the
! # rest of the TV menu.
! #
! # TODO:
! # o Cache the coming up list for an hour at a time (misc.py)
! # o Cleanup the 'comingup()' function, it's currently just executable pseudo-code
(misc.py)
! # o Show the Coming Up list for all items (skin)
! #
! # If you don't use 'blurr2.fxd' this will have no effect on you whatsoever.
#
# Revision 1.12 2004/01/01 16:18:11 dischi
--- 11,18 ----
# -----------------------------------------------------------------------
# $Log$
! # Revision 1.14 2004/01/11 05:45:38 outlyer
! # Ouch! We definitely need a cache sooner than later. Without the cache
! # the CPU usage on my Athlon 2000 was going to 40% (sorting, most likely
! # being a chunk of that)
#
# Revision 1.12 2004/01/01 16:18:11 dischi
***************
*** 390,393 ****
--- 383,398 ----
import tv.record_client as ri
import time
+
+ result = ''
+
+ cachefile = '%s/upsoon' % (config.FREEVO_CACHEDIR)
+ print cachefile
+ if (os.path.exists(cachefile) and \
+ (abs(time.time() - os.path.getmtime(cachefile)) < 3600)):
+ cache = open(cachefile,'r')
+ for a in cache.readlines():
+ result = result + a
+ cache.close()
+ return result
(status, recordings) = ri.getScheduledRecordings()
***************
*** 410,416 ****
later.append(what)
- result = ''
-
-
if len(today) > 0:
--- 415,418 ----
***************
*** 439,442 ****
--- 441,448 ----
result = result + " " + str(m.title) + str(sub_title) + " at " + \
str(time.strftime('%I:%M%p',time.localtime(m.start))) + '\n'
+
+ cache = open(cachefile,'w')
+ cache.write(result)
+ cache.close()
return result
-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog