File importing problems: Path doesnt properly appear as node header

Bug #1269540 reported by Fidel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
leo-editor
Fix Released
Undecided
Unassigned

Bug Description

As discussed here: https://groups.google.com/forum/#!topic/leo-editor/wMZWhIC_aKg

Using windows 7, python 2.7, pyqt4

When dropping a file from windows explorer to the outline, the path doesnt properly appear. Before recent changes, It would create either:

- A proper @url node, clickable towards the file
- A proper relative path, if the node is under a @path node

Leo tries to always create a relative path to the open Leo file, and works when the files are inside a subfolder or in the same folder as the Leo file, but when they are not, leo fails to point properly to the file.
Examples in the attached groups discussion.

Revision history for this message
Fidel (fidelperez) wrote :

Found another example of not working paths, with a new error. The error is this one:

can not convert to unicode! start_event_loop_qt4,dropEvent,urlDrop,doFileUrl
Traceback (most recent call last):
  File "D:\Dropbox\INSTALLED\LEO EDITOR\leo-editor-snapshot-20131123\leo\core\leoGlobals.py", line 4638, in toUnicode
    s = f(s,encoding,'replace')
MemoryError

And it happens when I drop this file into Leo:

"d:\downloads\Training the Companion Dog\Training the Companion Dog - 1. Socialisation & Training.mp4"

Revision history for this message
Fidel (fidelperez) wrote :

And the header of the node produced after the error popping in Leo log is this one:

ownloads\training the companion dog\training the companion dog - 1. socialisation & training.mp4

Revision history for this message
Fidel (fidelperez) wrote :

Monkey-patched it to work, just in case someone needs this:

Open leopyref.leo, and do the following replacement:

Replace:

self.doFileUrl

for

self.doHttpUrl

There are only 2 concurrences.
This way, all files dropped into Leo will become @url nodes, but paths work perfectly.

Revision history for this message
Edward K. Ream (edreamleo) wrote :
Changed in leo-editor:
status: New → Fix Released
Revision history for this message
Edward K. Ream (edreamleo) wrote :

I am aware of no problems with drag and drop at present.
Please create a github bug report if any new issues appear.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.