dgorissen / coursera-dl

A script for downloading course material (video's, pdfs, quizzes, etc) from coursera.org
http://dirkgorissen.com/2012/09/07/coursera-dl-a-coursera-download-script/
GNU General Public License v3.0
1.73k stars 299 forks source link

Added Tkinter GUI #97

Closed ghost closed 10 years ago

ghost commented 10 years ago

Note: This commit only adds and doesn't subtract, I can't seem to find any reason why Github thinks there are 12 deletions plus there aren't 26 additions too in courseradownloader.py

dl2

ghost commented 10 years ago

I never really understood what @dgorissen meant by https://github.com/dgorissen/coursera-dl/pull/80#issuecomment-23517446 to use a wrapper :confused:

I would suggest writing your gui script as a wrapper that wraps the original one

When we could do main(*args2) and achieve the same result with less code instead... Please clarify about this

There are bugs though:

A GUI is not necessary as the fields expand at an alarming rate therefore there is a risk of failure but the GUI seems a pretty good idea for windows users and for solving issue https://github.com/dgorissen/coursera-dl/issues/79 (however solving this ain't easy)

In case if decided a GUI is unwanted please close the thread so I can continue :walking:

dgorissen commented 10 years ago

Sorry for the delay, I lost track of this. I had thought you would just call the class constructor with the arguments directly, why emulate the command line arguments when you can just do in the main of your gui (on clicking download):

cd = CourseraDownloader(...) cd.login(cname) cd.download_course(...)

There is no need to touch the original script at all. Also means that if the cmdline parameter names change nothing breaks.

Can you also add an informational message if the the tk toolkit is not installed. This prevents a raw exception.

As for deployment you can just add an extra entry point to setup.py as coursera-dl-gui.

Finally, please use lowercase module names, so gui.py instead of GUI.py.

ghost commented 10 years ago

I implemented most of it however since threading is involved its quite hard :(

could use some help.... from a experienced Tkintitian

dgorissen commented 10 years ago

Looks good, let me know when you are done with it.

ghost commented 10 years ago

I now have a gui that doesn't affect the main app, Unfortunately I'm not that much of a git expert so I guess I'll open a new pull request to fix it :)