Ticket #12 (new defect)

Opened 3 years ago

Last modified 3 years ago

expose saving functions for drag-and-drop saving

Reported by: talex5+reinteract@gmail.com Assigned to:
Priority: low Keywords:
Cc:

Description

To support drag-and-drop saving in ROX, we needed to expose the code to save to a stream and to set the path after saving (for saves to a filesystem).

The changes needed to support this can be pulled from here, if you want them in the main repository:

git://repo.or.cz/reinteract/rox.git master

(this doesn't actually change the user interface; the ROX-specific changes are on the "rox" branch)

There's some more info about this branch here: http://roscidus.com/desktop/node/893

Change History

(follow-up: ↓ 2 ) 01/04/08 18:29:30 changed by otaylor

Sorry for taking a long time to get to this bug. My comments about the changes:

  • I'd actually prefer to integrate the entire changes, rather than just part; it would be too easy to say "look, nobody is using this method, let's remove it". reinteract internals are not maintained as public API. Can you do it the same way as hildon, with a command line flag that set by your launcher?
  • set_filename_and_modified() needs at least a minimal doc comment if it's exported inter-module.
  • I don't see a need for the save_to_stream() method. I think shell_buffer.iterate_text() is a more general interface that is already public.
  • rox_adaptor.py ... there will be no adaptors, visitors, decorators, or so forth in Reinteract filenames and classnames :-). Just call it rox_ui.py

(in reply to: ↑ 1 ) 01/20/08 11:51:37 changed by talex

OK, there's a new --ui=rox option and I've applied your other suggestions too. Please pull from:

git://repo.or.cz/reinteract/rox.git rox

Thanks,

(follow-up: ↓ 4 ) 01/20/08 12:29:12 changed by otaylor

It's looking pretty good:

def set_uri(self, uri):

self.buf.set_filename_and_modified(uri, False) #notebook.set_path([os.path.dirname(os.path.abspath(filename))])

The set_path() there really isn't optional. Without doing that, the feature of being able to import files in the same directory as the worksheet is going to work unreliably. Can you pass the notebook into save_with_rox_savebox()?

Other than that, I'd like to see authorship/copyright information in rox_ui.py... I certainly have been casual about this in general, but for files that aren't primarily my work, I'd like to note that.

Once you do those two things, would it be possible to create a clean branch rebased to the current master? I'd rather avoid having merges like c6870bda128d54 in the history, which I believe would happen if I merged in your rox branch as is is now. (I'm still no git expert...)

- Owen

(in reply to: ↑ 3 ) 01/20/08 13:56:52 changed by talex

Ah, I was wondering what that set_path was for. Fixed!

I've added a copyright statement to rox_ui, and cleaned up the history a little (but I haven't rebased it).

Personally, I like the way GIT shows the true history, with all the branching and merging, but feel free to rebase it if you prefer. It would be nice to keep the ROX v0.1 revision in the history, if possible, though.

Note: I've moved the changes onto the 'master' branch now:

git://repo.or.cz/reinteract/rox.git master