pyobjc-dev Mailing List for PyObjC (Page 11)
Brought to you by:
ronaldoussoren
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(1) |
Feb
(2) |
Mar
(3) |
Apr
(30) |
May
(18) |
Jun
|
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2002 |
Jan
(7) |
Feb
(2) |
Mar
(1) |
Apr
|
May
|
Jun
(3) |
Jul
(13) |
Aug
|
Sep
(23) |
Oct
(180) |
Nov
(291) |
Dec
(95) |
2003 |
Jan
(338) |
Feb
(352) |
Mar
(97) |
Apr
(46) |
May
(226) |
Jun
(184) |
Jul
(145) |
Aug
(141) |
Sep
(69) |
Oct
(161) |
Nov
(96) |
Dec
(90) |
2004 |
Jan
(66) |
Feb
(87) |
Mar
(98) |
Apr
(132) |
May
(115) |
Jun
(68) |
Jul
(150) |
Aug
(92) |
Sep
(59) |
Oct
(52) |
Nov
(17) |
Dec
(75) |
2005 |
Jan
(84) |
Feb
(191) |
Mar
(133) |
Apr
(114) |
May
(158) |
Jun
(185) |
Jul
(62) |
Aug
(28) |
Sep
(36) |
Oct
(88) |
Nov
(65) |
Dec
(43) |
2006 |
Jan
(85) |
Feb
(62) |
Mar
(92) |
Apr
(75) |
May
(68) |
Jun
(101) |
Jul
(73) |
Aug
(37) |
Sep
(91) |
Oct
(65) |
Nov
(30) |
Dec
(39) |
2007 |
Jan
(24) |
Feb
(28) |
Mar
(10) |
Apr
(2) |
May
(18) |
Jun
(16) |
Jul
(21) |
Aug
(6) |
Sep
(30) |
Oct
(31) |
Nov
(153) |
Dec
(31) |
2008 |
Jan
(63) |
Feb
(70) |
Mar
(47) |
Apr
(24) |
May
(59) |
Jun
(22) |
Jul
(12) |
Aug
(7) |
Sep
(14) |
Oct
(26) |
Nov
(5) |
Dec
(5) |
2009 |
Jan
(10) |
Feb
(41) |
Mar
(70) |
Apr
(88) |
May
(49) |
Jun
(62) |
Jul
(34) |
Aug
(15) |
Sep
(55) |
Oct
(40) |
Nov
(67) |
Dec
(21) |
2010 |
Jan
(60) |
Feb
(17) |
Mar
(26) |
Apr
(26) |
May
(29) |
Jun
(4) |
Jul
(21) |
Aug
(21) |
Sep
(10) |
Oct
(12) |
Nov
(3) |
Dec
(19) |
2011 |
Jan
(3) |
Feb
(13) |
Mar
(8) |
Apr
(8) |
May
(17) |
Jun
(20) |
Jul
(21) |
Aug
(7) |
Sep
|
Oct
|
Nov
(9) |
Dec
(11) |
2012 |
Jan
(3) |
Feb
|
Mar
|
Apr
(5) |
May
(4) |
Jun
(14) |
Jul
(5) |
Aug
(2) |
Sep
(15) |
Oct
(2) |
Nov
(23) |
Dec
(1) |
2013 |
Jan
(8) |
Feb
(1) |
Mar
|
Apr
|
May
(5) |
Jun
(1) |
Jul
(5) |
Aug
(4) |
Sep
|
Oct
(12) |
Nov
(10) |
Dec
(3) |
2014 |
Jan
(7) |
Feb
(14) |
Mar
(2) |
Apr
|
May
(2) |
Jun
(11) |
Jul
(10) |
Aug
(4) |
Sep
|
Oct
(8) |
Nov
(1) |
Dec
(2) |
2015 |
Jan
(9) |
Feb
(7) |
Mar
(1) |
Apr
|
May
(7) |
Jun
|
Jul
(5) |
Aug
(6) |
Sep
|
Oct
(1) |
Nov
(4) |
Dec
|
2016 |
Jan
(1) |
Feb
(1) |
Mar
(4) |
Apr
(2) |
May
(1) |
Jun
|
Jul
(6) |
Aug
(8) |
Sep
(21) |
Oct
(17) |
Nov
|
Dec
(36) |
2017 |
Jan
(6) |
Feb
(2) |
Mar
(4) |
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
(6) |
2018 |
Jan
(2) |
Feb
(3) |
Mar
(3) |
Apr
(14) |
May
(2) |
Jun
(2) |
Jul
(4) |
Aug
(3) |
Sep
(6) |
Oct
(16) |
Nov
(1) |
Dec
(6) |
2019 |
Jan
(3) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
(6) |
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
(1) |
Jul
(7) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
(2) |
Dec
(1) |
2021 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(5) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2025 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Bob I. <bo...@re...> - 2015-02-02 18:00:39
|
On Sun, Feb 1, 2015 at 11:20 PM, Ronald Oussoren <ron...@ma...> wrote: > > > On 29 Jan 2015, at 21:22, Sean Robinson <sea...@sc...> > wrote: > > > > On 01/29/15 11:20, Ronald Oussoren wrote: > >>> On 10 Dec 2014, at 23:11, Ronald Oussoren <ron...@ma...> > wrote: > >>> I’m not sure how to make serious progress with my current load (both > work and privately). Does anyone have experience with crowd-funding for > open-source work? > >> > >> I guess not. I’m still interested in idea’s on how to improve > development/support for PyObjC. > >> > > > > Have you considered applying to the Python Software Foundation for a > grant? > > Not really, the work that needs to be done is IMHO only partially related > to the PSF mission. Apart from that I think I’d should try to raise some > funding from the community before talking to the PSF, at the very least > that would show that it wouldn’t be a complete waste of funds. > > Before I can do any of that I’d have to get a clearer picture of what I’d > like to do, and (more importantly) how to accomplish that. > Have you tried talking to anyone at Dropbox yet? They appear to still be using PyObjC in the Mac app, they might have the right incentives. -bob |
From: Jim T. <jw...@On...> - 2015-02-02 10:15:43
|
On 02/02/2015 03:50 PM, Ronald Oussoren wrote: > That’s my perception as well. A site like kickstarter also appears to > require you to work on a specific product (a gadget, new software, …) > and not ongoing development of an existing project. I've supported a project on BountySource that was for continuing support. (BountySource has both "issue bounties" and more general "project fundraisers.") https://www.bountysource.com/ https://github.com/bountysource/frontend/wiki/Frequently-Asked-Questions But I worry that the size of the community will make it difficult to generate enough funding. -- Jim Tittsler http://www.OnJapan.net/ GPG: 0x01159DB6 Python Starship http://Starship.Python.net/crew/jwt/ Mailman IRC irc://irc.freenode.net/#mailman |
From: Ronald O. <ron...@ma...> - 2015-02-02 07:21:56
|
> On 29 Jan 2015, at 21:22, Sean Robinson <sea...@sc...> wrote: > > On 01/29/15 11:20, Ronald Oussoren wrote: >>> On 10 Dec 2014, at 23:11, Ronald Oussoren <ron...@ma...> wrote: >>> I’m not sure how to make serious progress with my current load (both work and privately). Does anyone have experience with crowd-funding for open-source work? >> >> I guess not. I’m still interested in idea’s on how to improve development/support for PyObjC. >> > > Have you considered applying to the Python Software Foundation for a grant? Not really, the work that needs to be done is IMHO only partially related to the PSF mission. Apart from that I think I’d should try to raise some funding from the community before talking to the PSF, at the very least that would show that it wouldn’t be a complete waste of funds. Before I can do any of that I’d have to get a clearer picture of what I’d like to do, and (more importantly) how to accomplish that. Ronald > > > -- > Sean Robinson > Physical Sciences Lab Technician > Physics, Astronomy, Geology > Scottsdale Community College |
From: Ronald O. <ron...@ma...> - 2015-02-02 07:10:34
|
> On 29 Jan 2015, at 21:17, Chris Barker <chr...@no...> wrote: > > On Thu, Jan 29, 2015 at 10:20 AM, Ronald Oussoren <ron...@ma... <mailto:ron...@ma...>> wrote: >> I’m not sure how to make serious progress with my current load (both work and privately). Does anyone have experience with crowd-funding for open-source work? > > I guess not. I’m still interested in idea’s on how to improve development/support for PyObjC. > > I sure don't have any experience with crown funding. But are you saying that you could put time into it if you could get paid? Currently in a limited way, I’d have to take time of from work to put in more time. My initial mail was in a large part triggered by frustration about the fairly large gap between the amount of work that needs to done and the time I have available at moment (and have had for the last year). What also doesn’t help is that I’m currently primarily working on updating the PyObjC framework wrappers with support for APIs introduced in OSX 10.9 and 10.10, and that’s pretty boring work. I’m reaching the end of that task although the last few frameworks are the most complicated in this regard. When that’s done it should be easier to find the motivation to move forward again with real development. > > Maybe kick starter? thought this: > > http://blog.felixbreuer.net/2013/04/24/crowdfunding-for-open-source.html <http://blog.felixbreuer.net/2013/04/24/crowdfunding-for-open-source.html> > > indicates that it doesn't work well for Open source projects. That’s the impression I got as well. What doesn’t help in that regard is that Python OSX GUI development is a fairly small niche, and I have no idea how large that niche is. > > Are you set up with a consultancy so that people could pay you for a particular bug fix or feature? Nope. Although that should be not to hard to do when there’d be a reason to do so (he said without having any experience in doing so). I’m currently full-time employed doing consultancy, and the last couple of years that has been mostly Linux and not OSX work. Ronald |
From: Ronald O. <ron...@ma...> - 2015-02-02 06:51:01
|
> On 29 Jan 2015, at 20:46, Diez B. Roggisch <de...@we...> wrote: > > Hi, > > >> On 29 Jan 2015, at 19:20, Ronald Oussoren <ron...@ma... <mailto:ron...@ma...>> wrote: >> >>> On 10 Dec 2014, at 23:11, Ronald Oussoren <ron...@ma... <mailto:ron...@ma...>> wrote: >>> I’m not sure how to make serious progress with my current load (both work and privately). Does anyone have experience with crowd-funding for open-source work? >> >> I guess not. I’m still interested in idea’s on how to improve development/support for PyObjC. > > This is not from personal experience, but observation of other maintainers e.g. like Christian Tismer & the psyco optimizing Python JIT, and the stackless python implementation. > > For both cases, he scored consulting gigs with companies that heavily used his projects, so that he could work on them and improve them. One was a computer trading company somewhere in the US, the other with the game studio CCP of Eve Online fame. > > So my suggestion would be to seek out companies that use pyobjc, and ask if they have an interest in employing you, on whatever base. > > Sorry that I can’t be of more help - crowd-funding has not worked for me so far, as these things seem to need (in my limited perception, not really deeply surveyed the landscape) a goal that has a certain “sexyness” (in lieu of a better term) - usually, that means a consumer product, such as a game, or self-driving cool box or some such. That’s my perception as well. A site like kickstarter also appears to require you to work on a specific product (a gadget, new software, …) and not ongoing development of an existing project. Ronald > > Diez |
From: Ian M. <ip...@po...> - 2015-01-30 16:43:55
|
As others have mentioned, most of the success stories I've heard for open-source maintainers going full-time revolve either around consulting gigs, or getting in-sourced to a company that's dedicated to the technology. I assume that if such an opportunity were available, and interested you, that you'd be doing it, so I infer that it's not. My impression is that for crowd funding open source projects to work, there has to be a sizable "crowd". You (Ronald) would know better than I, but I don't get the feeling that 'Python for native OS X development' has a very big crowd at the moment. With that in mind, when I think about PyObjC, and how it could attract more financial support, and specifically through crowd funding, I very quickly find myself thinking about ways to increase the user base. While the tasks you enumerated all sound like worthy steps to take in terms of the big picture, I'm not sure that any of them (directly, anyway) seem like the kind of thing that's going to attract tons of new users and help develop significant traction for the project. While OS X market penetration is rising with the tide of Apple as a whole, it seems like the most obvious way for PyObjC to get more traction would be to focus on making it a viable toolchain for iOS development. Without looking any further than the `ios` and `osx` tags on StackOverflow, the population of iOS developers positively dwarfs that of OS X developers. Furthermore, many iOS developers are new to the platform, and/or are writing cross-platform software, where the ability to work in a language like Python might be a really significant advantage. Of course, bringing PyObjC to iOS development involves a bunch of work that doesn't sound all that fun. Building Python for ARM, building PyObjC for ARM, spooling up a whole new platform's worth of metadata, making everything work in the simulator, integrating with Xcode, packaging, code-signing, all that crap. It sounds tedious, to say the least. But from where I sit, getting up and running on iOS seems like the best chance for PyObjC to become financially self-sufficient. Hell, bringing PyObjC to iOS sounds like a pretty good thing for a Python-using company to hire you to do, no? :) For my part, I mostly prefer working in the desktop idiom with OS X, so don't take this as the pining of an iOS fanatic. I'm just saying, funding feels likely to follow the crowd, and the crowd is, these days, without a doubt, on iOS. Anyway, I don't know if this is helpful at all, but it seemed like it was worth saying, so... Regards, Ian On Thu, Jan 29, 2015 at 1:20 PM, Ronald Oussoren <ron...@ma...> wrote: > On 10 Dec 2014, at 23:11, Ronald Oussoren <ron...@ma...> wrote: > > I’m not sure how to make serious progress with my current load (both work > and privately). Does anyone have experience with crowd-funding for > open-source work? > > > I guess not. I’m still interested in idea’s on how to improve > development/support for PyObjC. > > Ronald > > On 10 Dec 2014, at 23:11, Ronald Oussoren <ron...@ma...> wrote: > > Hi, > > ’Tis the time to be contemplative, and I’ve been thinking a bit about > PyObjC, py2app: what I’d like to do with them, and how much time I have to > work on them. Things don’t quite add up because there’s a lot more that > I’d like to do than I expect to be able to do in any reasonable timeframe. > > In no particular order (and far from complete): > > > - Finish work to add metadata for APIs introduced in OSX 10.10 and > 10.9 (update existing framework wrappers and add new ones where appropriate) > > It should be pretty straightforward to add metadata now that > objective.metadata is based on libclang (thanks to James Ranking). It is > however still a relatively large amount of work because it is necessary to > manually check which APIs require manual additions to the metadata, and > because I prefer to add unittests for the framework wrappers because those > have caught a fair amount of problems in the past. > > - Python 3.4 adds an “asyncio” library (with backports on PyPI). It > would be useful to add a pluggable event loop that integrates with Cocoa’s > runloop (NSRunloop and CFRunloop), and furthermore it would be interesting > to see if the tasks and coroutines from asyncio can be used to simplify > Cocoa code: any Cocoa code with a “completionHandler” argument block might > give nicer python code when used from a coroutine. > > That is, instead of something like: > > def onCompletion(result): > # … > > anObject.runTaskWithCompletionHandler(onCompletion) > > you’d get something like: > > result = anObject.runTask() > # … > > - There needs to be a significant example of how to write a GUI > without using XIB files. > - To expand on the previous item: there needs to be a non-trivial > example for writing a GUI with PyObjC that addresses issues one commonly > runs into with writing code (aggressivly catch python exceptions before > they cause problems in Cocoa, …). This can be used to enhance PyObjC > itself: instead of adding work-arounds for odd behavior try to address the > root cause. > > - It’s time to try to refactor py2app into a library that does the > work and a setuptools extension for the API. There are two reasons for > that: this gives us a fighting chance to add useful unittests (py2app’s > tests currently are primarily slow integration tests), and secondly this > would make it a lot easier to design a modern interface that doesn’t rely > on setuptools (using a declarative configuration file, …) > > - py2app currently doesn’t support code signing, setuptools metadata, > adding entire eggs/wheels and more. All of those are more and more > necessary to ship the output of py2app outside of a controlled environment > and AFAIK a number of py2app users work around the lack of those features > by adding pre- and post-process scripting around py2app. > > - Both py2app and PyObjC need significant work on their documentation. > The documentation for py2app is minimal enough to make it effectively > non-existing. > > - PyObjC and py2app need some form of CI, especially for supporting > platforms and libraries I don’t use regularly myself (for example OSX 10.6 > support in PyObjC and support for PyQt in py2app). Something like Jenkins > or buildbot could work, but setting up the infrastructure requires effort. > I currently have to manually test, and due to lack of time I rarely run on > older OSX releases and that seems to have resulted in breakage (for example > issue #100 on PyObjC’s tracker). > > > I’m not sure how to make serious progress with my current load (both work > and privately). Does anyone have experience with crowd-funding for > open-source work? > > Ronald > > > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > > http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk_______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > > > > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming. The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is > your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. Take a > look and join the conversation now. http://goparallel.sourceforge.net/ > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > > |
From: Ian M. <ip...@po...> - 2015-01-30 16:07:38
|
I think it's fair to say we're going to need some more details about what you're trying to achieve. You mention AppCode. Do you mean the JetBrains Objective-C IDE? Are you trying to write a plug in or extension or something? Tell us more. Ian On Thu, Jan 15, 2015 at 5:34 PM, Stephen Bespalko <sj...@co...> wrote: > I would like to be able to return various AppCode, mostly, objects to > PyObjC in a way that I can interact with the objects. I thought I could > read the PyObjC code to figure it out - but instead I came away > empty-handed. > > Is there an example somewhere, instructions, or is it possible to explain > how I could return an object - the first one I wanted to “wrap” is simply > an NSWindow. > > Sincerely, > Stephen Bespalko > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming. The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is > your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. Take a > look and join the conversation now. http://goparallel.sourceforge.net/ > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > |
From: Chris B. <chr...@no...> - 2015-01-29 20:18:34
|
On Thu, Jan 29, 2015 at 10:20 AM, Ronald Oussoren <ron...@ma...> wrote: > I’m not sure how to make serious progress with my current load (both work > and privately). Does anyone have experience with crowd-funding for > open-source work? > > > I guess not. I’m still interested in idea’s on how to improve > development/support for PyObjC. > I sure don't have any experience with crown funding. But are you saying that you could put time into it if you could get paid? Maybe kick starter? thought this: http://blog.felixbreuer.net/2013/04/24/crowdfunding-for-open-source.html indicates that it doesn't work well for Open source projects. Are you set up with a consultancy so that people could pay you for a particular bug fix or feature? For example, the US federal government (which I work for) can not donate to anything. We can, however, pay a contractor to provide a particular service. As an example, we are right now wrestling with PY2App to distribute a product. If we could have hired you to get that all set up for us, then you may have been able to get a few bugs fixed, while we could have gotten what we needed to economically. NOTE: it's too late now, and It might have been difficult for us to contract with a non-US entity, but you get the idea. As a matter of fact, we did something much like this with Robin Dunn, the wxPython developer -- we hired him to extend an app of ours that required some updating/improving of wxPython. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
From: Diez B. R. <de...@we...> - 2015-01-29 19:47:22
|
Hi, > On 29 Jan 2015, at 19:20, Ronald Oussoren <ron...@ma...> wrote: > >> On 10 Dec 2014, at 23:11, Ronald Oussoren <ron...@ma... <mailto:ron...@ma...>> wrote: >> I’m not sure how to make serious progress with my current load (both work and privately). Does anyone have experience with crowd-funding for open-source work? > > I guess not. I’m still interested in idea’s on how to improve development/support for PyObjC. This is not from personal experience, but observation of other maintainers e.g. like Christian Tismer & the psyco optimizing Python JIT, and the stackless python implementation. For both cases, he scored consulting gigs with companies that heavily used his projects, so that he could work on them and improve them. One was a computer trading company somewhere in the US, the other with the game studio CCP of Eve Online fame. So my suggestion would be to seek out companies that use pyobjc, and ask if they have an interest in employing you, on whatever base. Sorry that I can’t be of more help - crowd-funding has not worked for me so far, as these things seem to need (in my limited perception, not really deeply surveyed the landscape) a goal that has a certain “sexyness” (in lieu of a better term) - usually, that means a consumer product, such as a game, or self-driving cool box or some such. Diez |
From: Ronald O. <ron...@ma...> - 2015-01-29 18:21:29
|
> On 10 Dec 2014, at 23:11, Ronald Oussoren <ron...@ma...> wrote: > I’m not sure how to make serious progress with my current load (both work and privately). Does anyone have experience with crowd-funding for open-source work? I guess not. I’m still interested in idea’s on how to improve development/support for PyObjC. Ronald > On 10 Dec 2014, at 23:11, Ronald Oussoren <ron...@ma...> wrote: > > Hi, > > ’Tis the time to be contemplative, and I’ve been thinking a bit about PyObjC, py2app: what I’d like to do with them, and how much time I have to work on them. Things don’t quite add up because there’s a lot more that I’d like to do than I expect to be able to do in any reasonable timeframe. > > In no particular order (and far from complete): > > Finish work to add metadata for APIs introduced in OSX 10.10 and 10.9 (update existing framework wrappers and add new ones where appropriate) > > It should be pretty straightforward to add metadata now that objective.metadata is based on libclang (thanks to James Ranking). It is however still a relatively large amount of work because it is necessary to manually check which APIs require manual additions to the metadata, and because I prefer to add unittests for the framework wrappers because those have caught a fair amount of problems in the past. > > Python 3.4 adds an “asyncio” library (with backports on PyPI). It would be useful to add a pluggable event loop that integrates with Cocoa’s runloop (NSRunloop and CFRunloop), and furthermore it would be interesting to see if the tasks and coroutines from asyncio can be used to simplify Cocoa code: any Cocoa code with a “completionHandler” argument block might give nicer python code when used from a coroutine. > > That is, instead of something like: > > def onCompletion(result): > # … > > anObject.runTaskWithCompletionHandler(onCompletion) > > you’d get something like: > > result = anObject.runTask() > # … > > There needs to be a significant example of how to write a GUI without using XIB files. > To expand on the previous item: there needs to be a non-trivial example for writing a GUI with PyObjC that addresses issues one commonly runs into with writing code (aggressivly catch python exceptions before they cause problems in Cocoa, …). This can be used to enhance PyObjC itself: instead of adding work-arounds for odd behavior try to address the root cause. > > It’s time to try to refactor py2app into a library that does the work and a setuptools extension for the API. There are two reasons for that: this gives us a fighting chance to add useful unittests (py2app’s tests currently are primarily slow integration tests), and secondly this would make it a lot easier to design a modern interface that doesn’t rely on setuptools (using a declarative configuration file, …) > > py2app currently doesn’t support code signing, setuptools metadata, adding entire eggs/wheels and more. All of those are more and more necessary to ship the output of py2app outside of a controlled environment and AFAIK a number of py2app users work around the lack of those features by adding pre- and post-process scripting around py2app. > > Both py2app and PyObjC need significant work on their documentation. The documentation for py2app is minimal enough to make it effectively non-existing. > > PyObjC and py2app need some form of CI, especially for supporting platforms and libraries I don’t use regularly myself (for example OSX 10.6 support in PyObjC and support for PyQt in py2app). Something like Jenkins or buildbot could work, but setting up the infrastructure requires effort. I currently have to manually test, and due to lack of time I rarely run on older OSX releases and that seems to have resulted in breakage (for example issue #100 on PyObjC’s tracker). > > I’m not sure how to make serious progress with my current load (both work and privately). Does anyone have experience with crowd-funding for open-source work? > > Ronald > > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk_______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
From: Stephen B. <sj...@co...> - 2015-01-15 22:34:27
|
I would like to be able to return various AppCode, mostly, objects to PyObjC in a way that I can interact with the objects. I thought I could read the PyObjC code to figure it out - but instead I came away empty-handed. Is there an example somewhere, instructions, or is it possible to explain how I could return an object - the first one I wanted to “wrap” is simply an NSWindow. Sincerely, Stephen Bespalko |
From: Jake W. <del...@gm...> - 2015-01-04 12:51:04
|
Great, thanks. I will try. On Sun, Jan 4, 2015 at 7:56 PM, Ronald Oussoren <ron...@ma...> wrote: > > On 04 Jan 2015, at 01:43, Jake Wang <del...@gm...> wrote: > > I would like to ask users for access of assistive devices in Python. > > In Objc, I saw it could be done via the code below: > > NSDictionary *options = @{(id)kAXTrustedCheckOptionPrompt : @YES}; > BOOL accessibilityEnabled = > AXIsProcessTrustedWithOptions((CFDictionaryRef)options); > > Can we use PyObjc to implement similar function in Python? > > > It is possbile to use this function using PyObjC, but you will have to do > some work to access the API because the ApplicationServices framework is > not yet wrapped. > > import objc > b = objc.loadBundle('CoreServices', globals(), > '/System/Library/Frameworks/ApplicationServices.framework') > objc.loadBundleFunctions(b, globals(), [('AXIsProcessTrustedWithOptions', > b'Z@')]) > objc.loadBundleVariables(b, globals(), [('kAXTrustedCheckOptionPrompt', b'@ > ')]) > > print AXIsProcessTrustedWithOptions({kAXTrustedCheckOptionPrompt: True}) > > Ronald > > Thanks a lot. > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming! The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is > your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. Take a > look and join the conversation now. > http://goparallel.sourceforge.net_______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > > > |
From: Ronald O. <ron...@ma...> - 2015-01-04 11:57:26
|
> On 04 Jan 2015, at 01:43, Jake Wang <del...@gm...> wrote: > > I would like to ask users for access of assistive devices in Python. > > In Objc, I saw it could be done via the code below: > > NSDictionary *options = @{(id)kAXTrustedCheckOptionPrompt : @YES}; > BOOL accessibilityEnabled = AXIsProcessTrustedWithOptions((CFDictionaryRef)options); > > Can we use PyObjc to implement similar function in Python? It is possbile to use this function using PyObjC, but you will have to do some work to access the API because the ApplicationServices framework is not yet wrapped. import objc b = objc.loadBundle('CoreServices', globals(), '/System/Library/Frameworks/ApplicationServices.framework') objc.loadBundleFunctions(b, globals(), [('AXIsProcessTrustedWithOptions', b'Z@')]) objc.loadBundleVariables(b, globals(), [('kAXTrustedCheckOptionPrompt', b'@')]) print AXIsProcessTrustedWithOptions({kAXTrustedCheckOptionPrompt: True}) Ronald > Thanks a lot. > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming! The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. Take a > look and join the conversation now. http://goparallel.sourceforge.net_______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
From: Jake W. <del...@gm...> - 2015-01-04 00:43:45
|
I would like to ask users for access of assistive devices in Python. In Objc, I saw it could be done via the code below: NSDictionary *options = @{(id)kAXTrustedCheckOptionPrompt : @YES}; BOOL accessibilityEnabled = AXIsProcessTrustedWithOptions((CFDictionaryRef)options); Can we use PyObjc to implement similar function in Python? Thanks a lot. |
From: Ronald O. <ron...@ma...> - 2014-12-10 22:11:23
|
Hi, ’Tis the time to be contemplative, and I’ve been thinking a bit about PyObjC, py2app: what I’d like to do with them, and how much time I have to work on them. Things don’t quite add up because there’s a lot more that I’d like to do than I expect to be able to do in any reasonable timeframe. In no particular order (and far from complete): Finish work to add metadata for APIs introduced in OSX 10.10 and 10.9 (update existing framework wrappers and add new ones where appropriate) It should be pretty straightforward to add metadata now that objective.metadata is based on libclang (thanks to James Ranking). It is however still a relatively large amount of work because it is necessary to manually check which APIs require manual additions to the metadata, and because I prefer to add unittests for the framework wrappers because those have caught a fair amount of problems in the past. Python 3.4 adds an “asyncio” library (with backports on PyPI). It would be useful to add a pluggable event loop that integrates with Cocoa’s runloop (NSRunloop and CFRunloop), and furthermore it would be interesting to see if the tasks and coroutines from asyncio can be used to simplify Cocoa code: any Cocoa code with a “completionHandler” argument block might give nicer python code when used from a coroutine. That is, instead of something like: def onCompletion(result): # … anObject.runTaskWithCompletionHandler(onCompletion) you’d get something like: result = anObject.runTask() # … There needs to be a significant example of how to write a GUI without using XIB files. To expand on the previous item: there needs to be a non-trivial example for writing a GUI with PyObjC that addresses issues one commonly runs into with writing code (aggressivly catch python exceptions before they cause problems in Cocoa, …). This can be used to enhance PyObjC itself: instead of adding work-arounds for odd behavior try to address the root cause. It’s time to try to refactor py2app into a library that does the work and a setuptools extension for the API. There are two reasons for that: this gives us a fighting chance to add useful unittests (py2app’s tests currently are primarily slow integration tests), and secondly this would make it a lot easier to design a modern interface that doesn’t rely on setuptools (using a declarative configuration file, …) py2app currently doesn’t support code signing, setuptools metadata, adding entire eggs/wheels and more. All of those are more and more necessary to ship the output of py2app outside of a controlled environment and AFAIK a number of py2app users work around the lack of those features by adding pre- and post-process scripting around py2app. Both py2app and PyObjC need significant work on their documentation. The documentation for py2app is minimal enough to make it effectively non-existing. PyObjC and py2app need some form of CI, especially for supporting platforms and libraries I don’t use regularly myself (for example OSX 10.6 support in PyObjC and support for PyQt in py2app). Something like Jenkins or buildbot could work, but setting up the infrastructure requires effort. I currently have to manually test, and due to lack of time I rarely run on older OSX releases and that seems to have resulted in breakage (for example issue #100 on PyObjC’s tracker). I’m not sure how to make serious progress with my current load (both work and privately). Does anyone have experience with crowd-funding for open-source work? Ronald |
From: Ronald O. <ron...@ma...> - 2014-12-07 23:33:47
|
Hi, I just uploaded PyObjC 3.0.4 to PyPI. It contains a number of bug fixes relative to 3.0.3: * Fix installation on OSX 10.10 when using "pip install pyobjc". Issues #102, #103. * Fix crash when ``sys.modules`` contains an object that is not a string. Issue #95. * Fix crash on OSX 10.8 or later when using a 32-bit build and accessing an instance of "Object" (that is, pre-Nextstep classes). * Fix a crash when using blocks without metadata, but with a block signature from the block runtime. Issue #106 * ``PyObjCTools.MachSignals`` likely hasn't worked at all since PyObjC 2.0 because it uses a C module that was never ported to PyObjC 2.0. This private module is reintroduced in this release (with a slightly changed API) Issue #109 WARNING: Most of these fixes have not been merged to the default branch yet. That branch is still in flux due to work on supporting new API’s introduced in OSX 10.10 (and for a large part 10.9). I don’t know when the next release from the default branch (that is, 3.1) will be, that depends on how much time I can spend on updating the metadata. I expect that I can spend at best two evenings a week on this, which means I should be lucky to release 3.1 this year :-(. I’d love to spend more time on PyObjC (for example to add support for asyncio as introduced in Python 3.4), but don’t know how to arrange for that. Ronald P.S. I had hoped to release 3.0.4 last weekend, but the fix for #106 took much more time time than expected due to running into some very strange behavior that may turn out to be a system or CPython bug. |
From: <mut...@gm...> - 2014-11-12 07:57:18
|
Hi, mut...@gm... wants to follow you. ****** Is mut...@gm... you friend? ****** If Yes please follow the link below: http://invites.infoaxe.net/signup_e.html?fullname=Pyobjc-dev+List&email=pyo...@li...&invitername=muthonimasinde&inviterid=34292172&userid=0&token=0&emailmasterid=945d8e19-eb41-4c26-a767-e32110a74862&from=mut...@gm...&src=txt_yes If No please follow the link below: http://invites.infoaxe.net/signup_e.html?fullname=Pyobjc-dev+List&email=pyo...@li...&invitername=muthonimasinde&inviterid=34292172&userid=0&token=0&emailmasterid=945d8e19-eb41-4c26-a767-e32110a74862&from=mut...@gm...&src=txt_no Follow the link below to remove yourself from all such emails http://invites.infoaxe.net/uns_inviter.jsp?email=pyo...@li...&iid=945d8e19-eb41-4c26-a767-e32110a74862&from=mut...@gm... |
From: Eric Le L. <ker...@us...> - 2014-10-08 15:17:29
|
Le Wed, 8 Oct 2014 08:56:29 -0500, Ken Thomases <ke...@co...> a écrit : > On Oct 8, 2014, at 5:48 AM, Eric Le Lay > <ker...@us...> wrote: > > > tap = Quartz.CGEventTapCreate( > > Quartz.kCGSessionEventTap, > > Quartz.kCGHeadInsertEventTap, > > Quartz.kCGEventTapOptionDefault, > > # NSSystemDefined for media keys > > Quartz.CGEventMaskBit(NSSystemDefined), > > self.eventTap, > > None > > ) > > port = > > NSMachPort.alloc().initWithMachPort_options_(CFMachPortGetPort(tap), > > NSMachPortDeallocateNone) loop = NSRunLoop.currentRunLoop() > > loop.addPort_forMode_(port, NSDefaultRunLoopMode) > > Why are you not doing what the docs for CGEventTapCreate() suggest: > pass the CFMachPortRef returned from it to > CFMachPortCreateRunLoopSource() and then add the resulting source to > the run loop using CFRunLoopAddSource()? > Ken, thank you for your answer. The actual code is part of a gtk application. It used to do as you suggest: tap = Quartz.CGEventTapCreate(...) runLoopSource = Quartz.CFMachPortCreateRunLoopSource(None, tap, 0) Quartz.CFRunLoopAddSource( Quartz.CFRunLoopGetCurrent(), runLoopSource, Quartz.kCFRunLoopDefaultMode ) Quartz.CGEventTapEnable(tap, True) The event was not processed until the main window got focus and then the eventtap was disabled because it had not answered in time. I stumbled upon the macrumors post about the same problem and tried that code. It seemed to make sense and did work in objective-c so I thought it would work just as well in python. Now, the objective-c has the same problem + can't close the main window or it freezes the computer. I can live with the event not being delivered until the main window shows up. I then re-enable the tap as I receive the disabled event. Thanks again for your time, Eric |
From: Ken T. <ke...@co...> - 2014-10-08 13:56:39
|
On Oct 8, 2014, at 5:48 AM, Eric Le Lay <ker...@us...> wrote: > tap = Quartz.CGEventTapCreate( > Quartz.kCGSessionEventTap, > Quartz.kCGHeadInsertEventTap, > Quartz.kCGEventTapOptionDefault, > # NSSystemDefined for media keys > Quartz.CGEventMaskBit(NSSystemDefined), > self.eventTap, > None > ) > port = NSMachPort.alloc().initWithMachPort_options_(CFMachPortGetPort(tap), NSMachPortDeallocateNone) > loop = NSRunLoop.currentRunLoop() > loop.addPort_forMode_(port, NSDefaultRunLoopMode) Why are you not doing what the docs for CGEventTapCreate() suggest: pass the CFMachPortRef returned from it to CFMachPortCreateRunLoopSource() and then add the resulting source to the run loop using CFRunLoopAddSource()? Regards, Ken |
From: Eric Le L. <ker...@us...> - 2014-10-08 10:48:48
|
Hello list, I've encountered a problem when trying to register and event tap: The error occurs when calling loop.addPort_forMode_(port, NSDefaultRunLoopMode) in test_app.py, included below. Can someone see what I'm doing wrong? My code is an adaptation of the first response in http://forums.macrumors.com/showthread.php?t=1145465 The objective-c version does work. Thanks, Eric ________________ test_app.py ___________________________ #Traceback (most recent call last): # File "/Users/elelay/Desktop/test_app.py", line 35, in <module> # eventTap.runEventsCapture() # File "/Users/elelay/Desktop/test_app.py", line 30, in runEventsCapture # loop.addPort_forMode_(port, NSDefaultRunLoopMode) # ValueError: NSInvalidArgumentException - *** -scheduleInRunLoop:forMode: cannot be sent to an abstract object of class NSMachPort: Create a concrete instance! # from AppKit import NSSystemDefined, NSApp import Quartz from CoreFoundation import CFMachPortGetPort from Foundation import NSMachPortDeallocateNone, \ NSRunLoop, NSDefaultRunLoopMode, \ NSMachPort class MacKeyEventsTap(object): def __init__(self): pass def eventTap(self, proxy, type_, event, refcon): print("eventTap()") return event def runEventsCapture(self): tap = Quartz.CGEventTapCreate( Quartz.kCGSessionEventTap, Quartz.kCGHeadInsertEventTap, Quartz.kCGEventTapOptionDefault, # NSSystemDefined for media keys Quartz.CGEventMaskBit(NSSystemDefined), self.eventTap, None ) port = NSMachPort.alloc().initWithMachPort_options_(CFMachPortGetPort(tap), NSMachPortDeallocateNone) loop = NSRunLoop.currentRunLoop() loop.addPort_forMode_(port, NSDefaultRunLoopMode) NSApp.run() if __name__ == '__main__': eventTap = MacKeyEventsTap() eventTap.runEventsCapture() |
From: Gerard T. <gto...@gm...> - 2014-10-06 23:15:50
|
Hi Robert, It looks like what we're trying to achieve in the way envisioned isn't the most reliable way of doing things. We've tried to do this through distributed objects instead, which have the advantage that the run loop is no longer involved. That does work, which is good, but we're probably going to merge the separate daemon process into the web server as a library and run it from a separate thread, so that it all becomes one process instead. The complexity that we wanted to avoid there is to write a wrapper around the library so it becomes available from a python perspective. Thanks for your help! G> On Mon, Oct 6, 2014 at 5:26 PM, Robert Klep <rob...@gm...> wrote: > I'm not very familiar with Mach ports, but I can reproduce the problem. > > It seems to be rather specific to Mach ports, because it works better (in > that it doesn't hang in the call to NSRunLoop.addPort_forMode_() anymore) > using an NSSocketPort. > > NSMachPort.scheduleForRunLoop_forMode_(), interestingly, throws a SIGSEGV. > > Anyway, I really can't provide you with more help at this point :) > > – robert > > Gerard Toonstra <gto...@gm...> wrote on Mon Oct 06 2014 at > 20:13:30: > > Hi Robert, > > Not a problem at all, I'm always open to suggestions. We do actually have > a redis server running, but that's to communicate regional or global events > from a number of servers. Also, the project doesn't mandate that that redis > process is running, so it's not critical in the system. It's only used to > give the system overall a slightly more realtime nature. > > In this case, the webserver always runs on the same machine where the > hardware events are occurring. For that reason, I was looking for a more > direct way of communicating > to the webserver without creating this dependency on redis. However, I'm > not sure if I can get the proxy to work that way because of the way how > threads and runloops of osx work. > > So I tried to implement what's going on here: > > > https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Notifications/Articles/Threading.html > > In the 'setUpThreadingSupport" function, it hangs on the > > [[NSRunLoop currentRunLoop] addPort:self.notificationPort > > forMode:(NSString __bridge *)kCFRunLoopCommonModes]; > call and CPU goes to 100%. The "self" object is an NSObject. > > My assumption is that I am looking at the right way to enable threaded > reception of distributed notifications and handle them in that code. > The main thread of the webserver is controlled by django and doesn't > eventually call the "control loop", which could be another reason this > doesn't work well. > > Is this something that ought to work anyway, or would you recommend, given > the rest of the architecture, to do this another way? > > Rgds, > > Gerard > > > On Mon, Oct 6, 2014 at 2:18 PM, Robert Klep <rob...@gm...> wrote: > >> Hoi Gerard, >> >> I certainly don't want to berate your project, but just wondering: >> wouldn't it be much easier to use something like Redis (or a full-blown MQ >> broker) to distribute notifications? >> >> – robert >> >> Gerard Toonstra <gto...@gm...> wrote on Mon Oct 06 2014 at >> 18:08:47: >> > Hello, >> > >> > I'm new to pyobjc. We're using it for a project to receive events from >> a command line tool in C which interfaces to drivers to generate events on >> hardware changes. >> > >> > There's another process coded in 100% python where we want to receive >> such notifications and use them. Unfortunately, we haven't had much luck so >> far. This 100% python process is a webserver, specifically django. In the >> startup code, we want to create a class (singleton) that creates a separate >> thread to deal with these distributed notifications. >> > >> > For a small test script as a proof of concept, the runConsoleEventLoop >> is called from the main thread and everything works. Apparently because >> each thread has or should have its own input sources and the main thread is >> responsible for those. Creating a new thread requires the programmer to add >> their own. Not doing that, the loop immediately returns as the "nextfire" >> variable will be "None". >> > >> > We've been struggling to add our own input source, specifically one >> that deals with distributed notifications, to this runloop. When we call >> the following code: >> > >> > self.notifications = NSMutableArray.alloc().init() >> > self.notiticationLock = NSLock.alloc().init() >> > self.notificationThread = NSThread.currentThread() >> > >> > self.notificationPort = NSMachPort.alloc().init() >> > self.notificationPort.setDelegate_(self) >> > runLoop = NSRunLoop.currentRunLoop() >> > runLoop.addPort_forMode_( self.notificationPort, >> kCFRunLoopCommonModes ) >> > >> > It hangs on the last line "addPort_forMode_" and so we never get to the >> loop section. I think that's a bug, because the same code is used by an >> example from Apple, where they'd call run() or some other equivalent to >> start processing those events in the run loop. >> > >> > What are we doing wrong? does anyone know an example that demonstrates >> this? >> > >> >> > > ------------------------------------------------------------------------------ > Slashdot TV. Videos for Nerds. Stuff that Matters. > > http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk_______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > > |
From: Robert K. <rob...@gm...> - 2014-10-06 20:26:35
|
I'm not very familiar with Mach ports, but I can reproduce the problem. It seems to be rather specific to Mach ports, because it works better (in that it doesn't hang in the call to NSRunLoop.addPort_forMode_() anymore) using an NSSocketPort. NSMachPort.scheduleForRunLoop_forMode_(), interestingly, throws a SIGSEGV. Anyway, I really can't provide you with more help at this point :) – robert Gerard Toonstra <gto...@gm...> wrote on Mon Oct 06 2014 at 20:13:30: > Hi Robert, > > Not a problem at all, I'm always open to suggestions. We do actually have a redis server running, but that's to communicate regional or global events from a number of servers. Also, the project doesn't mandate that that redis process is running, so it's not critical in the system. It's only used to give the system overall a slightly more realtime nature. > > In this case, the webserver always runs on the same machine where the hardware events are occurring. For that reason, I was looking for a more direct way of communicating > to the webserver without creating this dependency on redis. However, I'm not sure if I can get the proxy to work that way because of the way how threads and runloops of osx work. > > So I tried to implement what's going on here: > > https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Notifications/Articles/Threading.html > > In the 'setUpThreadingSupport" function, it hangs on the > [[NSRunLoop currentRunLoop] addPort:self.notificationPort > > forMode:(NSString __bridge *)kCFRunLoopCommonModes]; > > call and CPU goes to 100%. The "self" object is an NSObject. > > My assumption is that I am looking at the right way to enable threaded reception of distributed notifications and handle them in that code. > The main thread of the webserver is controlled by django and doesn't eventually call the "control loop", which could be another reason this doesn't work well. > > Is this something that ought to work anyway, or would you recommend, given the rest of the architecture, to do this another way? > > Rgds, > > Gerard > > > On Mon, Oct 6, 2014 at 2:18 PM, Robert Klep <rob...@gm...> wrote: > Hoi Gerard, > > I certainly don't want to berate your project, but just wondering: wouldn't it be much easier to use something like Redis (or a full-blown MQ broker) to distribute notifications? > > – robert > > Gerard Toonstra <gto...@gm...> wrote on Mon Oct 06 2014 at 18:08:47: > > Hello, > > > > I'm new to pyobjc. We're using it for a project to receive events from a command line tool in C which interfaces to drivers to generate events on hardware changes. > > > > There's another process coded in 100% python where we want to receive such notifications and use them. Unfortunately, we haven't had much luck so far. This 100% python process is a webserver, specifically django. In the startup code, we want to create a class (singleton) that creates a separate thread to deal with these distributed notifications. > > > > For a small test script as a proof of concept, the runConsoleEventLoop is called from the main thread and everything works. Apparently because each thread has or should have its own input sources and the main thread is responsible for those. Creating a new thread requires the programmer to add their own. Not doing that, the loop immediately returns as the "nextfire" variable will be "None". > > > > We've been struggling to add our own input source, specifically one that deals with distributed notifications, to this runloop. When we call the following code: > > > > self.notifications = NSMutableArray.alloc().init() > > self.notiticationLock = NSLock.alloc().init() > > self.notificationThread = NSThread.currentThread() > > > > self.notificationPort = NSMachPort.alloc().init() > > self.notificationPort.setDelegate_(self) > > runLoop = NSRunLoop.currentRunLoop() > > runLoop.addPort_forMode_( self.notificationPort, kCFRunLoopCommonModes ) > > > > It hangs on the last line "addPort_forMode_" and so we never get to the loop section. I think that's a bug, because the same code is used by an example from Apple, where they'd call run() or some other equivalent to start processing those events in the run loop. > > > > What are we doing wrong? does anyone know an example that demonstrates this? > > > > > ------------------------------------------------------------------------------ > Slashdot TV. Videos for Nerds. Stuff that Matters. > http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk_______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
From: Gerard T. <gto...@gm...> - 2014-10-06 18:12:52
|
Hi Robert, Not a problem at all, I'm always open to suggestions. We do actually have a redis server running, but that's to communicate regional or global events from a number of servers. Also, the project doesn't mandate that that redis process is running, so it's not critical in the system. It's only used to give the system overall a slightly more realtime nature. In this case, the webserver always runs on the same machine where the hardware events are occurring. For that reason, I was looking for a more direct way of communicating to the webserver without creating this dependency on redis. However, I'm not sure if I can get the proxy to work that way because of the way how threads and runloops of osx work. So I tried to implement what's going on here: https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Notifications/Articles/Threading.html In the 'setUpThreadingSupport" function, it hangs on the [[NSRunLoop currentRunLoop] addPort:self.notificationPort forMode:(NSString __bridge *)kCFRunLoopCommonModes]; call and CPU goes to 100%. The "self" object is an NSObject. My assumption is that I am looking at the right way to enable threaded reception of distributed notifications and handle them in that code. The main thread of the webserver is controlled by django and doesn't eventually call the "control loop", which could be another reason this doesn't work well. Is this something that ought to work anyway, or would you recommend, given the rest of the architecture, to do this another way? Rgds, Gerard On Mon, Oct 6, 2014 at 2:18 PM, Robert Klep <rob...@gm...> wrote: > Hoi Gerard, > > I certainly don't want to berate your project, but just wondering: > wouldn't it be much easier to use something like Redis (or a full-blown MQ > broker) to distribute notifications? > > – robert > > Gerard Toonstra <gto...@gm...> wrote on Mon Oct 06 2014 at > 18:08:47: > > Hello, > > > > I'm new to pyobjc. We're using it for a project to receive events from a > command line tool in C which interfaces to drivers to generate events on > hardware changes. > > > > There's another process coded in 100% python where we want to receive > such notifications and use them. Unfortunately, we haven't had much luck so > far. This 100% python process is a webserver, specifically django. In the > startup code, we want to create a class (singleton) that creates a separate > thread to deal with these distributed notifications. > > > > For a small test script as a proof of concept, the runConsoleEventLoop > is called from the main thread and everything works. Apparently because > each thread has or should have its own input sources and the main thread is > responsible for those. Creating a new thread requires the programmer to add > their own. Not doing that, the loop immediately returns as the "nextfire" > variable will be "None". > > > > We've been struggling to add our own input source, specifically one that > deals with distributed notifications, to this runloop. When we call the > following code: > > > > self.notifications = NSMutableArray.alloc().init() > > self.notiticationLock = NSLock.alloc().init() > > self.notificationThread = NSThread.currentThread() > > > > self.notificationPort = NSMachPort.alloc().init() > > self.notificationPort.setDelegate_(self) > > runLoop = NSRunLoop.currentRunLoop() > > runLoop.addPort_forMode_( self.notificationPort, > kCFRunLoopCommonModes ) > > > > It hangs on the last line "addPort_forMode_" and so we never get to the > loop section. I think that's a bug, because the same code is used by an > example from Apple, where they'd call run() or some other equivalent to > start processing those events in the run loop. > > > > What are we doing wrong? does anyone know an example that demonstrates > this? > > > > |
From: Robert K. <rob...@gm...> - 2014-10-06 17:38:46
|
Hoi Gerard, I certainly don't want to berate your project, but just wondering: wouldn't it be much easier to use something like Redis (or a full-blown MQ broker) to distribute notifications? – robert Gerard Toonstra <gto...@gm...> wrote on Mon Oct 06 2014 at 18:08:47: > Hello, > > I'm new to pyobjc. We're using it for a project to receive events from a command line tool in C which interfaces to drivers to generate events on hardware changes. > > There's another process coded in 100% python where we want to receive such notifications and use them. Unfortunately, we haven't had much luck so far. This 100% python process is a webserver, specifically django. In the startup code, we want to create a class (singleton) that creates a separate thread to deal with these distributed notifications. > > For a small test script as a proof of concept, the runConsoleEventLoop is called from the main thread and everything works. Apparently because each thread has or should have its own input sources and the main thread is responsible for those. Creating a new thread requires the programmer to add their own. Not doing that, the loop immediately returns as the "nextfire" variable will be "None". > > We've been struggling to add our own input source, specifically one that deals with distributed notifications, to this runloop. When we call the following code: > > self.notifications = NSMutableArray.alloc().init() > self.notiticationLock = NSLock.alloc().init() > self.notificationThread = NSThread.currentThread() > > self.notificationPort = NSMachPort.alloc().init() > self.notificationPort.setDelegate_(self) > runLoop = NSRunLoop.currentRunLoop() > runLoop.addPort_forMode_( self.notificationPort, kCFRunLoopCommonModes ) > > It hangs on the last line "addPort_forMode_" and so we never get to the loop section. I think that's a bug, because the same code is used by an example from Apple, where they'd call run() or some other equivalent to start processing those events in the run loop. > > What are we doing wrong? does anyone know an example that demonstrates this? > |
From: Gerard T. <gto...@gm...> - 2014-10-06 16:03:51
|
Hello, I'm new to pyobjc. We're using it for a project to receive events from a command line tool in C which interfaces to drivers to generate events on hardware changes. There's another process coded in 100% python where we want to receive such notifications and use them. Unfortunately, we haven't had much luck so far. This 100% python process is a webserver, specifically django. In the startup code, we want to create a class (singleton) that creates a separate thread to deal with these distributed notifications. For a small test script as a proof of concept, the runConsoleEventLoop is called from the main thread and everything works. Apparently because each thread has or should have its own input sources and the main thread is responsible for those. Creating a new thread requires the programmer to add their own. Not doing that, the loop immediately returns as the "nextfire" variable will be "None". We've been struggling to add our own input source, specifically one that deals with distributed notifications, to this runloop. When we call the following code: self.notifications = NSMutableArray.alloc().init() self.notiticationLock = NSLock.alloc().init() self.notificationThread = NSThread.currentThread() self.notificationPort = NSMachPort.alloc().init() self.notificationPort.setDelegate_(self) runLoop = NSRunLoop.currentRunLoop() runLoop.addPort_forMode_( self.notificationPort, kCFRunLoopCommonModes ) It hangs on the last line "addPort_forMode_" and so we never get to the loop section. I think that's a bug, because the same code is used by an example from Apple, where they'd call run() or some other equivalent to start processing those events in the run loop. What are we doing wrong? does anyone know an example that demonstrates this? |