def get_settings_from_file(filepath):
s = None
try:
settings_file = os.path.join(filepath, "settings")
f = open(settings_file, "rb")
s = pickle.load(f)
f.close()
except EOFError as eofe:
print("eof error:", eofe)
except pickle.PickleError as pe:
print("pickle error:", pe)
except IOError as ioe:
# Normally this error means it is the 1st run and the settings file
# does not exist
pass
except Exception as exc:
print("Cannot restore settings:", exc)
#if gv.verbose:
# print "values read from settings file"
# print "colour_settings:",s.colour_settings
return s
评论列表
文章目录