Code: Alles auswählen
class settings_store:
def __init__(self):
self.frames = 3000
self.objects = 2
self.timestep = 1000
self.datatype = 0
self.algorithm = 0
self.names = []
self.settings = self.settings_store()
def file_save_ok_sel(self, arg):
start, end = self.input.get_bounds()
f = file(self.filew.get_filename(), 'w')
p = Pickler(f)
p.dump((self.settings, self.input.get_text(start, end)))
f.close()
self.filew.destroy()
def file_open_ok_sel(self, arg):
f = file(self.filew.get_filename(), 'r')
up = Unpickler(f)
self.settings, text = up.load()
self.input.set_text(text)
self.load_store(self.settings)
f.close()
self.filew.destroy()
Code: Alles auswählen
File "gtkGravity.py", line 231, in file_open_ok_sel
up.load()
File "C:\Python23\lib\pickle.py", line 872, in load
dispatch[key](self)
File "C:\Python23\lib\pickle.py", line 1083, in load_inst
klass = self.find_class(module, name)
File "C:\Python23\lib\pickle.py", line 1140, in find_class
klass = getattr(mod, name)
AttributeError: 'module' object has no attribute 'settings_store'