Update of /cvsroot/freevo/freevo/src/www/htdocs
In directory sc8-pr-cvs1:/tmp/cvs-serv19755a/htdocs
Modified Files:
library.cgi
Log Message:
Committed some code by Michael Ruelle which adds highlighting and file
size descriptions to library.cgi.
Index: library.cgi
===================================================================
RCS file: /cvsroot/freevo/freevo/src/www/htdocs/library.cgi,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** library.cgi 20 Feb 2003 22:36:04 -0000 1.3
--- library.cgi 27 Feb 2003 02:04:34 -0000 1.4
***************
*** 14,17 ****
--- 14,21 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.4 2003/02/27 02:04:34 rshortt
+ # Committed some code by Michael Ruelle which adds highlighting and file
+ # size descriptions to library.cgi.
+ #
# Revision 1.3 2003/02/20 22:36:04 rshortt
# Fixed a crash where newfile was null.
***************
*** 47,51 ****
#endif
! import sys, cgi, os, string, urllib
import html_util as fv
--- 51,55 ----
#endif
! import sys, cgi, os, string, urllib, re
import html_util as fv
***************
*** 56,59 ****
--- 60,65 ----
import config
import util
+ import rec_interface as ri
+ import rec_favorites as rf
TRUE = 1
***************
*** 123,140 ****
fv.tableRowClose()
# loop over directory here
items = util.match_files(config.DIR_RECORD, config.SUFFIX_VIDEO_FILES)
for file in items:
#find size
len_file = os.stat(file)[6]
#chop dir from in front of file
file = string.replace(file, config.DIR_RECORD + '/', '')
fv.tableRowOpen('class="chanrow"')
! fv.tableCell(file, 'class="basic" align="left" colspan="1"')
! fv.tableCell(str(len_file), 'class="basic" align="left" colspan="1"')
! file_esc = urllib.quote(file)
! rename = '<a href="javascript:renameFile(\'%s\')">Rename</a>' % file_esc
! delete = '<a href="library.cgi?action=delete&file=%s">Delete</a>' % file_esc
! fv.tableCell(rename + ' ' + delete, 'class="basic" align="center"
colspan="1"')
fv.tableRowClose()
--- 129,180 ----
fv.tableRowClose()
+ # find out if anything is recording
+ recordingprogram = ''
+ recordings = ri.getScheduledRecordings()
+ progs = recordings.getProgramList()
+ f = lambda a, b: cmp(a.start, b.start)
+ progl = progs.values()
+ progl.sort(f)
+ for prog in progl:
+ try:
+ if prog.isRecording == TRUE:
+ recordingprogram = ri.getProgFilename(prog)
+ break
+ except:
+ # sorry, have to pass without doing anything.
+ pass
+
+ #generate our favorites regular expression
+ favre = ''
+ favorites = rf.getFavorites()
+ favs = favorites.values()
+ if favs:
+ favtitles = [ fav.title for fav in favs ]
+ favre = string.join(favtitles, '|') # no I am not a packers fan
+
# loop over directory here
items = util.match_files(config.DIR_RECORD, config.SUFFIX_VIDEO_FILES)
for file in items:
+ status = 'basic'
+ suppressaction = FALSE
#find size
len_file = os.stat(file)[6]
#chop dir from in front of file
file = string.replace(file, config.DIR_RECORD + '/', '')
+ if recordingprogram and re.match(recordingprogram, file):
+ status = 'recording'
+ suppressaction = TRUE
+ elif favs and re.match(favre, file):
+ status = 'favorite'
fv.tableRowOpen('class="chanrow"')
! fv.tableCell(file, 'class="'+status+'" align="left" colspan="1"')
! fv.tableCell(fv.descfsize(len_file), 'class="'+status+'" align="left"
colspan="1"')
! if suppressaction == TRUE:
! fv.tableCell(' ', 'class="'+status+'" align="center" colspan="1"')
! else:
! file_esc = urllib.quote(file)
! rename = '<a href="javascript:renameFile(\'%s\')">Rename</a>' % file_esc
! delete = '<a href="library.cgi?action=delete&file=%s">Delete</a>' % file_esc
! fv.tableCell(rename + ' ' + delete, 'class="'+status+'"
align="center" colspan="1"')
fv.tableRowClose()
-------------------------------------------------------
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog