Update of /cvsroot/freevo/freevo/src
In directory sc8-pr-cvs1:/tmp/cvs-serv1483
Modified Files:
util.py
Log Message:
make sure we can save the data
Index: util.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/util.py,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -d -r1.47 -r1.48
*** util.py 1 Sep 2003 14:01:20 -0000 1.47
--- util.py 3 Sep 2003 21:02:46 -0000 1.48
***************
*** 11,14 ****
--- 11,17 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.48 2003/09/03 21:02:46 dischi
+ # make sure we can save the data
+ #
# Revision 1.47 2003/09/01 14:01:20 outlyer
# Added automatic XMLTV channel list code; the idea is that you can avoid
***************
*** 506,512 ****
def save_pickle(data, file):
! f = open(file, 'w')
! cPickle.dump(data, f, PICKLE_PROTOCOL)
! f.close()
--- 509,520 ----
def save_pickle(data, file):
! try:
! if os.path.isfile(file):
! os.unlink(file)
! f = open(file, 'w')
! cPickle.dump(data, f, PICKLE_PROTOCOL)
! f.close()
! except IOError:
! print 'unable to save to cachefile %s' % file
***************
*** 593,598 ****
def touch(file):
! fd = open(file,'w+')
! fd.close()
return 0
--- 601,609 ----
def touch(file):
! try:
! fd = open(file,'w+')
! fd.close()
! except IOError:
! pass
return 0
***************
*** 677,682 ****
import xmltv
import sys,os
- import cPickle as pickle
-
path = config.FREEVO_CACHEDIR
--- 688,691 ----
***************
*** 708,713 ****
chanlist += [(id,display_name,int(tunerid))]
! pickle.dump(chanlist, open(pname,'w'),PICKLE_PROTOCOL)
!
return chanlist
--- 717,721 ----
chanlist += [(id,display_name,int(tunerid))]
! save_pickle(chanlist, pname)
return chanlist
-------------------------------------------------------
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