pyobjc-dev Mailing List for PyObjC (Page 16)
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
(1) |
Nov
|
Dec
(2) |
|
From: Ronald O. <ron...@ma...> - 2013-01-07 19:28:53
|
Hi, I've tagged pyobjc 2.5 in my bitbucket repository, but haven't uploaded it to PyPI yet (and haven't updated the website either). I'll finish the release proces later this week or next weekend. The most important changes w.r.t. 2.4: * Reinstated support for .bridgesupport files (PyObjC no longer uses them itself, but these files can be handy to access other frameworks) * Much improved test coverage, which has resulted in numerous small bugfixes. Ronald |
|
From: Ronald O. <ron...@ma...> - 2012-12-26 13:32:34
|
Hi, Early november I finally got a new release of PyObjC out (version 2.4), and unless an unexpected problem crops up there will be another release (2.5) next Sunday. Version 2.5 will re-add some functionality that accidently got dropped in the 2.4 release (in particular the support for BridgeSupport files), and improves testing (which led to a number of bugfixes). I've also migrated the website to http://packages.python.org/pyobjc, the old URL (http://pyobjc.sf.net/) is now just a redirect to the new location. The website is once again generated from the PyObjC source tree, the old one hadn't been updated in a long while because the scripts generating that site didn't work anymore due to restructuring of the pyobjc repository and documentation files. I'd like to replace the current sphinx theme by something less generic, and that should happen sometime next year. The same is true for the examples: that code needs to be cleaned up and updated. I'll try to get on a more regular release pattern next year, with some luck leading up to a 3.0 release during the summer. That release would then feature a cleaned up core bridge, removing some cruft that was needed to support Python release before 2.6 and that cleanup should improve the performance of all of PyObjC. The major stumbling block w.r.t. getting to 3.0 is time: I know what I want to do and how to get there, but expect to need a couple of days to work on this; my regular development pattern of doing a couple of hours development during the evening or in the weekend will probably be too inefficient to make serious progres. Before 3.0 is out there should be at least a 2.6 release, and possibly other point releases, with improved framework coverage (not all system frameworks are available through PyObjC at the moment), other minor feature updates and bugfixes. One thing I'm not sure about is Xcode support, in particular support for designing GUI using the Interface Builder tool embedded in Xcode. I don't like Xcode as a Python editor (which is why the xcode templates are basicly dead at the moment), and haven't made my mind up on how to proceed here. Two major options are to either generate an Xcode project when needed (just to enough to let Xcode know where to find resource files and source code), and to just ignore Xcode completely but design the UI in Xcode. That last option should be a lot easier with autolayout (introduced in OSX 10.7), but might need a helper library to keep code readable (I've noticed with other toolkits that it is very easy to end up with long blocks of code that create UI elements and have no useful structure). Happy holidays, Ronald |
|
From: Ronald O. <ron...@ma...> - 2012-11-20 08:07:41
|
On 20 Nov, 2012, at 3:11, Ben Smith <bcs...@gm...> wrote: > Benjamin Smith <bcsmith05 <at> gmail.com> writes: > >> >> Hi all, >> >> I have a python script that I'm bundling with py2app and run using > AppHelper.runEventLoop. In my script, I >> set sys.excepthook to a custom function in order to do some cleanup when there > is an unhandled exception. >> However, because runEventLoop runs the entire runloop inside a try, except > block, sys.excepthook is >> never called and the application simply terminates. It looks like the only > way to mimic this behavior is to >> pass in my cleanup code within the 'unexpectedErrorAlert' parameter to > runEventLoop, but that seemed to >> not be the best approach. Is there another way to mimic sys.excepthook that > I'm missing? >> >> Thanks! >> Ben >> ------------------------------------------------------------------------------ >> Monitor your physical, virtual and cloud infrastructure from a single >> web console. Get in-depth insight into apps, servers, databases, vmware, >> SAP, cloud infrastructure, etc. Download 30-day Free Trial. >> Pricing starts from $795 for 25 servers or applications! >> http://p.sf.net/sfu/zoho_dev2dev_nov >> > > Hi again, > > It looks like my understanding earlier was not correct. The problem was > unrelated to runEventLoop's try/catch blocks, but rather seemed to be related to > the fact that my exception was being raised in code that was fired off from > applicationDidFinishLaunching. It seems that when python code raises an > exception within a method called from the run loop, the exception is handled by > the run loop (generating an objective C exception) and so never reaches the > python unhandled exception handler. The Objective-C exception should be converted to a Python one by the bridge, unless the runloop swallows the exception (and it does that at least for some exceptions). > > The first thing we tried was to use NSSetUncaughtExceptionHandler to catch the > objective-C exceptions, but it seems like that function is not implemented. So > now what we're going with is to write a decorator to wrap methods that could be > called from the run loop in try, except, and then on the except, route the > exception to our sys.excepthook function. Does that sound reasonable? That's the best solution. In general Apple's code doesn't like exceptions at all, throwing exceptions through an Objective-C callstack could result in resource leaks and other misbehavior. That's because Apple tends to use exceptions only to signal programmer errors, "normal" errors are usually signalled using return values and/or NSError values. You could also call "objc.setVerbose(1)". After that call PyObjC will print exceptions when converting them to/from Objective-C. Ronald > > Thanks a bunch! > Ben > > > ------------------------------------------------------------------------------ > Monitor your physical, virtual and cloud infrastructure from a single > web console. Get in-depth insight into apps, servers, databases, vmware, > SAP, cloud infrastructure, etc. Download 30-day Free Trial. > Pricing starts from $795 for 25 servers or applications! > http://p.sf.net/sfu/zoho_dev2dev_nov > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
|
From: Ben S. <bcs...@gm...> - 2012-11-20 02:15:02
|
Benjamin Smith <bcsmith05 <at> gmail.com> writes: > > Hi all, > > I have a python script that I'm bundling with py2app and run using AppHelper.runEventLoop. In my script, I > set sys.excepthook to a custom function in order to do some cleanup when there is an unhandled exception. > However, because runEventLoop runs the entire runloop inside a try, except block, sys.excepthook is > never called and the application simply terminates. It looks like the only way to mimic this behavior is to > pass in my cleanup code within the 'unexpectedErrorAlert' parameter to runEventLoop, but that seemed to > not be the best approach. Is there another way to mimic sys.excepthook that I'm missing? > > Thanks! > Ben > ------------------------------------------------------------------------------ > Monitor your physical, virtual and cloud infrastructure from a single > web console. Get in-depth insight into apps, servers, databases, vmware, > SAP, cloud infrastructure, etc. Download 30-day Free Trial. > Pricing starts from $795 for 25 servers or applications! > http://p.sf.net/sfu/zoho_dev2dev_nov > Hi again, It looks like my understanding earlier was not correct. The problem was unrelated to runEventLoop's try/catch blocks, but rather seemed to be related to the fact that my exception was being raised in code that was fired off from applicationDidFinishLaunching. It seems that when python code raises an exception within a method called from the run loop, the exception is handled by the run loop (generating an objective C exception) and so never reaches the python unhandled exception handler. The first thing we tried was to use NSSetUncaughtExceptionHandler to catch the objective-C exceptions, but it seems like that function is not implemented. So now what we're going with is to write a decorator to wrap methods that could be called from the run loop in try, except, and then on the except, route the exception to our sys.excepthook function. Does that sound reasonable? Thanks a bunch! Ben |
|
From: Benjamin S. <bcs...@gm...> - 2012-11-19 22:40:11
|
Hi all, I have a python script that I'm bundling with py2app and run using AppHelper.runEventLoop. In my script, I set sys.excepthook to a custom function in order to do some cleanup when there is an unhandled exception. However, because runEventLoop runs the entire runloop inside a try, except block, sys.excepthook is never called and the application simply terminates. It looks like the only way to mimic this behavior is to pass in my cleanup code within the 'unexpectedErrorAlert' parameter to runEventLoop, but that seemed to not be the best approach. Is there another way to mimic sys.excepthook that I'm missing? Thanks! Ben |
|
From: Ronald O. <ron...@ma...> - 2012-11-19 10:00:31
|
On 19 Nov, 2012, at 10:36, Kunal Parmar <kun...@gm...> wrote: > > That links requires a password. > > I forgot to open access to all. Try again. I can now download the archive. Thanks, Ronald > ------------------------------------------------------------------------------ > Monitor your physical, virtual and cloud infrastructure from a single > web console. Get in-depth insight into apps, servers, databases, vmware, > SAP, cloud infrastructure, etc. Download 30-day Free Trial. > Pricing starts from $795 for 25 servers or applications! > http://p.sf.net/sfu/zoho_dev2dev_nov_______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
|
From: Kunal P. <kun...@gm...> - 2012-11-19 09:37:05
|
> That links requires a password. > I forgot to open access to all. Try again. |
|
From: Ronald O. <ron...@ma...> - 2012-11-19 09:32:34
|
On 17 Nov, 2012, at 2:41, Kunal Parmar <kun...@gm...> wrote: > The problem was argv_emulation. > > I had argv_emulation set to True. When I double click the app in Finder, my app shows up in the Dock and the Status Bar. But neither the window nor the alert shows up. When I click on the Dock icon, then both of them show up. Here's a link to the entire project and a build that does not work: https://cloud.box.com/s/tuzakq025ab7t49geoh9 That links requires a password. > > Thanks to Ronald, I looked through an example and found that argv_emulation was not set at all. I set it to False and my app behaved as expected. > > Is this a known issue? No, argv_emulation should work fine. However: it is also not very useful for applications that use PyObjC. Argv_emulation is a hack for using cross-platform scripts: it starts a temporary eventloop to intercept file-open events, adds those files to sys.argv and finally starts the actual script. With PyObjC you can use the regular Cocoa mechanism for this (such as the application:openFiles: selector on the application delegate). Ronald > ------------------------------------------------------------------------------ > Monitor your physical, virtual and cloud infrastructure from a single > web console. Get in-depth insight into apps, servers, databases, vmware, > SAP, cloud infrastructure, etc. Download 30-day Free Trial. > Pricing starts from $795 for 25 servers or applications! > http://p.sf.net/sfu/zoho_dev2dev_nov_______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
|
From: Kunal P. <kun...@gm...> - 2012-11-17 01:42:03
|
The problem was argv_emulation. I had argv_emulation set to True. When I double click the app in Finder, my app shows up in the Dock and the Status Bar. But neither the window nor the alert shows up. When I click on the Dock icon, then both of them show up. Here's a link to the entire project and a build that does not work: https://cloud.box.com/s/tuzakq025ab7t49geoh9 Thanks to Ronald, I looked through an example and found that argv_emulation was not set at all. I set it to False and my app behaved as expected. Is this a known issue? |
|
From: Ronald O. <ron...@ma...> - 2012-11-16 10:30:29
|
On 16 Nov, 2012, at 10:48, Kunal Parmar <kun...@gm...> wrote: > I've been having this problem where an app built with py2app does not run correctly when I double click it from Finder. It works if I run the executable directly (.app/Contents/MacOS/app) from Finder or via terminal. > > I tried troubleshooting but only got so far as to know that applicationDidFinishLaunch: is not getting called on my app delegate. I dont know why though. You migth depend on details of the shell environment. What do you mean by "does not run correctly"? Does the application launch but with limited functionality, or do you get an error when launching? Do the basic examples that are included with pyobjc work? Ronald > > I found a couple other threads talking about the same problem - > http://stackoverflow.com/questions/11663545/launching-application-made-with-py2app > https://groups.google.com/forum/#!topic/pygame-mirror-on-google-groups/eBEW8m0jtl0 > > I'm using py2app v0.7.1, pyobjc-core v2.4 on OS X 10.8.2. > > Hope someone here can help! > > Thanks, > Kunal > ------------------------------------------------------------------------------ > Monitor your physical, virtual and cloud infrastructure from a single > web console. Get in-depth insight into apps, servers, databases, vmware, > SAP, cloud infrastructure, etc. Download 30-day Free Trial. > Pricing starts from $795 for 25 servers or applications! > http://p.sf.net/sfu/zoho_dev2dev_nov_______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
|
From: Kunal P. <kun...@gm...> - 2012-11-16 09:48:26
|
I've been having this problem where an app built with py2app does not run correctly when I double click it from Finder. It works if I run the executable directly (.app/Contents/MacOS/app) from Finder or via terminal. I tried troubleshooting but only got so far as to know that applicationDidFinishLaunch: is not getting called on my app delegate. I dont know why though. I found a couple other threads talking about the same problem - http://stackoverflow.com/questions/11663545/launching-application-made-with-py2app https://groups.google.com/forum/#!topic/pygame-mirror-on-google-groups/eBEW8m0jtl0 I'm using py2app v0.7.1, pyobjc-core v2.4 on OS X 10.8.2. Hope someone here can help! Thanks, Kunal |
|
From: Kunal P. <kun...@gm...> - 2012-11-08 01:41:56
|
I am using ctypes to call SMJobCopyDictionary which returns a CFDictionaryRef. Is there a way to cast that to an NSDictionary such that I can use the regular pyobjc APIs? For example, cfdictionary = SMJobCopyDictionary(...) job_description = cast(cfdictionary, pyobjc_dictionary) program_arguments = job_description['ProgramArguments'] ... |
|
From: Kunal P. <kun...@gm...> - 2012-11-07 22:23:32
|
Thanks Mike. I was able to get it working on my end as well. For reference,
here's my code -
# CoreFoundation framework.
_CoreFoundation =
ctypes.cdll.LoadLibrary(ctypes.util.find_library('CoreFoundation'))
_CFStringCreateWithCString = _CoreFoundation.CFStringCreateWithCString
_CFStringCreateWithCString.restype = ctypes.c_void_p
_CFStringCreateWithCString.argtypes = [
ctypes.c_void_p,
ctypes.c_void_p,
ctypes.c_uint32,
]
_CFRelease = _CoreFoundation.CFRelease
_CFRelease.restype = None
_CFRelease.argtypes = [ctypes.c_void_p]
_kCFStringEncodingUTF8 = 0x08000100
# Security framework.
_Security = ctypes.cdll.LoadLibrary(ctypes.util.find_library('Security'))
_AuthorizationCreate = _Security.AuthorizationCreate
_AuthorizationFree = _Security.AuthorizationFree
_kAuthorizationFlagDefaults = 0
_kAuthorizationFlagInteractionAllowed = (1 << 0)
_kAuthorizationFlagExtendRights = (1 << 1)
_kAuthorizationFlagPartialRights = (1 << 2)
_kAuthorizationFlagDestroyRights = (1 << 3)
_kAuthorizationFlagPreAuthorize = (1 << 4)
_kAuthorizationFlagNoData = (1 << 20)
# ServiceManagement framework.
_ServiceManagement =
ctypes.cdll.LoadLibrary(ctypes.util.find_library('ServiceManagement'))
_SMJobBless = _ServiceManagement.SMJobBless
_SMJobBless.restype = ctypes.c_bool
_SMJobBless.argtypes = [
ctypes.c_void_p,
ctypes.c_void_p,
ctypes.c_void_p,
ctypes.POINTER(ctypes.c_void_p),
]
_kSMDomainSystemLaunchd = ctypes.c_void_p.in_dll(_ServiceManagement,
'kSMDomainSystemLaunchd')
_kSMRightBlessPrivilegedHelper = 'com.apple.ServiceManagement.blesshelper'
class _AuthorizationItem(ctypes.Structure):
_fields_ = [
('name', ctypes.c_char_p),
('valueLength', ctypes.c_uint32),
('value', ctypes.c_void_p),
('flags', ctypes.c_uint32),
]
class _AuthorizationRights(ctypes.Structure):
_fields_ = [
('count', ctypes.c_uint32),
('items', ctypes.POINTER(_AuthorizationItem)),
]
authorization_item = _AuthorizationItem(
name=_kSMRightBlessPrivilegedHelper,
valueLength=0,
value=None,
flags=0,
)
authorization_rights = _AuthorizationRights(
count=1,
items=ctypes.pointer(authorization_item),
)
authorization_flags = (
_kAuthorizationFlagDefaults
| _kAuthorizationFlagInteractionAllowed
| _kAuthorizationFlagPreAuthorize
| _kAuthorizationFlagExtendRights
)
authorization_ref = ctypes.c_void_p()
status = _AuthorizationCreate(
ctypes.byref(authorization_rights),
None,
authorization_flags,
ctypes.byref(authorization_ref),
)
if status:
print('Failed to get rights to install helper, status %d', status)
return
try:
executable_label = _CFStringCreateWithCString(
None,
b'com.kunalparmar.helper'.encode('utf-8'),
_kCFStringEncodingUTF8,
)
try:
if _SMJobBless(
_kSMDomainSystemLaunchd,
executable_label,
authorization_ref,
None,
):
print('Helper installed')
else:
print('Failed to install helper')
finally:
_CFRelease(executable_label)
finally:
_AuthorizationFree(authorization_ref, _kAuthorizationFlagDefaults)
On Mon, Nov 5, 2012 at 8:15 AM, Michael McCracken <
mic...@gm...> wrote:
> Hi Kunal, I recently wrote some code to call SMJobBless and SMJobRemove
> using only ctypes.
> This was lots of boilerplate but works reliably.
> It's GPL, so you can see the code here:
> http://bazaar.launchpad.net/~ubuntuone-control-tower/ubuntuone-control-panel/trunk/view/head:/ubuntuone/controlpanel/utils/darwin.py
>
> Please feel free to ask me if you have any questions.
>
> -mike
>
>
> On Mon, Nov 5, 2012 at 1:56 AM, Ronald Oussoren <ron...@ma...>wrote:
>
>>
>> On 5 Nov, 2012, at 2:59, Kunal Parmar <kun...@gm...> wrote:
>>
>> > I'm getting an error when calling SMJobBless - "ValueError:
>> depythonifying 'pointer', got 'LP_c_void_p'". I've tried a few things
>> without luck. Any help will be appreciated.
>>
>> It's currently not easily possible to use ctypes with PyObjC, I've filed
>> an issue in my bitbucket about adding ctypes support to pyobjc <
>> https://bitbucket.org/ronaldoussoren/pyobjc/issue/23/add-ctypes-support>.
>>
>> Anoyingly the Security framework is not easily wrapped using the normal
>> PyObjC mechanism's either, in particular support for C structs that contain
>> pointers is lacking right now. I'll have to experiment a little to see if I
>> can get your example to work properly using some other hacks.
>>
>> Ronald
>>
>>
>> >
>> > Here's my code -
>> >
>> > from ServiceManagement import (
>> > kSMDomainSystemLaunchd,
>> > SMJobBless,
>> > )
>> >
>> > security = ctypes.cdll.LoadLibrary(ctypes.util.find_library('Security'))
>> >
>> > class AuthorizationItem(ctypes.Structure):
>> > _fields_ = [
>> > ('name', ctypes.c_char_p),
>> > ('valueLength', ctypes.c_uint32),
>> > ('value', ctypes.c_void_p),
>> > ('flags', ctypes.c_uint32),
>> > ]
>> >
>> > class AuthorizationRights(ctypes.Structure):
>> > _fields_ = [
>> > ('count', ctypes.c_uint32),
>> > ('items', ctypes.POINTER(AuthorizationItem)),
>> > ]
>> >
>> > authorization_item = AuthorizationItem(
>> > name='com.apple.ServiceManagement.blesshelper',
>> > valueLength=0,
>> > value=None,
>> > flags=0,
>> > )
>> > authorization_rights = AuthorizationRights(
>> > count=1,
>> > items=ctypes.pointer(authorization_item),
>> > )
>> > authorization_flags = 19
>> > authorization_ref = ctypes.POINTER(ctypes.c_void_p)()
>> > status = security.AuthorizationCreate(
>> > ctypes.pointer(authorization_rights),
>> > None,
>> > authorization_flags,
>> > ctypes.pointer(authorization_ref),
>> > )
>> > SMJobBless(
>> > kSMDomainSystemLaunchd,
>> > 'app.helper',
>> > authorization_ref,
>> > None,
>> > )
>> >
>> ------------------------------------------------------------------------------
>> > LogMeIn Central: Instant, anywhere, Remote PC access and management.
>> > Stay in control, update software, and manage PCs from one command center
>> > Diagnose problems and improve visibility into emerging IT issues
>> > Automate, monitor and manage. Do more in less time with Central
>> >
>> http://p.sf.net/sfu/logmein12331_d2d_______________________________________________
>> > Pyobjc-dev mailing list
>> > Pyo...@li...
>> > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev
>>
>>
>>
>> ------------------------------------------------------------------------------
>> LogMeIn Central: Instant, anywhere, Remote PC access and management.
>> Stay in control, update software, and manage PCs from one command center
>> Diagnose problems and improve visibility into emerging IT issues
>> Automate, monitor and manage. Do more in less time with Central
>> http://p.sf.net/sfu/logmein12331_d2d
>> _______________________________________________
>> Pyobjc-dev mailing list
>> Pyo...@li...
>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev
>>
>
>
|
|
From: Michael M. <mic...@gm...> - 2012-11-07 21:29:36
|
OK, sounds reasonable. As you said, having docs in source control on bitbucket is basically as good as a wiki. Please let me know if I can be of any help. Thanks, -mike On Tue, Nov 6, 2012 at 2:46 AM, Ronald Oussoren <ron...@ma...>wrote: > > On 6 Nov, 2012, at 8:11, Ronald Oussoren <ron...@ma...> wrote: > > > > > On 5 Nov, 2012, at 18:04, Michael McCracken <mic...@gm...> > wrote: > > > >> Ronald et al, what are your thoughts on enabling the wiki feature of > bitbucket for pyobjc? > >> > >> I know Ronald has limited time for documentation, and this might give > us a way to share updated info without digging through mailing lists. > >> > >> I am usually ambivalent about wikis because they are often disorganized > and stale, and can be added work, but in this case I think it might be > helpful. > > > > I'd prefer to improve the documentation instead of using a wiki. I'm > working on updateing the website using the documentation in the source > tree, once that is done updating the documentation will be almost as easy > as editing a wiki. The primary difference will be that there is no instant > gratification while editing, updates will be patches/pull requests that > have to be processed by me. > > See <https://bitbucket.org/ronaldoussoren/pyobjc-website> for the script > that I'll use to update the website. If all goes as planned this will > allow for scripted updates to the website (using a cronjob or a commit hook) > > Ronald > > > > ------------------------------------------------------------------------------ > LogMeIn Central: Instant, anywhere, Remote PC access and management. > Stay in control, update software, and manage PCs from one command center > Diagnose problems and improve visibility into emerging IT issues > Automate, monitor and manage. Do more in less time with Central > http://p.sf.net/sfu/logmein12331_d2d > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > |
|
From: SourceForge.net <no...@so...> - 2012-11-07 20:19:43
|
Bugs item #3585235, was opened at 2012-11-07 12:19 Message generated for change (Tracker Item Submitted) made by You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=114534&aid=3585235&group_id=14534 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: https://www.google.com/accounts () Assigned to: Nobody/Anonymous (nobody) Summary: Typo in _pyobjc_performOnThread_ Initial Comment: Every method defined in http://pyobjc.sourceforge.net/documentation/pyobjc-framework-Cocoa/threading-helpers.html is not functionally due to a typo in _pyobjc_performOnThread_ and _pyobjc_performOnThreadWithResult definitions: @objc.namedSelector(b"_pyobjc_performOnThread:") def _pyobjc_performOnThread_(self, callinfo): @objc.namedSelector(b"_pyobjc_performOnThreadWithResult:") def _pyobjc_performOnThreadWithResult_(self, callinfo): However, methods refer to these methods using selector which lacks the trailing underscore: self.performSelector_onThread_withObject_waitUntilDone_('pyobjc_performOnThread:', thread, (aSelector, arg), wait) These lead the following exceptions to be raised: ValueError: NSInvalidArgumentException - -[NSObject pyobjc_performOnThread:]: unrecognized selector sent to instance ValueError: NSInvalidArgumentException - -[NSObject pyobjc_performOnThreadWithResult:]: unrecognized selector sent to instance Patch is attached (produced by git with --no-prefix). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=114534&aid=3585235&group_id=14534 |
|
From: Ronald O. <ron...@ma...> - 2012-11-06 10:47:10
|
On 6 Nov, 2012, at 8:11, Ronald Oussoren <ron...@ma...> wrote: > > On 5 Nov, 2012, at 18:04, Michael McCracken <mic...@gm...> wrote: > >> Ronald et al, what are your thoughts on enabling the wiki feature of bitbucket for pyobjc? >> >> I know Ronald has limited time for documentation, and this might give us a way to share updated info without digging through mailing lists. >> >> I am usually ambivalent about wikis because they are often disorganized and stale, and can be added work, but in this case I think it might be helpful. > > I'd prefer to improve the documentation instead of using a wiki. I'm working on updateing the website using the documentation in the source tree, once that is done updating the documentation will be almost as easy as editing a wiki. The primary difference will be that there is no instant gratification while editing, updates will be patches/pull requests that have to be processed by me. See <https://bitbucket.org/ronaldoussoren/pyobjc-website> for the script that I'll use to update the website. If all goes as planned this will allow for scripted updates to the website (using a cronjob or a commit hook) Ronald |
|
From: Ronald O. <ron...@ma...> - 2012-11-06 07:12:09
|
On 5 Nov, 2012, at 18:04, Michael McCracken <mic...@gm...> wrote: > Ronald et al, what are your thoughts on enabling the wiki feature of bitbucket for pyobjc? > > I know Ronald has limited time for documentation, and this might give us a way to share updated info without digging through mailing lists. > > I am usually ambivalent about wikis because they are often disorganized and stale, and can be added work, but in this case I think it might be helpful. I'd prefer to improve the documentation instead of using a wiki. I'm working on updateing the website using the documentation in the source tree, once that is done updating the documentation will be almost as easy as editing a wiki. The primary difference will be that there is no instant gratification while editing, updates will be patches/pull requests that have to be processed by me. Ronald > > -mike > ------------------------------------------------------------------------------ > LogMeIn Central: Instant, anywhere, Remote PC access and management. > Stay in control, update software, and manage PCs from one command center > Diagnose problems and improve visibility into emerging IT issues > Automate, monitor and manage. Do more in less time with Central > http://p.sf.net/sfu/logmein12331_d2d_______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
|
From: Michael M. <mic...@gm...> - 2012-11-05 17:04:56
|
Ronald et al, what are your thoughts on enabling the wiki feature of bitbucket for pyobjc? I know Ronald has limited time for documentation, and this might give us a way to share updated info without digging through mailing lists. I am usually ambivalent about wikis because they are often disorganized and stale, and can be added work, but in this case I think it might be helpful. -mike |
|
From: Ronald O. <ron...@ma...> - 2012-11-05 16:41:22
|
On 5 Nov, 2012, at 17:33, Michael McCracken <mic...@gm...> wrote: > A pyobjc built on 10.7 fails to load libobjc.dylib on 10.6, because 10.6 libobjc is missing some symbols - _objc_allocateProtocol is the first one it complains about. > > So, to ship an app with pyobjc that will run on 10.6 and 10.7, what's the best route? > > I guess building pyobjc on 10.6 should work, but ideally it'd be possible to build this pyobjc on 10.7. > > I recently tried building pyobjc with MACOSX_DEPLOYMENT_TARGET=10.6, and found a mismatch. It seems like the correct way is to also build python with that variable set. > > Is that everything, or are there any gotcha's I'm missing? That looks correct. You need to build with the right deployment target to get code that can run on 10.6. Both for PyObjC and Python itself I consider it a bug when you cannot build on a later system that you want to deploy on, as long as you set MACOSX_DEPLOYMENT_TARGET to an appopriate value. For PyObjC you actually need to build on a late version of the SDK when you want to have a full featured build (one example of this is blocks, you need to build with a compiler and SDK that support blocks if you want to optionally use blocks on recent enough OSX releases) Ronald > > Thanks, > -mike > ------------------------------------------------------------------------------ > LogMeIn Central: Instant, anywhere, Remote PC access and management. > Stay in control, update software, and manage PCs from one command center > Diagnose problems and improve visibility into emerging IT issues > Automate, monitor and manage. Do more in less time with Central > http://p.sf.net/sfu/logmein12331_d2d_______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
|
From: Michael M. <mic...@gm...> - 2012-11-05 16:34:01
|
A pyobjc built on 10.7 fails to load libobjc.dylib on 10.6, because 10.6 libobjc is missing some symbols - _objc_allocateProtocol is the first one it complains about. So, to ship an app with pyobjc that will run on 10.6 and 10.7, what's the best route? I guess building pyobjc on 10.6 should work, but ideally it'd be possible to build this pyobjc on 10.7. I recently tried building pyobjc with MACOSX_DEPLOYMENT_TARGET=10.6, and found a mismatch. It seems like the correct way is to also build python with that variable set. Is that everything, or are there any gotcha's I'm missing? Thanks, -mike |
|
From: Michael M. <mic...@gm...> - 2012-11-05 16:16:15
|
Hi Kunal, I recently wrote some code to call SMJobBless and SMJobRemove using only ctypes. This was lots of boilerplate but works reliably. It's GPL, so you can see the code here: http://bazaar.launchpad.net/~ubuntuone-control-tower/ubuntuone-control-panel/trunk/view/head:/ubuntuone/controlpanel/utils/darwin.py Please feel free to ask me if you have any questions. -mike On Mon, Nov 5, 2012 at 1:56 AM, Ronald Oussoren <ron...@ma...>wrote: > > On 5 Nov, 2012, at 2:59, Kunal Parmar <kun...@gm...> wrote: > > > I'm getting an error when calling SMJobBless - "ValueError: > depythonifying 'pointer', got 'LP_c_void_p'". I've tried a few things > without luck. Any help will be appreciated. > > It's currently not easily possible to use ctypes with PyObjC, I've filed > an issue in my bitbucket about adding ctypes support to pyobjc < > https://bitbucket.org/ronaldoussoren/pyobjc/issue/23/add-ctypes-support>. > > Anoyingly the Security framework is not easily wrapped using the normal > PyObjC mechanism's either, in particular support for C structs that contain > pointers is lacking right now. I'll have to experiment a little to see if I > can get your example to work properly using some other hacks. > > Ronald > > > > > > Here's my code - > > > > from ServiceManagement import ( > > kSMDomainSystemLaunchd, > > SMJobBless, > > ) > > > > security = ctypes.cdll.LoadLibrary(ctypes.util.find_library('Security')) > > > > class AuthorizationItem(ctypes.Structure): > > _fields_ = [ > > ('name', ctypes.c_char_p), > > ('valueLength', ctypes.c_uint32), > > ('value', ctypes.c_void_p), > > ('flags', ctypes.c_uint32), > > ] > > > > class AuthorizationRights(ctypes.Structure): > > _fields_ = [ > > ('count', ctypes.c_uint32), > > ('items', ctypes.POINTER(AuthorizationItem)), > > ] > > > > authorization_item = AuthorizationItem( > > name='com.apple.ServiceManagement.blesshelper', > > valueLength=0, > > value=None, > > flags=0, > > ) > > authorization_rights = AuthorizationRights( > > count=1, > > items=ctypes.pointer(authorization_item), > > ) > > authorization_flags = 19 > > authorization_ref = ctypes.POINTER(ctypes.c_void_p)() > > status = security.AuthorizationCreate( > > ctypes.pointer(authorization_rights), > > None, > > authorization_flags, > > ctypes.pointer(authorization_ref), > > ) > > SMJobBless( > > kSMDomainSystemLaunchd, > > 'app.helper', > > authorization_ref, > > None, > > ) > > > ------------------------------------------------------------------------------ > > LogMeIn Central: Instant, anywhere, Remote PC access and management. > > Stay in control, update software, and manage PCs from one command center > > Diagnose problems and improve visibility into emerging IT issues > > Automate, monitor and manage. Do more in less time with Central > > > http://p.sf.net/sfu/logmein12331_d2d_______________________________________________ > > Pyobjc-dev mailing list > > Pyo...@li... > > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > > > > ------------------------------------------------------------------------------ > LogMeIn Central: Instant, anywhere, Remote PC access and management. > Stay in control, update software, and manage PCs from one command center > Diagnose problems and improve visibility into emerging IT issues > Automate, monitor and manage. Do more in less time with Central > http://p.sf.net/sfu/logmein12331_d2d > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > |
|
From: Ronald O. <ron...@ma...> - 2012-11-05 09:57:15
|
On 5 Nov, 2012, at 2:59, Kunal Parmar <kun...@gm...> wrote: > I'm getting an error when calling SMJobBless - "ValueError: depythonifying 'pointer', got 'LP_c_void_p'". I've tried a few things without luck. Any help will be appreciated. It's currently not easily possible to use ctypes with PyObjC, I've filed an issue in my bitbucket about adding ctypes support to pyobjc <https://bitbucket.org/ronaldoussoren/pyobjc/issue/23/add-ctypes-support>. Anoyingly the Security framework is not easily wrapped using the normal PyObjC mechanism's either, in particular support for C structs that contain pointers is lacking right now. I'll have to experiment a little to see if I can get your example to work properly using some other hacks. Ronald > > Here's my code - > > from ServiceManagement import ( > kSMDomainSystemLaunchd, > SMJobBless, > ) > > security = ctypes.cdll.LoadLibrary(ctypes.util.find_library('Security')) > > class AuthorizationItem(ctypes.Structure): > _fields_ = [ > ('name', ctypes.c_char_p), > ('valueLength', ctypes.c_uint32), > ('value', ctypes.c_void_p), > ('flags', ctypes.c_uint32), > ] > > class AuthorizationRights(ctypes.Structure): > _fields_ = [ > ('count', ctypes.c_uint32), > ('items', ctypes.POINTER(AuthorizationItem)), > ] > > authorization_item = AuthorizationItem( > name='com.apple.ServiceManagement.blesshelper', > valueLength=0, > value=None, > flags=0, > ) > authorization_rights = AuthorizationRights( > count=1, > items=ctypes.pointer(authorization_item), > ) > authorization_flags = 19 > authorization_ref = ctypes.POINTER(ctypes.c_void_p)() > status = security.AuthorizationCreate( > ctypes.pointer(authorization_rights), > None, > authorization_flags, > ctypes.pointer(authorization_ref), > ) > SMJobBless( > kSMDomainSystemLaunchd, > 'app.helper', > authorization_ref, > None, > ) > ------------------------------------------------------------------------------ > LogMeIn Central: Instant, anywhere, Remote PC access and management. > Stay in control, update software, and manage PCs from one command center > Diagnose problems and improve visibility into emerging IT issues > Automate, monitor and manage. Do more in less time with Central > http://p.sf.net/sfu/logmein12331_d2d_______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
|
From: Kunal P. <kun...@gm...> - 2012-11-05 02:34:27
|
An application I am working on needs to install a helper. There are no wrappers for the SFAuthorization APIs in PyObjc. Am I missing something? Is anyone working on it? If not, can you point me on how to go about creating them. Thanks in advance, Kunal |
|
From: Kunal P. <kun...@gm...> - 2012-11-05 01:59:14
|
I'm getting an error when calling SMJobBless - "ValueError: depythonifying
'pointer', got 'LP_c_void_p'". I've tried a few things without luck. Any
help will be appreciated.
Here's my code -
from ServiceManagement import (
kSMDomainSystemLaunchd,
SMJobBless,
)
security = ctypes.cdll.LoadLibrary(ctypes.util.find_library('Security'))
class AuthorizationItem(ctypes.Structure):
_fields_ = [
('name', ctypes.c_char_p),
('valueLength', ctypes.c_uint32),
('value', ctypes.c_void_p),
('flags', ctypes.c_uint32),
]
class AuthorizationRights(ctypes.Structure):
_fields_ = [
('count', ctypes.c_uint32),
('items', ctypes.POINTER(AuthorizationItem)),
]
authorization_item = AuthorizationItem(
name='com.apple.ServiceManagement.blesshelper',
valueLength=0,
value=None,
flags=0,
)
authorization_rights = AuthorizationRights(
count=1,
items=ctypes.pointer(authorization_item),
)
authorization_flags = 19
authorization_ref = ctypes.POINTER(ctypes.c_void_p)()
status = security.AuthorizationCreate(
ctypes.pointer(authorization_rights),
None,
authorization_flags,
ctypes.pointer(authorization_ref),
)
SMJobBless(
kSMDomainSystemLaunchd,
'app.helper',
authorization_ref,
None,
)
|
|
From: Michael M. <mic...@gm...> - 2012-11-03 08:27:29
|
I ran into this recently too, and stumbled on this unintuitive solution for doing this without starting a dummy Xcode project. (Although you might as well, if you're going to do lots of editing of nibs) Note, I only tried this for connecting IBOutlets to objects in a nib, I haven't tried adding IBActions, but I assume it'd work. - Declare your outlets and actions in the python file using e.g. objc.IBOutlet - open your nib in Xcode - choose Navigate > Reveal in Project Navigator to show the hidden left pane that now includes just your nib file - drag your pyobjc file to that pane Then Xcode parses the IBOutlets (and hopefully also IBActions) declared in that file, making them available to hook up in IB. This worked for me, but is not based on any deep understanding of Xcode's new organization, so your mileage etc etc. Hope this is helpful. -mike On Tue, Oct 2, 2012 at 3:47 PM, Diez B. Roggisch <de...@we...> wrote: > > On Oct 1, 2012, at 7:29 PM, Ronald Oussoren wrote: > > > > > On 28 Sep, 2012, at 17:18, Diez B. Roggisch <de...@we...> wrote: > > > >> Hi, > >> > >> ooookeeey. This is embarrassing. But the new Xcode 4 Interface Builder > is… something to get used to. And the one thing totally not working for me: > making new IBActions. There used to be a time when you could simple do > that, IB wouldn't care, but the runtime would connect things as advertised. > >> > >> Now, I can't do anything anymore. > >> > >> All I do is open a XIB-File in XCode, there is no "project" involved. > Is that maybe the reason? > > > > It should work when you create an Xcode project that contains the Python > source files that define the actions. You don't have to use Xcode to > actually build the application bundle. > > Tried that, failed, got your mail, tried it again - if the names of the > Class-File are the same, it works. I guess I had problems because of an > "old" XIB just being used. > > Thanks, > > Diez > > ------------------------------------------------------------------------------ > Don't let slow site performance ruin your business. Deploy New Relic APM > Deploy New Relic app performance management and know exactly > what is happening inside your Ruby, Python, PHP, Java, and .NET app > Try New Relic at no cost today and get our sweet Data Nerd shirt too! > http://p.sf.net/sfu/newrelic-dev2dev > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > |