src/gui/modules/misc_non_gui.py
changeset 1788 e43ea4447c6b
parent 1736 727dda1e7968
child 1795 1b3bed835773
equal deleted inserted replaced
1787:122826ae20d0 1788:e43ea4447c6b
   118         data = []
   118         data = []
   119         try:
   119         try:
   120                 fh = open(file_path, 'r')
   120                 fh = open(file_path, 'r')
   121                 data = cPickle.load(fh)
   121                 data = cPickle.load(fh)
   122                 fh.close()
   122                 fh.close()
   123         except IOError:
   123         except:
   124                 pass
   124                 pass
   125         return data
   125         return data
   126 
   126 
   127 def dump_cache_file(file_path, data):
   127 def dump_cache_file(file_path, data):
   128         try:
   128         try:
   129                 fh = open(file_path,"w")
   129                 fh = open(file_path,"w")
   130                 cPickle.dump(data, fh, True)
   130                 cPickle.dump(data, fh, True)
   131                 fh.close()
   131                 fh.close()
   132         except IOError:
   132         except:
   133                 pass
   133                 pass