WxPython Downloader

This is the place to post any code that you want to share with the community. Only completed scripts should be posted here.

WxPython Downloader

Postby Yoriz » Sat Feb 01, 2014 2:31 am

I made a copy of the code from wxpython-creating-a-file-downloading-app (Cheers Mike Driscoll) and modified it into a demo of my ymvc (Yoriz Model View Controller) app.
It demonstrates downloading files in threads while updating the gui amd keeping the gui responsive, the threading is built into ymvc.
Find it on my git hub at WxPython-Downloader
Requires
Y_Mvc
requests
wxpython
New Users, Read This
Join the #python-forum IRC channel on irc.freenode.net!
Spam topic disapproval technician
Windows7, Python 2.7.4., WxPython 2.9.5.0., some Python 3.3
User avatar
Yoriz
 
Posts: 764
Joined: Fri Feb 08, 2013 1:35 am
Location: UK

Re: WxPython Downloader

Postby hrs » Tue Feb 04, 2014 6:04 pm

Your code looks very clean. This is something I will study and learn from, thanks.

I've only used pubsub a little bit for a small app so I don't know about any short comings, but it worked nice and simple for me. What is your motivation to create your own MVC?
hrs
 
Posts: 86
Joined: Thu Feb 07, 2013 9:26 pm

Re: WxPython Downloader

Postby Yoriz » Tue Feb 04, 2014 8:57 pm

I didn't find a Desktop gui mvc for use with wxpython apart from the python port of puremvc, which is what motivated me to try and make my own version of it to use in my own apps.
New Users, Read This
Join the #python-forum IRC channel on irc.freenode.net!
Spam topic disapproval technician
Windows7, Python 2.7.4., WxPython 2.9.5.0., some Python 3.3
User avatar
Yoriz
 
Posts: 764
Joined: Fri Feb 08, 2013 1:35 am
Location: UK

Re: WxPython Downloader

Postby hrs » Tue Feb 04, 2014 10:54 pm

What do you mean by "Desktop gui mvc" and how does pubsub not fit that description? Or did you start your project before ~2010 when pubsub was made available in wxPython?
hrs
 
Posts: 86
Joined: Thu Feb 07, 2013 9:26 pm

Re: WxPython Downloader

Postby Yoriz » Tue Feb 04, 2014 11:31 pm

"Desktop gui mvc" as in most mvc to be found for python is for web.
Pub sub is a way of sending messages its not mvc, but you could impliment mvc using it for the observable part of mvc.
What ive done is more then just message passing, it keeps your data and your gui code totally seperate from each other.
There are two queued threaded messages channels, one for passing messages to the data, and one for passing data to the gui.
The gui remains responsive while the data is doing long running taks.

With pubsub you send and message and all of its subscribers carry out there tasks and then after they have all finished the gui event loop can continue.

With my code a msg is sent to a queue in a seperate thread and the gui event loop continues instantly,
this thread works on your data and uses another queue in a seperate thread to send data back to the gui.
New Users, Read This
Join the #python-forum IRC channel on irc.freenode.net!
Spam topic disapproval technician
Windows7, Python 2.7.4., WxPython 2.9.5.0., some Python 3.3
User avatar
Yoriz
 
Posts: 764
Joined: Fri Feb 08, 2013 1:35 am
Location: UK


Return to Completed Scripts

Who is online

Users browsing this forum: No registered users and 3 guests