peerdavid / remapy

An open source explorer for your remarkable tablet to show, upload or delete files via the remarkable cloud.
Apache License 2.0
174 stars 19 forks source link

Trouble uploading files (Ubuntu 20.04) #11

Closed Pottit closed 4 years ago

Pottit commented 4 years ago

Hi, Thanks for the work you've put into this - it is much appreciated.

Everything works well on my system except the uploading of PDFs. The interface is completely unresponsive if I copy a PDF (I've tried in both Nautilus and Dolphin) and paste it in the RemaPy window. Dragging and dropping doesn't work either. As no text is entered in the console I have no error message to report.

That being said, if I copy and paste a web URL it is uploaded as PDF immediately - so it does recognize my clipboard.

I run pretty much vanilla Ubuntu 20.04. The same issue occurs in both Wayland and X. Feel free to ask if there's anything I can do to make bug hunting easier.

And thanks again! :)

peerdavid commented 4 years ago

Hi,

thanks for your input and detailed analysis of the problem. Drag & drop is not implemented yet so this could not work but copy + paste should always work. But I also have to say that I use nautilus with Ubuntu 18 and never tried Ubuntu 20.

My current guess is that something with the clipboard changed therefore I added some log statements to the current version of RemaPy. Can you please try to pull the code again and start RemaPy via the bash. You should then see some log outputs in the console. Can you please report those logs? That would help me a lot to further analyze the problem.

The log should show something like:

Get content from clipboard...
Read content /home/.../file.pdf
IsFile = True
IsUrl = False

Thanks for your help, David

Pottit commented 4 years ago

Turns out it's not identified as a file.

Start paste of file or url. Get content from clipboard... Read content x-special/nautilus-clipboard copy file:///home/username/Dokumenter/test.pdf

IsFile = False IsUrl = False

The file path is correct.

peerdavid commented 4 years ago

Thanks for debugging the problem. Seems that the content of the clipboard changed. I pushed a fix, can you please pull the newest version of the code and try it again? The upload via copy+paste should work now.

Thanks for your help, David

Pottit commented 4 years ago

Still nothing, but I'm guessing it could be related to this:

/home/username/remapy/gui/file_explorer.py:257: SyntaxWarning: "is" with a literal. Did you mean "=="? if filter is None or filter is "":

peerdavid commented 4 years ago

Still nothing, but I'm guessing it could be related to this:

/home/username/remapy/gui/file_explorer.py:257: SyntaxWarning: "is" with a literal. Did you mean "=="? if filter is None or filter is "":

Latest commit should fix this warning, but I think it's not related to the aforementioned bug. I committed something else and added logging again, can you please try again and report the log if it doesn't work?

Thanks, David

Pottit commented 4 years ago

Not much has changed:

Start paste of file or url. Read content IsFile = False IsUrl = False

In Wayland now, in case that's relevant.

peerdavid commented 4 years ago

can you please try nautilus? seems there is no content with wayland....

Pottit commented 4 years ago

Same exact issue in X, so it doesn't appear to be Wayland related. I'm using Nautilus.

Edit: Copy pasting the file path into RemaPy now uploades the file, which it didn't earlier. So now at least I can live with it!

peerdavid commented 4 years ago

I will try to reproduce the problem... thanks again!

Pottit commented 4 years ago

Sorry that I can't be more helpful.

When I copy a file and paste in terminal it returns:

x-special/nautilus-clipboard copy file:///home/user/Dokumenter/test.pdf

In case that is any help. Again, copy pasting the last line of this output in Remapy leads to upload.

Pottit commented 4 years ago

Looks like this is a bug in Nautilus: https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/1826266

peerdavid commented 4 years ago

Thanks a lot for this useful link, I will try to handle this with RemaPy to be independent on whether this nautilus bug is fixed or not.

peerdavid commented 4 years ago

Hi, I added some changes:

Please let me know if you still have problems, David

Pottit commented 4 years ago

Dolphin now works. I also tested Caja, which is the default file explorer in the Mate desktop, and basically a Nautilus fork where features are added rather than removed. Caja works great as well, and will probably be what I stick to going forwards.

I now get the following terminal output when copying and pasting form Nautilus:

Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python3.8/tkinter/__init__.py", line 1883, in __call__
    return self.func(*args)
  File "/home/username/.remapy/gui/file_explorer.py", line 619, in key_binding_paste
    self.btn_paste_async_click()
  File "/home/username/.remapy/gui/file_explorer.py", line 651, in btn_paste_async_click
    print("Clipboard: " + str(self.root.clipboard_get()))
  File "/usr/lib/python3.8/tkinter/__init__.py", line 865, in clipboard_get
    return self.tk.call(('clipboard', 'get') + self._options(kw))
_tkinter.TclError: selection owner didn't respond

Not sure if Nautilus can be saved, really. Also might not be worth it: I think i read something about the clipboard working very differently in GTK4, which is to be released this autumn. Hopefully the subsequent releases of Nautilus will be less unreasonable.

peerdavid commented 4 years ago

Dolphin now works. I also tested Caja, which is the default file explorer in the Mate desktop, and basically a Nautilus fork where features are added rather than removed. Caja works great as well, and will probably be what I stick to going forwards. [...] Not sure if Nautilus can be saved, really. Also might not be worth it.

Thanks again for your help, based on your comment I will close this issue. Feel free to reopen it.