+import json
import os
import pickle
from PyQt4.QtCore import *
if not slice:
slice = config.getSlice()
+ if not slice:
+ return None
+
filename = config.fullpath(slice+".sliverstatus")
if os.path.exists(filename):
data = open(filename).read()
- return pickle.loads(data)
+ try:
+ if hasattr(json, "loads"):
+ return json.loads(data) # python 2.6
+ else:
+ return json.read(data) # python 2.5
+ except:
+ print "Exception in getSliverStatus"
+ return None
return None