vixen-project / vixen

ViXeN is a multimedia viewer, metadata extractor and annotator.
https://vixen.readthedocs.io
Other
14 stars 8 forks source link

File chooser freezes UI #29

Open deniederhut opened 5 years ago

deniederhut commented 5 years ago

Describe the bug In --dev mode (possibly also others) vixen freezes under Edit Project -> Path -> Browse if you cancel before choosing a filename.

Software Version ViXeN version: 1.0rc3.dev0 from master via pip

To Reproduce

  1. Start vixen in dev
  2. New project
  3. Browse to path
  4. Click cancel

Expected behavior Filechooser should close.

Operating System (please complete the following information): MacOS

Log file Nothing in logs about this

Additional context xref https://github.com/openjournals/joss-reviews/issues/1501

deniederhut commented 5 years ago

Hm. It looks like actually choosing a folder might also be freezing?

prabhuramachandran commented 5 years ago

Thanks for the issues, I will take a look over this weekend and fix them as possible. The issue with the web-UI is that there isn't an easy way to ask for a file on the browser so I resort to using tkinter for this and that seems to be flaky.

prabhuramachandran commented 4 years ago

Hi @deniederhut -- I think I may have fixed the freezes, it was hard to reproduce but I would appreciate it if you could please try with vixen master to see if this does indeed fix the issue. Unfortunately, you will need to test with Python 3.6 for now until I get #27 fixed with a Jigna release.

deniederhut commented 4 years ago

Looks like the file chooser still freezes for me. Is there some way to turn on more verbose logging so I have something more useful to send you?

prabhuramachandran commented 4 years ago

Would it be possible to test with the latest binary release? https://github.com/vixen-project/vixen/releases That may eliminate a build issue.

As far as logging goes, there isn't much going on to really be able to log. I still do not have any idea of how you installed vixen, what Python version are you using (what distribution), can you also try the following in a Python shell:

import tkinter
print(tkinter.TkVersion)
print(tkinter.TclVersion)

Then you can try this:

import vixen.ui_utils as UU
UU.askdirectory()

Does that also freeze?

Under the covers, this is effectively what is called when you press "browse" for a directory. Similarly for a file etc. I wish there were a way of doing this from the browser but last I checked that is not easy.

Also, you should be able to edit the textbox left of the browse button and type out a directory -- just to see if the app is working.

deniederhut commented 4 years ago

Python 3.6.8, and I am installing from master.

Here are the tkinter versions:

>>> print(tkinter.TkVersion)
8.6
>>> print(tkinter.TclVersion)
8.6

Calling askdirectory from Python and the clicking cancel returns an empty string:

>>> import vixen.ui_utils as UU
>>> UU.askdirectory()
''"

and then the UI freezes. Calling it and choosing a directory returns the directory, raises a warning, and the UI freezes.

>>> import vixen.ui_utils as UU
>>> UU.askdirectory()
objc[1996]: Class FIFinderSyncExtensionHost is implemented in both /System/Library/PrivateFrameworks/FinderKit.framework/Versions/A/FinderKit (0x7fff9a321c90) and /System/Library/PrivateFrameworks/FileProvider.framework/OverrideBundles/FinderSyncCollaborationFileProviderOverride.bundle/Contents/MacOS/FinderSyncCollaborationFileProviderOverride (0x119e20cd8). One of the two will be used. Which one is undefined.
'/Users/dillon/test-images'
deniederhut commented 4 years ago

The macos binary looks like it is working -- are you vendoring some dependencies inside the app?

prabhuramachandran commented 4 years ago

@deniederhut -- Thanks so much for testing this and the information. What distribution is this with? brew? or conda? Also what version of MacOS? I am still on High Sierra (10.13.6).

I am glad the binary is working, yes it vendorizes everything including Python, Tcl/Tk etc. (and fits in 25MB or less). Honestly, our expectation is for people to use the binary as we do not expect people to be Python users. In any case, your issue suggests that I should look around for a cleaner way to do this and also see how best to reproduce this issue. I see there is a tkfilebrowser but was hoping to avoid any additional dependencies.

deniederhut commented 4 years ago

From anaconda - Python 3.6.8 :: Anaconda, Inc

Also High Sierra 10.13.6 but I really need to just bite the bullet and run the update.