-
Notifications
You must be signed in to change notification settings - Fork 45
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
Update Quamash to work with Python 3.4 asyncio #2
Conversation
I actually think I had it working in py 3.4 but was having problems getting Just a quick few things, If I'm going to maintain this, you need to use And your IDEA IDE stuff should be .gitignored. Really the tabs things makes it hard for me to tell exactly all that has But it does look good, I'll take a closer look at it this evening (Pacific On Tue, Jul 1, 2014 at 6:19 AM, Arve Knudsen notifications@github.com
|
Hi Actually, mine is broken on Unix for the subprocess stuff. I'll have to Arve On Tue, Jul 1, 2014 at 7:34 PM, Mark Harviston notifications@github.com
|
tabs-using python programmers are rare, but we exist, and we didn't get :-) On Tue, Jul 1, 2014 at 10:40 AM, Arve Knudsen notifications@github.com
|
I've made a 'unix' (https://github.com/aknuds1/quamash/tree/unix) branch to Arve On Tue, Jul 1, 2014 at 7:44 PM, Mark Harviston notifications@github.com
|
I've changed spaces to tabs, hopefully it'll be easier to review. |
After testing the 'unix' branch on Windows and fixing correspondingly, I merged it into master. it still doesn't work for subprocess stuff on Unix, but should provide a good starting point. |
@harvimt Have you had a time to look it over yet? I think the Windows side of things should be pretty good at this point, and my tests are finally running on Travis (but not successfully, due to it being Linux). I'm working on the Unix adapter in a separate branch, I think I've sussed out how it's supposed to work at least. |
I've had some time to look at it. Looks like you actually got easycallback to work. easycallback was intended to be an externally usable decorator (even though The exception handler is a good idea, I've definitely had problems with The _common module with just one function in it seems excessive, could be I haven't actually used asyncio for TCP/IP stuff yet (haven't needed to), It will probably be good to add tests to test the QThreadExecutor (probably I don't actually have a machine that can run any of this stuff because it's It'd be super nice if it would work in Qt 4 & 5 with PySide and PyQt, on I've rearranged all my HDs since I got a new SSD, and some of that stuff is This was always a side-project, with the hopes that it would maybe make I'll try to get something working next week with like an actual test README.rst should be a symlink to README. github needs the .rst to know setup.py should be updated. (no more depends tulip, I don't know if there's After all that, we could probably call it v1.0, maybe even upload it to Some sort of continuous integration would be nice, I started to play around Alright, I'm gonna get another beer, I'll get back to you next week. On Fri, Jul 4, 2014 at 8:13 AM, Arve Knudsen notifications@github.com
|
The use of double leading underscores is completely intentional, I know that it leads to name mangling and not really "private" attributes. However, I consistently use double underscores for attributes that are meant to be private, for two reasons: 1. Avoid name clashes when subclassing (have had it happen in the past), 2. Make it absolutely clear that an attribute is an implementation detail and subject to change. Single leading underscores I typically use for "protected" attributes, that may be used throughout the class hierarchy and/or by "friends". Without being able to distinguish between the two, I can't be sure of what's safe to change/remove. The interface is kept as small as possible (which is the guiding principle), but nothing is really hidden from the client either. I've been following this scheme for years, and it's served me well. As regards _common, it'll contain more code once the unix branch is merged into master. There is at least an indirect test of QThreadExecutor, at the moment. It works with PySide (Qt 4.8) and PyQt 5 on Linux, Windows and Mac for me. It's tested continuously on Travis with PySide. The main problem with that is I don't have a binary Linux installer for PySide, so it's built from source on Travis, which takes a long time. |
Note that I now have Quamash working on Unix as well (tested on OS X currently), in the unix branch. Do you want me to merge it into master (after verifying it on Windows ofc.) before you review this pull request? |
The unix branch is now verified as working on Linux, OS X and Windows :) I'm quite happy with the Unix implementation as well, since I was able to implement file/socket polling as reacting to QSocketNotifiers, meaning that there's no need for a background event loop as there is on Windows. Instead, file/socket polling is directly integrated with the Qt event loop, making it simplicity itself! |
packages=['quamash', ], | ||
license=quamash.__license__, | ||
depends=['tulip', 'PyQt', ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
depends
is apparently not a supported option to setup. It's possible to instead use setuptools and dependency_links
.
I've fixed setup.py now, so that authors and email addresses are correctly specified. |
Cool, I fixed the doctests, and they pass. I switched from distutils to setuptools (I really like being able to python Cancelable's weren't being returned by the call* methods, that's fixed. It'd be nice to get more tests really, but this seems pretty good for now. I changed the demo app to something a little bit more interesting, it now Anyway, Quamash is a lot more useful thanks to you, but I'm glad I was at On Wed, Jul 9, 2014 at 1:14 PM, Arve Knudsen notifications@github.com
|
Thanks! I'll be sending you a PR for my UNIX branch as well, for some multi platform goodness. |
ah. to clarify, I pulled the unix branch. But you can send another one. On Thu, Jul 10, 2014 at 11:39 PM, Arve Knudsen notifications@github.com
|
Aha you did, good thinking! |
Hi Mark
I have re-written Quamash to make it work with Python 3.4 asyncio and PyQt 5/PySide. Note that I have only tested with PyQt 5 on Windows so far, and what I have tested is reflected in the automatic tests I've written (in the tests/ directory). Not sure how easy it would be to support older versions of Python. This was my first exposure to Python async, except Twisted.