orange3
orange3 copied to clipboard
OWLoadBase widget
We would need a common base for load widgets because:
- widgets for loading files have a lot of replicated code,
- some are implemented better, some worse,
- and as with all replicated code, improving one widget does not improve others.
When implementing this
-
the code should, I suppose, be taken from the CSV widget, which is by far the most systematic load widget,
-
perhaps see
OWSaveBasefor inspiration, because it seems to do the job well; when there are no special functionalities, save widgets need only two methods, like@Inputs.model def set_model(self, model): self.data = model self.on_new_input() def do_save(self): with open(self.filename, "wb") as f: pickle.dump(self.data, f)