orange3 icon indicating copy to clipboard operation
orange3 copied to clipboard

OWLoadBase widget

Open janezd opened this issue 4 years ago • 0 comments

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 OWSaveBase for 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)
    

janezd avatar Apr 02 '21 09:04 janezd