pyobjc-dev Mailing List for PyObjC (Page 2)
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: Eric F. <er...@ze...> - 2020-07-25 11:24:46
|
Hi, I am trying to use the following class method: NSCredential credentialWithIdentity:certificates:persistence: https://developer.apple.com/documentation/foundation/nsurlcredential/1428192-credentialwithidentity (Python3.6 in a virtualenv on macos 10.15 with PyObjc v6.2.2) Metadata: {'arguments': ({'_template': True, 'type': b'@'}, {'_template': True, 'type': b':'}, {'null_accepted': True, 'type': b'^{__SecIdentity=}'}, {'_template': True, 'type': b'@'}, {'_template': True, 'type': b'Q'}), 'classmethod': True, 'hidden': False, 'retval': {'_template': True, 'type': b'@'}} I get a SecIdentity object from a previous SecItemCopyMatching call. When I pass it to this method, i get the following error: depythonifying 'pointer', got 'SecIdentityRef' How could I fix this issue? Do I need to pass the SecIdentity as a different kind of argument? Is it possible to change the metadata with registerMetaDataForSelector ? Thanks, -- Éric |
From: Ronald O. <ron...@ma...> - 2020-07-08 20:21:11
|
Hi, I’ve uploaded PyObjC 6.2.2 to PyPI. The changelog for this release: #311 <https://github.com/ronaldoussoren/pyobjc/issues/311>: Build for the Metal bindings failed on macOS 10.14 #309 <https://github.com/ronaldoussoren/pyobjc/issues/309>: Fix incompatibility with macOS 11 in framework loader Another attempt at giving a nice error message when trying to install on platforms other than macOS. The classifiers now correctly identify supported Python versions As an aside: I’m working on full support for macOS 11, as well as Apple Silicon. The development branch for the core bridge already passes its tests on Apple Silicon hardware, and updating the framework bindings for macOS is going slightly faster than expected. With some luck there will be a prerelease of PyObjC 7 after EuroPython. Ronald — Twitter / micro.blog: @ronaldoussoren Blog: https://blog.ronaldoussoren.net/ |
From: Ronald O. <ron...@ma...> - 2020-06-14 09:46:52
|
Hi, I’ve pushed PyObjC 6.2.1 to PyPI. This is a minor bug fix release: Issue #299: Ensure package ‘pyobjc’ won’t try to build the PubSub bindings on macOS 10.15 Reported by Thomas Buchberger Minor tweaks to build and pass tests on macOS 10.14 with the latest Xcode that can be installed on that version of macOS. Issue #300: Fix SystemError in block edge case PyObjC raised a SystemError when converting a callable into an ObjC block when the callable is a bound method without positional arguments. Issue #275: Fix crash on catalina caused by writing to read-only memory. Patch by Dan Villiom Podlaski Christiansen PR #302: Make sure the SDK detection works when the version is not in the SDK name Patch by Joshua Root There were no SDK updates in Xcode 11.5 and Xcode 11.6 (beta) This is probably the last release in the 6.x train. My plan is to start working on PyObjC 7.0, with support for the next major release of macOS, during WWDC. Ronald — Twitter / micro.blog: @ronaldoussoren Blog: https://blog.ronaldoussoren.net/ |
From: Ronald O. <ron...@ma...> - 2020-05-24 13:36:14
|
Hi, Sorry about the bad news, but… The version of PyObjC shipped with macOS is ancient and unsupported, and its framework bindings aren’t based on upstream code. Not only that, but macOS has never shipped with good data in BridgeSupport files and that has gotten worse in the last couple of releases (which is why upstream PyObjC has never used these files). The only good solution is to switch to a current version of PyObjC (and Python). That should work and has tests for the bindings. That said, it might be possible to use the manual binding system implement the minimal set of metadata needed for your script. I can’t recall which parts of that system were implemented in the version of PyObjC that Apple ships. Ronald — Twitter / micro.blog: @ronaldoussoren Blog: https://blog.ronaldoussoren.net/ > On 24 May 2020, at 12:09, sp...@rn... wrote: > > hello, > > I use pyobjc bindings to build an application that is distributed [0]. > Unfortunately, I have to rely on the Apple provided versions of python/pyobjc (2.7.16/2.5.1 on catalina). > On Catalina, importing the AVFoundation framework leads to a runtime warning (Error parsing BridgeSupport data for AVFoundation), see below: > > %python > Python 2.7.16 (default, Feb 29 2020, 01:55:37) > [GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.29.20) (-macos10.15-objc- on darwin > Type "help", "copyright", "credits" or "license" for more information. >>>> import objc >>>> objc.__version__ > '2.5.1' >>>> import AVFoundation > /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/objc/_bridgesupport.py:674: RuntimeWarning: Error parsing BridgeSupport data for AVFoundation: PyObjCRT_SkipTypeSpec: Unhandled type '5d' ]} > warnings.warn("Error parsing BridgeSupport data for %s: %s" % (frameworkName, e), RuntimeWarning) > > As a consequence, many things are not loaded properly. > For example constants are missing (I can fix that by declaring the constants in my code). > But I have a problem that I could not manage to fix myself: > Methods that take a callback as parameter, like AVCaptureDevice.requestAccessForMediaType_completionHandler_, fail with a type error (Argument 3 is a block, but no signature available): > >>>> AVMediaTypeVideo = "vide" >>>> from Foundation import NSObject >>>> class Test(NSObject): > ... def test_(self, granted): > ... print(granted) > ... >>>> test = Test.alloc().init() >>>> AVFoundation.AVCaptureDevice.requestAccessForMediaType_completionHandler_( > ... AVMediaTypeVideo, > ... test.test_) > Traceback (most recent call last): > File "<stdin>", line 3, in <module> > TypeError: Argument 3 is a block, but no signature available > >>>> test.test_.signature > 'v@:@' >>>> AVFoundation.AVCaptureDevice.requestAccessForMediaType_completionHandler_.signature > 'v32@0:8@16@?24' > > Any idea on how to fix this problem without altering the default python/pyobjc installation? > Thanks a lot for any suggestion, > > Renaud > > 0. Présentation.app > http://iihm.imag.fr/blanch/software/osx-presentation/ > > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
From: <sp...@rn...> - 2020-05-24 10:39:20
|
hello, I use pyobjc bindings to build an application that is distributed [0]. Unfortunately, I have to rely on the Apple provided versions of python/pyobjc (2.7.16/2.5.1 on catalina). On Catalina, importing the AVFoundation framework leads to a runtime warning (Error parsing BridgeSupport data for AVFoundation), see below: %python Python 2.7.16 (default, Feb 29 2020, 01:55:37) [GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.29.20) (-macos10.15-objc- on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import objc >>> objc.__version__ '2.5.1' >>> import AVFoundation /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/objc/_bridgesupport.py:674: RuntimeWarning: Error parsing BridgeSupport data for AVFoundation: PyObjCRT_SkipTypeSpec: Unhandled type '5d' ]} warnings.warn("Error parsing BridgeSupport data for %s: %s" % (frameworkName, e), RuntimeWarning) As a consequence, many things are not loaded properly. For example constants are missing (I can fix that by declaring the constants in my code). But I have a problem that I could not manage to fix myself: Methods that take a callback as parameter, like AVCaptureDevice.requestAccessForMediaType_completionHandler_, fail with a type error (Argument 3 is a block, but no signature available): >>> AVMediaTypeVideo = "vide" >>> from Foundation import NSObject >>> class Test(NSObject): ... def test_(self, granted): ... print(granted) ... >>> test = Test.alloc().init() >>> AVFoundation.AVCaptureDevice.requestAccessForMediaType_completionHandler_( ... AVMediaTypeVideo, ... test.test_) Traceback (most recent call last): File "<stdin>", line 3, in <module> TypeError: Argument 3 is a block, but no signature available >>> test.test_.signature 'v@:@' >>> AVFoundation.AVCaptureDevice.requestAccessForMediaType_completionHandler_.signature 'v32@0:8@16@?24' Any idea on how to fix this problem without altering the default python/pyobjc installation? Thanks a lot for any suggestion, Renaud 0. Présentation.app http://iihm.imag.fr/blanch/software/osx-presentation/ |
From: Ronald O. <ron...@ma...> - 2020-03-01 21:36:21
|
Hi, I’ve moved the PyObjC repository from BitBucket to GitHub. The new home is: https://github.com/ronaldoussoren/pyobjc/ <https://github.com/ronaldoussoren/pyobjc/> I expect to release a new version of PyObjC soon after the release of macOS 10.15.4. Ronald — Twitter: @ronaldoussoren Blog: https://blog.ronaldoussoren.net/ |
From: Ronald O. <ron...@ma...> - 2019-10-20 18:38:12
|
Hi, I’ve uploaded PyObjC 6.0.1 to PyPI. This fixes the annoying lines of debug output in the 6.0 release. Ronald — Twitter: @ronaldoussoren Blog: https://blog.ronaldoussoren.net/ |
From: Ronald O. <ron...@ma...> - 2019-10-17 16:54:45
|
I've uploaded PyObjC 6.0 to PyPI. This is a major feature release, the two most important changes are the addition of support for frameworks and APIs introduced in macOS 10.15 (Catalina), and the removal of support for Python 2.7. PyPI has wheels for 64-bit builds of Python 3.6, 3.7 and 3.8. The source should still work with 32-bit builds of Python, but those are no longer tested. At the time of writing the source code is still in the branch "pyobjc-6-branch". The full list of changes: * Removed Python 2 support from the C extension in pyobjc-core * Reformatted code in pyobjc-core: - Use "black" for Python code - Use "clang-format" for Objective-C code As a side-effect of this all usage of "NS_DURING" and "PyObjC_DURING" has been replaced by the expansion of those macros, mostly because "clang-format" doesn't understand these kinds of blocks. Replacing PyObjC_DURING by its expansion also reduces the knowledge needed to understand what's going on w.r.t. the Python GIL. The macro PyObjC_DURING, and its siblings, have been removed as well. * Updated bindings for macOS 10.15 (Xcode 11.0) * The userspace driver frameworks introduced in macOS 10.15 (DriverKit and related frameworks) will not be exposed through PyObjC. Please let me know if you have a good use case for using these frameworks with Python. * Add new framework wrappers for all other new frameworks in macOS 10.15: - AuthenticationServices - CoreHaptics - CoreMotion - DeviceCheck - ExecutionPolicy - FileProvider - FileProviderUI - LinkPresentation - OSLog - PencilKit - PushKit - QuickLookThumbnailing - Speech - SoundAnalysis - SystemExtensions * Add new framework wrappers for a number of older frameworks: - MetalKit (new in macOS 10.11) * Issue #271: Fix crash when creating NSData objects on macOS 10.15 P.S. This release is later than I'd like for various reasons, but mostly because I've spent less time at my computer the last couple of weeks. — Twitter: @ronaldoussoren Blog: https://blog.ronaldoussoren.net/ |
From: Ronald O. <ron...@ma...> - 2019-10-17 06:51:40
|
Hi, I’ve uploaded PyObjC 5.3 to PyPI. This is a minor bug fix release and also ships with wheels for Python 3.8. Changes: * PR 21: Switch xcodebuild invocation to xcrun for sdk path Patch by Clément Bouvier * #271: Fix crash when creating NSData objects on macOS 10.15 * Fix compile error on macOS 10.15 Ronald — Twitter: @ronaldoussoren Blog: https://blog.ronaldoussoren.net/ |
From: Diez B. R. <de...@we...> - 2019-10-07 14:36:45
|
There is the Pythonista App. It appears to have a simple solution - no idea if the developer is interested in sharing it: http://omz-software.com/pythonista/docs/ios/objc_util.html#module-objc_util <http://omz-software.com/pythonista/docs/ios/objc_util.html#module-objc_util> Cheers, Diez > On 4. Oct 2019, at 16:04, Ronald Oussoren via Pyobjc-dev <pyo...@li...> wrote: > > PyObjC only works on macOS at this time. I know there are ports (of older versions) to iOS, but those are not part of the main project. > > A major reason for not supporting iOS is that I’m pretty sure that PyObjC does things (such as dynamically generating native code) that won’t be accepted by App Store review. > > Ronald > — > > Twitter: @ronaldoussoren > Blog: https://blog.ronaldoussoren.net/ <https://blog.ronaldoussoren.net/> > >> On 2 Oct 2019, at 00:42, Rami Jiossy <sr...@gm... <mailto:sr...@gm...>> wrote: >> >> I've got python on iOS. I wonder what it takes to get pyobjc installing there? >> I imagine i would need to cross compile pyobjc on macos using an iOS sdk instead of macOS sdk (which is currently the default) and then install it as a module on device. >> >> Any pointers or ideas where to start? >> >> Sent from my iPhone >> >> _______________________________________________ >> Pyobjc-dev mailing list >> Pyo...@li... <mailto:Pyo...@li...> >> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
From: Ronald O. <ron...@ma...> - 2019-10-07 05:48:39
|
<html><head></head><body dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">PyObjC only works on macOS at this time. I know there are ports (of older versions) to iOS, but those are not part of the main project.<div class=""><br class=""></div><div class="">A major reason for not supporting iOS is that I’m pretty sure that PyObjC does things (such as dynamically generating native code) that won’t be accepted by App Store review.<br class=""><div class=""><br class=""></div><div class="">Ronald<br class=""><div class=""> <div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;">—</div><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class=""></div><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;">Twitter: @ronaldoussoren</div><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;">Blog: <a href="https://blog.ronaldoussoren.net/" class="">https://blog.ronaldoussoren.net/</a></div> </div> <div><br class=""><blockquote type="cite" class=""><div class="">On 2 Oct 2019, at 00:42, Rami Jiossy <<a href="mailto:sr...@gm..." class="">sr...@gm...</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">I've got python on iOS. I wonder what it takes to get pyobjc installing there? <br class="">I imagine i would need to cross compile pyobjc on macos using an iOS sdk instead of macOS sdk (which is currently the default) and then install it as a module on device.<br class=""><br class="">Any pointers or ideas where to start?<br class=""><br class="">Sent from my iPhone<br class=""><br class="">_______________________________________________<br class="">Pyobjc-dev mailing list<br class=""><a href="mailto:Pyo...@li..." class="">Pyo...@li...</a><br class="">https://lists.sourceforge.net/lists/listinfo/pyobjc-dev<br class=""></div></div></blockquote></div><br class=""></div></div></div></body></html> |
From: Rami J. <sr...@gm...> - 2019-10-01 22:42:56
|
I've got python on iOS. I wonder what it takes to get pyobjc installing there? I imagine i would need to cross compile pyobjc on macos using an iOS sdk instead of macOS sdk (which is currently the default) and then install it as a module on device. Any pointers or ideas where to start? Sent from my iPhone |
From: Ronald O. <ron...@ma...> - 2019-07-19 08:22:25
|
Hi, Thanks for all responses, both here and on Twitter. I haven’t had a chance to seriously look at everything as I’m on my post-EuroPython holiday, but will do so when I get back home. Ronald -- On the road, hence brief. Op 14 jul. 2019 om 16:52 heeft Ronald Oussoren <ron...@ma...> het volgende geschreven: > Hi, > > I’m looking for users and usages of PyObjC and py2app for a number of reasons. > > - I’m personally interested in what people are doing with my projects, this not just strokes my ego but also tends to show fun usecases > - I’d like to add information to the documentation on how and why PyObjC is used > - I’d like to add links to (OSS) projects to the documentation, amongst others as more realistic examples than the example code in the repository > - Links to source code can help me improve PyObjC > > For py2app I have similar reasons for being interested, but there’s another one: py2app is getting long in the tooth and requires tweaking for a lot of programs using it. Finding examples of such tweaks helps me improve py2app, and can also help in creating an integration testsuite for py2app. > > Feel free to contact me directly. > > Ronald > — > > Twitter: @ronaldoussoren > Blog: https://blog.ronaldoussoren.net/ > |
From: Ronald O. <ron...@ma...> - 2019-07-14 14:53:16
|
Hi, I’m looking for users and usages of PyObjC and py2app for a number of reasons. - I’m personally interested in what people are doing with my projects, this not just strokes my ego but also tends to show fun usecases - I’d like to add information to the documentation on how and why PyObjC is used - I’d like to add links to (OSS) projects to the documentation, amongst others as more realistic examples than the example code in the repository - Links to source code can help me improve PyObjC For py2app I have similar reasons for being interested, but there’s another one: py2app is getting long in the tooth and requires tweaking for a lot of programs using it. Finding examples of such tweaks helps me improve py2app, and can also help in creating an integration testsuite for py2app. Feel free to contact me directly. Ronald — Twitter: @ronaldoussoren Blog: https://blog.ronaldoussoren.net/ |
From: Ronald O. <ron...@ma...> - 2019-02-02 23:52:37
|
Hi, I’m happy to announce a new library: modulegraph2 version 2.0a1. Modulegraph2 is a complete rewrite of the modulegraph library that powers py2app and will end up in py2app in the future. The new library is python 3 only and has proper test coverage. This should make it a lot easier to evolve the library in the future. A longer write-up is at my blog: https://blog.ronaldoussoren.net/2019/02/03/modulegraph-a-python.html <https://blog.ronaldoussoren.net/2019/02/03/modulegraph-a-python.html> Ronald — Twitter: @ronaldoussoren Blog: https://blog.ronaldoussoren.net/ |
From: Ronald O. <ron...@ma...> - 2019-01-02 13:59:32
|
— Twitter: @ronaldoussoren Blog: https://blog.ronaldoussoren.net/ > On 2 Jan 2019, at 12:39, Frederik Berlaen <fre...@ty...> wrote: > > Hi! > > I noticed different behaviour of macOS calling my nsView subclass drawRect_ method, when I run a script directly in terminal or from within my app: DrawBot (http://www.drawbot.com <http://www.drawbot.com/>) > > The python version and installed packages are the same, the most current ones from pip. > > The window is build with vanilla (a pythonic cocoa wrapper) https://github.com/typesupply/vanilla <https://github.com/typesupply/vanilla> > > <viewIssue.py> > > When this script is executed inside DrawBot: I get, based on my screen (retina or an old cinema HD), lots of drawRect_ callback with fixed width and height. > > When executed in no-app world, terminal: I get a single callback on my drawRect_ with the size of the visible rect. > > I fully understand the difference in performance and why this is happening. > > > BUT: > > Im unable to toggle between those two settings. I don't know what or where I have to change a setting to get a specific behaviour: > * tilled drawRect_ callbacks > * a visible rect drawRect callback > > > > please point me in the right direction > > (If this question is posted in the wrong place, I happily repost it elsewhere) This could be related to the SDK the main binary is linked to (the application stub from py2app vs. the python executable). P.S. This is just a quick reply, I haven’t tried to verify my hunch. Ronald |
From: Frederik B. <fre...@ty...> - 2019-01-02 11:39:58
|
Hi! I noticed different behaviour of macOS calling my nsView subclass drawRect_ method, when I run a script directly in terminal or from within my app: DrawBot (http://www.drawbot.com <http://www.drawbot.com/>) The python version and installed packages are the same, the most current ones from pip. The window is build with vanilla (a pythonic cocoa wrapper) https://github.com/typesupply/vanilla <https://github.com/typesupply/vanilla> When this script is executed inside DrawBot: I get, based on my screen (retina or an old cinema HD), lots of drawRect_ callback with fixed width and height. When executed in no-app world, terminal: I get a single callback on my drawRect_ with the size of the visible rect. I fully understand the difference in performance and why this is happening. BUT: Im unable to toggle between those two settings. I don't know what or where I have to change a setting to get a specific behaviour: * tilled drawRect_ callbacks * a visible rect drawRect callback please point me in the right direction (If this question is posted in the wrong place, I happily repost it elsewhere) thanks gr Frederik Berlaen typemytype.com |
From: Ronald O. <ron...@ma...> - 2019-01-01 01:00:56
|
Op 31 dec. 2018 om 19:48 heeft Glyph <gl...@tw...> het volgende geschreven: > > >> On Dec 30, 2018, at 2:51 AM, Ronald Oussoren <ron...@ma...> wrote: >> >> >> >>> On 30 Dec 2018, at 07:19, Glyph <gl...@tw...> wrote: >>> >>> I've long been curious about if and how one could use XPC services with Python, and I recently ran across this question: >>> >>> https://stackoverflow.com/questions/52284089/is-it-possible-to-use-pyobjc-with-a-privilved-xpc-helper-tool-and-xpcinterface-a >>> >>> If anyone on this list happens to have the relevant understanding, I put a 100-point bounty on it. >>> >>> Happy holidays, >> >> >> I hadn’t seen this question yet, mostly because I rarely visit stackoverflow. A quick summary of my answer: >> >> 1) It is possible to call APIs with blocks, even if those APIs aren’t in Apple’s frameworks >> >> 2) It is possible to define ObjC protocols in Python >> >> 3) Those protocols don’t work with NSXPCInterface yet (issue #256), but there is an (untested) workaround >> >> I wonder how hard it will be to fix #256, with some luck NSXPCInterface access information that isn’t exposed through a public API. In particular, the NSXPCInterface error mentions “extended method signature” and I haven’t found any reference to those yet in Apple documentation. > > Thanks for having a look at this! Good luck on figuring out what an "extended method signature" is, I hope that's tractable. > > I don't know if it will be helpful for this purpose, but Ian Beer has a talk about macOS IPC mechanisms - from the perspective of exploiting them, rather than programming against them :) but perhaps some of the internal details he talks about will be useful to you: > > https://vimeo.com/127859750 > > (Frankly a lot of this stuff goes over my head; I don't know a whole lot about Mach and the more I learn about ports the scarier they seem.) Thanks for the link. I hope I don’t need any of the real low-level stuff, but just enough to make the XPC support classes happy. I’m currently focusing on what will result in a rewrite, and more importantly, major cleanup of py2app and supporting libraries. Low-level objc stuff will have to wait a bit, writing nice clean python 3 code is much more fun :-) And: my best wishes for the 2019. Ronald > > -g > |
From: Glyph <gl...@tw...> - 2018-12-31 18:49:11
|
> On Dec 30, 2018, at 2:51 AM, Ronald Oussoren <ron...@ma...> wrote: > > > >> On 30 Dec 2018, at 07:19, Glyph <gl...@tw... <mailto:gl...@tw...>> wrote: >> >> I've long been curious about if and how one could use XPC services with Python, and I recently ran across this question: >> >> https://stackoverflow.com/questions/52284089/is-it-possible-to-use-pyobjc-with-a-privilved-xpc-helper-tool-and-xpcinterface-a <https://stackoverflow.com/questions/52284089/is-it-possible-to-use-pyobjc-with-a-privilved-xpc-helper-tool-and-xpcinterface-a> >> >> If anyone on this list happens to have the relevant understanding, I put a 100-point bounty on it. >> >> Happy holidays, > > > I hadn’t seen this question yet, mostly because I rarely visit stackoverflow. A quick summary of my answer: > > 1) It is possible to call APIs with blocks, even if those APIs aren’t in Apple’s frameworks > > 2) It is possible to define ObjC protocols in Python > > 3) Those protocols don’t work with NSXPCInterface yet (issue #256), but there is an (untested) workaround > > I wonder how hard it will be to fix #256, with some luck NSXPCInterface access information that isn’t exposed through a public API. In particular, the NSXPCInterface error mentions “extended method signature” and I haven’t found any reference to those yet in Apple documentation. Thanks for having a look at this! Good luck on figuring out what an "extended method signature" is, I hope that's tractable. I don't know if it will be helpful for this purpose, but Ian Beer has a talk about macOS IPC mechanisms - from the perspective of exploiting them, rather than programming against them :) but perhaps some of the internal details he talks about will be useful to you: https://vimeo.com/127859750 <https://vimeo.com/127859750> (Frankly a lot of this stuff goes over my head; I don't know a whole lot about Mach and the more I learn about ports the scarier they seem.) -g |
From: Ronald O. <ron...@ma...> - 2018-12-30 10:51:20
|
> On 30 Dec 2018, at 07:19, Glyph <gl...@tw...> wrote: > > I've long been curious about if and how one could use XPC services with Python, and I recently ran across this question: > > https://stackoverflow.com/questions/52284089/is-it-possible-to-use-pyobjc-with-a-privilved-xpc-helper-tool-and-xpcinterface-a <https://stackoverflow.com/questions/52284089/is-it-possible-to-use-pyobjc-with-a-privilved-xpc-helper-tool-and-xpcinterface-a> > > If anyone on this list happens to have the relevant understanding, I put a 100-point bounty on it. > > Happy holidays, I hadn’t seen this question yet, mostly because I rarely visit stackoverflow. A quick summary of my answer: 1) It is possible to call APIs with blocks, even if those APIs aren’t in Apple’s frameworks 2) It is possible to define ObjC protocols in Python 3) Those protocols don’t work with NSXPCInterface yet (issue #256), but there is an (untested) workaround I wonder how hard it will be to fix #256, with some luck NSXPCInterface access information that isn’t exposed through a public API. In particular, the NSXPCInterface error mentions “extended method signature” and I haven’t found any reference to those yet in Apple documentation. Ronald — Twitter: @ronaldoussoren Blog: https://blog.ronaldoussoren.net/ <https://blog.ronaldoussoren.net/> |
From: Glyph <gl...@tw...> - 2018-12-30 06:44:45
|
I've long been curious about if and how one could use XPC services with Python, and I recently ran across this question: https://stackoverflow.com/questions/52284089/is-it-possible-to-use-pyobjc-with-a-privilved-xpc-helper-tool-and-xpcinterface-a <https://stackoverflow.com/questions/52284089/is-it-possible-to-use-pyobjc-with-a-privilved-xpc-helper-tool-and-xpcinterface-a> If anyone on this list happens to have the relevant understanding, I put a 100-point bounty on it. Happy holidays, -glyph |
From: Ronald O. <ron...@ma...> - 2018-12-14 06:34:46
|
Hi, I’ve pushed PyObjC 5.1.2 to PyPI. This release contains a number of bugfixes: * #254: Fix compile error on macOS 10.9 or earlier * #255: Calling completion handler failed due to incomplete runtime info PyObjC's metadata system didn't automaticly set the call signature for blocks passed into a method implemented in Python. This causes problems when the ObjC or Swift block does not have signature information in the ObjC/blocks runtime. * Use MAP_JIT when allocating memory for the executable stubs for Python methods. With the "restricted" runtime you'll have to add the "com.apple.security.cs.allow-jit" entitlement to use this flag, in earlier versions you'd have to use a different entitlement: "com.apple.security.cs.allow-unsigned-executable-memory". The MAP_JIT flag is only used on macOS 10.14 or later. * Ensure that PyObjC can be built using /usr/bin/python on macOS 10.14 This failed due the problems with header files in the SDK included with Xcode 10. Regards, Ronald — Twitter: @ronaldoussoren Blog: https://blog.ronaldoussoren.net/ |
From: Ronald O. <ron...@ma...> - 2018-12-05 12:17:32
|
The closest thing to documentation about this is: https://pyobjc.readthedocs.io/en/latest/tutorials/embedded.html <https://pyobjc.readthedocs.io/en/latest/tutorials/embedded.html>, but that document is very old and is probably out of date. The reason for the lack of documentation is that almost all users for PyObjC use it to write Python code that use the Apple ObjC frameworks. In the end the basic idea is: * Create a Python subclass of NSObject with methods that you want to call from from ObjC (make sure you use the right naming convention for those methods) * In ObjC create an @interface definition with the methods you want to call in ObjC * Create the Python object in Python and pass it to the ObjC code in some way * Call methods as normal in ObjC Ronald P.S. Sorry about the late response, I’ve been traveling and couldn’t approve your message to the list earlier. > On 19 Nov 2018, at 17:29, Dmitry Wolf <dii...@gm...> wrote: > > I'm trying to figure out how to call python from cocoa/objective-c code, but haven't found any example code that actually works. There seem to be all sorts of examples of pure python calling into frameworks and objective-c code, but nothing showing how to set up calls from a standard objective-c app into python. > > Actually I just copy pasted this question from 2006 thread https://sourceforge.net/p/pyobjc/mailman/message/11676132/ <https://sourceforge.net/p/pyobjc/mailman/message/11676132/> > Because I have exactly this question :D > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
From: Diez B. R. <de...@we...> - 2018-12-05 10:53:27
|
I suggest passing an object inherited from NSObject into objective C code. That’s all that there is to this. Every subclass you create that is e.g. a NSView or AppDelegate or whatever is an actual example of objective C invoking Python. Diez Von meinem iPad gesendet > Am 19.11.2018 um 17:29 schrieb Dmitry Wolf <dii...@gm...>: > > I'm trying to figure out how to call python from cocoa/objective-c code, but haven't found any example code that actually works. There seem to be all sorts of examples of pure python calling into frameworks and objective-c code, but nothing showing how to set up calls from a standard objective-c app into python. > > Actually I just copy pasted this question from 2006 thread https://sourceforge.net/p/pyobjc/mailman/message/11676132/ > Because I have exactly this question :D > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
From: Dmitry W. <dii...@gm...> - 2018-11-19 16:29:27
|
I'm trying to figure out how to call python from cocoa/objective-c code, but haven't found any example code that actually works. There seem to be all sorts of examples of pure python calling into frameworks and objective-c code, but nothing showing how to set up calls from a standard objective-c app into python. Actually I just copy pasted this question from 2006 thread https://sourceforge.net/p/pyobjc/mailman/message/11676132/ Because I have exactly this question :D |