Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maybe implement a GUI as an optional module #184

Open
rbrito opened this issue Aug 26, 2013 · 14 comments
Open

Maybe implement a GUI as an optional module #184

rbrito opened this issue Aug 26, 2013 · 14 comments

Comments

@rbrito
Copy link
Member

rbrito commented Aug 26, 2013

I have a friend from highschool that I had not met for about 20 years now.

She works as a psychologist and, when I mentioned that there was this thing called coursera, that they had courses that also included psychology and that I worked on a program that downloaded the videos to play them back whenever she had the time to watch them, she was excited.

Unfortunately, she probably doesn't even know about something called "the command line" and I would expect that asking her to "hey, get an account on this site called github as a way to follow the development of our program" would be an indirect step to the goal that would totally turn her off.

I guess that I would be willing to merge a GUI as an optional module (say, invoked with a command-line option like --gui or with a different coursera-dl-gui command or something like this) so that people like her would be able to use the program.

In a private conversation with @sharat87, he mentioned that he was going to implement a GUI in his fork. I guess that we can have it here, especially for people like the friend of mine that I just mentioned above.

In the case of my friend, I guess that I will also have to help her with the installation of the program, as she is likely to not know what "python" means.

And I will have to opportunity to experience how easy/hard it is to install our program under Windows (that's what she uses).

Comments, anyone? @jplehmann, @jonasdt, other people following our development?

Rogério Brito.

@rbrito
Copy link
Member Author

rbrito commented Aug 26, 2013

Oh, I guess that I forgot to mention: the way that I see how one preliminary implementation of this would work is as a simple "moral equivalent" of our function parseArgs, perhaps written in Tk (as I understand that that comes with "stock python") and would be multiplatform.

@sharat87
Copy link

I can understand your position. The GUI (Tk based, Python 3.3 only) is quite functional now with features just enough to use it on a daily basis, at least for me. I have even wrapped up wget as an alternate downloader and show GUI progress bars with information from wget. Along with visual filtering of resources, it actually turned out quite good.

As for installation, I only ask for Python 3.3 on the user's system. Nothing else. I ship all the dependencies needed (yes, their licenses permit this, unless you know something I don't, please let me know). I am also exploring the possibility of an executable egg file, which as I understand it, will enable users to download a single zip-like file and double click it to see the GUI window.

You can see the current work on the gui branch of my fork. Please note that the README has no idea of the GUI yet. And the GUI itself is only beta. Thank you for your interest :)

PS: As for the --gui argument, I don't think that's a good idea. Users who need and want to run GUI don't usually do it via command line. They double click. And adding arguments in that style of execution is not very pleasant. So, may be, launch the GUI when no command line arguments are present?

@sharat87
Copy link

Oh and one more thing if anyone is willing to try out the GUI, I haven't taken any measures to ensure download directory and file name structure to be consistent with this command line script. While I haven't knowingly deviated from what it was when I forked it, I can't assure full consistency.

@jonasdt
Copy link
Member

jonasdt commented Aug 31, 2013

I've tried the gui on OSX, but I can't get it to work:

_tkinter.TclError: can't find package Tix

After googling for a while, I've concluded that python and tkinter is a source of trouble.

@sharat87
Copy link

sharat87 commented Sep 1, 2013

I've concluded that python and tkinter is a source of trouble

Surprising conclusion because I'm starting to really like tkinter. I had that opinion before but I like it more than GTK and wx now (only others that I tried).

_tkinter.TclError: can't find package Tix

I am on (L)Ubuntu 13.04 and when I see this error, I install tix-dev package and everything just works. I'd believe its similarly simple on OSX, but I have no clue about it. Also, make sure you're running Python 3.3 as that's the only version I'm developing/testing/using the GUI with.

@rbrito
Copy link
Member Author

rbrito commented Sep 1, 2013

Hi there.

On Aug 31 2013, Jonas De Taeye wrote:

I've tried the gui on OSX, but I can't get it to work:

_tkinter.TclError: can't find package Tix

After googling for a while, I've concluded that python and tkinter is a
PITA.

That's because tix, AFAIK, is a new, external module that would need to be
included in requirements, much the same way as, beautifulsoup, isn't it?

Also, it is my understanding that Tkinter (or tkinter, in python3) is always
part of Python, as long as you didn't disable it in the build process (not
even sure if that is possible).

But having a GUI would lower the barrier for many of our users (well, not
me, as I have problems using GUIs, but I would certainly recommend that to
relatives if I ever install coursera-dl on their computers).

Just typing dir or ls in "that black screen with little letters" would
give them a headache.

I wouldn't mind merging the GUI parts slowly in a feature branch (or even
in master) as long as everything is peer reviewed and not enabled by
default, until it is ready.

Of course, I am thinking of creating our first tag in the project, so that
we can always direct people to download that "release" of the project if
they want something stable (which I think that we have).

And, then, happy hacking for those that want to experiment/learn new
software engineering practices in a bold, young, but well established
project, while having people who would not otherwise have the material to
study.

OK, I realize that this is a bit long and it is way past the time for me to
sleep, but I guess that at least something that I wrote here may make some
sense. :) If not, scream and I will rewrite. :)

Thanks,

Rogério Brito : rbrito@{ime.usp.br,gmail.com} : GPG key 4096R/BCFCAAAA
http://cynic.cc/blog/ : github.com/rbrito : profiles.google.com/rbrito
DebianQA: http://qa.debian.org/developer.php?login=rbrito%40ime.usp.br

@rbrito
Copy link
Member Author

rbrito commented Sep 1, 2013

Hi, Shrikant and Jonas (and other following our project).

On Aug 31 2013, Shrikant Sharat wrote:

I've concluded that python and tkinter is a source of trouble

Surprising conclusion because I'm starting to really like tkinter. I had
that opinion before but I like it more than GTK and wx now (only others
that I tried).

Well, in my experience, tk under non-windows (well, at least under
Linux/pure BSD) looks quite unattractive, but having programmed with gtk and
python before (see https://github.com/rbrito/tunesviewer), I can say that
programming with GTK is a total headache. Perhaps Qt would be better (and I
think that Qt may indeed be better).

BUT for the purposes of our project, I think that tkinter is the way to
go, as it comes with python and, if we ever have the thought of benefiting
more users (I do), then I suspect that we can use something like py2exe and
have that for Windows users.

I guess that we can also offer a dmg file for Mac users, if we ever
understand how to create one. :)

_tkinter.TclError: can't find package Tix

I am on (L)Ubuntu 13.04 and when I see this error, I install tix-dev
package and everything just works.

If I remember correctly, when I tried playing with GUIs (see my project
above) I remember that tix was an addon on top of tk, which was optional for
better looks (like theming?) and offered some extra widgets.

Do you make use of any of those extra widgets, Shrikant? Are they totally
necessary? (I have not yet looked at the code). You mention that you are
using lubuntu 13.04 and I just took a peek and saw that the tix package has
the "Debian QA Group" as a maintainer.

Wearing my Debian Maintainer hat, that essentially means, in Debian, that
the package is not under maintainance and that, unless someone steps in, it
may even be dropped from further versions of the distribution, which may
affect ubuntu too.

Some background: the Debian QA Group is an umbrella that takes care of the
quality of the packages in the distribution and they adopt the packages that
still are on the archive, among other things, since they may be needed for
other applications.

I also noted that tix (as is) in Debian, may only be available for tk 8.5,
and that tk 8.6 is already present in the archive. Do any of you know if the
functionality of tix is already included in tk 8.6?

Well, I guess that all that I wrote above means: "can we drop tix as one of
our dependencies, without asking for trouble?"

I'd believe its similarly simple on OSX, but I have no clue about it.

Possibly, with homebrew or pip, but I am sure that Jonas knows this way
better than I do.

Also, make sure you're running Python 3.3 as that's the only version I'm
developing/testing/using the GUI with.

Are there any Python 3-specific parts, apart from the name of the module
(Tkinter vs. tkinter)? That "problem" is very easily circumvented, of
course.

Thanks for everything,

Rogério Brito : rbrito@{ime.usp.br,gmail.com} : GPG key 4096R/BCFCAAAA
http://cynic.cc/blog/ : github.com/rbrito : profiles.google.com/rbrito
DebianQA: http://qa.debian.org/developer.php?login=rbrito%40ime.usp.br

@sharat87
Copy link

sharat87 commented Sep 1, 2013

Now that you mention it, I checked to see if the app works without importing tix and hey, it does. I just from tkinter import tix as tk and was just using tk without giving a damn of whether a widget I'm using is from core tkinter or tix. Apparently I'm not using any tix widgets. I'll push my commit without tix soon.

Tk being available with Python on windows is a big reason for me start this project with Tk. Granted it looks less than pretty on Linux, but its not ugly, not to my eyes at least :). Besides, this is not something like your browser or email app which you stare at all day. This is intended to just select the downloads and put it aside. Once done, close it and get over it. So, that's also a non-issue as far as I'm concerned.

Are there any Python 3-specific parts

Not sure. Didn't explore it. The way I see it, this is an application, not a library to be supporting various versions of target runtimes. If I support only Python3, it not only saves me from 2-3 version troubles, but it lets me say "Download this Python3-setup.exe, install and run this script". Its about time people (especially python programmers) have python3 on their systems anyway don't you think?

Nevertheless, I think besides the tkinter import, I expect the subprocess to create some unicode related problems on some operating systems. Can't say until I test it out.

@jonasdt
Copy link
Member

jonasdt commented Sep 1, 2013

I've concluded that python and tkinter is a source of trouble

Surprising conclusion because I'm starting to really like tkinter. I had that opinion before but I like it more than GTK and wx now (only others that I tried).

Sorry for not being clear enough, but I mean on OSX.

I'm fine with asking users to install Tcl/Tk from the Active State website, so if you could use another widget library then tkinter might be an option for OSX.

@sharat87
Copy link

sharat87 commented Sep 2, 2013

Ah, I have no experience with OSX so I wouldn't know. Anyway, the latest version on the gui branch is sans the tix dependency and so, should run fine on your OSX, assuming you've installed that ActiveState Tcl.

I uninstalled tix-dev and tix packages and the GUI works fine even now. So, bye bye tix :)

@ekianjo
Copy link

ekianjo commented Jan 17, 2014

I'm working on a GUI that should be working with Python 2.6/2.7 - but in different repository. When it's finished I will let you know and link it here.

@webhat
Copy link

webhat commented Jan 17, 2014

@ekianjo are you doing any UX?

@ekianjo
Copy link

ekianjo commented Jan 17, 2014

@webhat I'm working on Yad-based GUI.

@maurobaraldi
Copy link

I have done a hacking to run Tix in OSX 10.9.5. All in all it works on Python 3.4, does not works on 2.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants