pyobjc-dev Mailing List for PyObjC (Page 31)
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: Ronald O. <ron...@ma...> - 2010-02-02 08:30:39
|
On 29 Jan, 2010, at 0:11, Mani Ghasemlou wrote: > Hello, > > This might be more of an Xcode question than PyObjC, but was hoping someone on this list could answer. > > I have some unit testing .py files added to my project. I would like to have these unit tests run when build is called by Xcode, and for the build to halt with error if any of the unit tests fail. > > Can anyone recommend a clean way to accomplish this? The xcode list would probably more appropriate for this question as there are more xcode experts there. That said, a custom build step should be able to do what you want. Ronald |
From: Ronald O. <ron...@ma...> - 2010-02-02 08:29:21
|
On 10 Jan, 2010, at 23:31, Jep Hill wrote: > Hello all, > > Having searched the web high and low trying to find help with QTKit and Python on Snow Leopard 10.6.2,I was very happy to find this forum. > > Can anyone tell my how to get this sample script working: http://pseudogreen.org/blog/qtkit/ > > I'm pulling my hair out trying to figure out why I keep getting this error: > > > $convert_for_iphone in_test.mov out_test.mov > Traceback (most recent call last): > File "/Users/jep/scripts/python/convert_for_iphone", line 49, in <module> > convert_for_iphone(infile, outfile) > File "/Users/jep/scripts/python/convert_for_iphone", line 27, in convert_for_iphone > movie, error = QTKit.QTMovie.movieWithAttributes_error_(in_attrs, None) > KeyError: u'QTMovieDelegateAttribute' > > In fact I'm getting the same "Key Error: u'QTMovieDelegateAttribute" on several example scripts. I can't seem to successfully initialize a movie object. > > All help is more than appreciated — thank you all. I get the same error message. My guess is that something changed in 10.6 that invalidated the script. Ronald > > Jep > ------------------------------------------------------------------------------ > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
From: Aahz <aa...@py...> - 2010-01-29 17:16:43
|
On Fri, Jan 29, 2010, Ronald Oussoren wrote: > On Friday, January 29, 2010, at 06:26AM, "Aahz" <aa...@py...> wrote: >> >>How do I download the source for exactly the release that's available on >>PyPI? Using trunk straight-up is something I'd rather avoid. > > The sources should be available on pypi. I haven't created a tag in > the repository for the last release, that's something to add to my > release checklist for future releases. Do I need to download each source file separately? I don't see any easy_install option to grab dependencies of source. -- Aahz (aa...@py...) <*> http://www.pythoncraft.com/ import antigravity |
From: Luc H. <lu...@ho...> - 2010-01-29 12:56:45
|
On 10 janv. 2010, at 23:31, Jep Hill wrote: > KeyError: u'QTMovieDelegateAttribute' I had this problem no later than last week and my guess was that the movieWithAttributes:error: method *expects* the QTMovieDelegateAttribute to be present in the attributes dictionary. And indeed, adding QTMovieDelegateAttribute:None to the dict fixed the problem. -- Luc Heinrich - lu...@ho... |
From: Ronald O. <ron...@ma...> - 2010-01-29 09:39:35
|
On Friday, January 29, 2010, at 06:26AM, "Aahz" <aa...@py...> wrote: >How do I download the source for exactly the release that's available on >PyPI? Using trunk straight-up is something I'd rather avoid. The sources should be available on pypi. I haven't created a tag in the repository for the last release, that's something to add to my release checklist for future releases. Ronald |
From: Aahz <aa...@py...> - 2010-01-29 05:26:22
|
How do I download the source for exactly the release that's available on PyPI? Using trunk straight-up is something I'd rather avoid. -- Aahz (aa...@py...) <*> http://www.pythoncraft.com/ import antigravity |
From: Mani G. <ma...@tu...> - 2010-01-28 23:12:01
|
Hello, This might be more of an Xcode question than PyObjC, but was hoping someone on this list could answer. I have some unit testing .py files added to my project. I would like to have these unit tests run when build is called by Xcode, and for the build to halt with error if any of the unit tests fail. Can anyone recommend a clean way to accomplish this? Thanks very much, Mani |
From: Vladimir P. <far...@gm...> - 2010-01-27 10:44:09
|
Hi all, I'm trying to mix up ctypes and pyobjc a little bit. What I need is access to some objc runtime functions, that return id, thus a pointer to objc class. Is there any way to resolve that pointer to anything usable by pyobjc? -- Sincerely, Vladimir "Farcaller" Pouzanov http://farcaller.net/ |
From: Ian B. <ia...@on...> - 2010-01-26 16:57:24
|
On Jan 26, 2010, at 2:18 AM, Ronald Oussoren wrote: > You cannot link to multiple python interpreters in the same proces when you also use PyObjC due to conflicting symbols. Even without PyObjC using multiple Python versions at the same time is hairy and only works on OSX due to two-level namespaces. > > The only workaround for this is to use the same version of Python in your plugin and the py2app one. Is there a way to specify which version of Python to use? Ideally, I'd like to just make use of the Python interpreter setup by the py2app plugin if it exists, and otherwise setup a new environment by hand, but I'm not sure where in the Python API to look for this kind of functionality. I'm not very familiar with the C interface to Python yet. > P.S. It is probably possible to work around this using preprocessor trickery in the PyObjC sources to ensure that all used symbols are version specific but I'm not interested in working on that any time soon (but would be willing to review and apply patches). I'm not really interested in you working on that, either. :-) Multiple plugin developers using different methods to approach PyObjC seems like something that isn't likely to come up much. Ian |
From: Ronald O. <ron...@ma...> - 2010-01-26 14:56:24
|
On 26 Jan, 2010, at 14:40, Virgil Dupras wrote: > On Wed, Jan 20, 2010 at 10:55 PM, Ronald Oussoren > <ron...@ma...> wrote: >> >> On 20 Jan, 2010, at 22:52, Virgil Dupras wrote: >> >>> On Wed, Jan 20, 2010 at 10:50 PM, Leonardo Santagada >>> <san...@gm...> wrote: >>>> >>>> On Jan 20, 2010, at 7:45 PM, Ronald Oussoren wrote: >>>> >>>>> On 20 Jan, 2010, at 12:30, Virgil Dupras wrote: >>>>> >>>>>> Hi there, >>>>>> >>>>>> I recently started to use PyObjC 2.2 (after having use 1.4 for a long >>>>>> time), mainly for 64-bit support, and the biggest problem I have with >>>>>> it is bridge support's memory usage. One of my applications which used >>>>>> to use 22mb of memory on launch when built with pyobjc 1.4 used 48mb >>>>>> when built with pyobjc 2.2. >>>>> >>>>> Ouch. >>>> >>>> Can it be that a good part of this doubling in size is just from pointers going from 32 to 64bits? >>>> >>>> -- >>>> Leonardo Santagada >>>> santagada at gmail.com >>>> >>>> >>>> >>>> >>> >>> No, 48mb is in 32bit mode. When in 64-bit mode, it's 95mb >> >> This definitly needs time with a measurement tool then, I wouldn't have expected that the amount of memory used would actually double in 64-bit mode. >> >> Ronald >> >> > > I just wanted to let you know, Ronald (and everyone else), that I > began working on an experimental fork of PyObjC to reduce its initial > memory usage. I have just committed a change that reduces initial > memory usage for "import AppKit" in 64-bit from 58mb to 31 mb without > making a single test unit fail. This fork is at > http://hg.hardcoded.net/pyobjc . I have also documented by experiments > in the project's wiki. I'd greatly appreciate your feedbacks on this. Interesting. At first glance your change indicates that the xml files contain loads of junk that should be removed. That is, the nodes that shouldn't be included according to "methodNodeHasSpecialArgs" probably shouldn't be in the xml file in the first place. That means the bridgesupport generator is even more broken than I already knew. That is not a complete surprise though, the pyobjc generator is a crude hack that should be replaced by a cleaner design. If I had the time I'd rearchitect the metadata generator into two parts: (1) a clang-based tool that just prints all definitions in header files into some convenient format (json or xml) and (2) a tool that can merge the output of the first tool for various architectures and an exceptions file. For added bonus points there should be a gui tool that makes editing the exceptions easier. BTW. I noticed you also intend to work on documentation: I'm (slowly) converting documentation into Sphynx format in the pyobjc-core trunk. I wouldn't mind adding internal C documentation to that as well. Ronald > -- > Virgil Dupras > Hardcoded Software > http://www.hardcoded.net > > ------------------------------------------------------------------------------ > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
From: Virgil D. <hs...@ha...> - 2010-01-26 14:08:37
|
On Wed, Jan 20, 2010 at 10:55 PM, Ronald Oussoren <ron...@ma...> wrote: > > On 20 Jan, 2010, at 22:52, Virgil Dupras wrote: > >> On Wed, Jan 20, 2010 at 10:50 PM, Leonardo Santagada >> <san...@gm...> wrote: >>> >>> On Jan 20, 2010, at 7:45 PM, Ronald Oussoren wrote: >>> >>>> On 20 Jan, 2010, at 12:30, Virgil Dupras wrote: >>>> >>>>> Hi there, >>>>> >>>>> I recently started to use PyObjC 2.2 (after having use 1.4 for a long >>>>> time), mainly for 64-bit support, and the biggest problem I have with >>>>> it is bridge support's memory usage. One of my applications which used >>>>> to use 22mb of memory on launch when built with pyobjc 1.4 used 48mb >>>>> when built with pyobjc 2.2. >>>> >>>> Ouch. >>> >>> Can it be that a good part of this doubling in size is just from pointers going from 32 to 64bits? >>> >>> -- >>> Leonardo Santagada >>> santagada at gmail.com >>> >>> >>> >>> >> >> No, 48mb is in 32bit mode. When in 64-bit mode, it's 95mb > > This definitly needs time with a measurement tool then, I wouldn't have expected that the amount of memory used would actually double in 64-bit mode. > > Ronald > > I just wanted to let you know, Ronald (and everyone else), that I began working on an experimental fork of PyObjC to reduce its initial memory usage. I have just committed a change that reduces initial memory usage for "import AppKit" in 64-bit from 58mb to 31 mb without making a single test unit fail. This fork is at http://hg.hardcoded.net/pyobjc . I have also documented by experiments in the project's wiki. I'd greatly appreciate your feedbacks on this. -- Virgil Dupras Hardcoded Software http://www.hardcoded.net |
From: Ronald O. <ron...@ma...> - 2010-01-26 10:18:57
|
On 24 Jan, 2010, at 18:18, Ian Beck wrote: > Hey folks, > > I'm working on a plugin that adds several Python scripts to a program. Previously I was just compiling it with py2app, but this slowed the main application launch way down so the developer asked me to switch to manually setting things up via Objective-C and the Python C interface. I did so, and it works great. > > However, now there's a second plugin that uses py2app, and it's conflicting with my plugin because the Python interpreter is already setup by the time my plugin gets to it and for some reason it's causing my main Python file to try and import from both the Python 2.5 framework and the 2.6 framework when I run it using PyRun_SimpleFile (I'm on 10.6, obviously). I get a bunch of error messages along these lines in the console before the whole thing crashes: > > Class OC_NSBundleHack is implemented in both /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC/objc/_objc.so and /System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/PyObjC/objc/_objc.so. One of the two will be used. Which one is undefined. > > Any ideas how I can get my C API plugin and the third party py2app plugin to live happily in the same Python interpreter? I'm pretty sure this is a simple problem of the Python environment being setup differently by py2app and my C API code, but I'm not sure what types of things I might need to change to fix the problem. > > Thanks for any suggestions you can give me! You cannot link to multiple python interpreters in the same proces when you also use PyObjC due to conflicting symbols. Even without PyObjC using multiple Python versions at the same time is hairy and only works on OSX due to two-level namespaces. The only workaround for this is to use the same version of Python in your plugin and the py2app one. Ronald P.S. It is probably possible to work around this using preprocessor trickery in the PyObjC sources to ensure that all used symbols are version specific but I'm not interested in working on that any time soon (but would be willing to review and apply patches). |
From: Ian B. <ia...@on...> - 2010-01-24 18:12:58
|
Hey folks, I'm working on a plugin that adds several Python scripts to a program. Previously I was just compiling it with py2app, but this slowed the main application launch way down so the developer asked me to switch to manually setting things up via Objective-C and the Python C interface. I did so, and it works great. However, now there's a second plugin that uses py2app, and it's conflicting with my plugin because the Python interpreter is already setup by the time my plugin gets to it and for some reason it's causing my main Python file to try and import from both the Python 2.5 framework and the 2.6 framework when I run it using PyRun_SimpleFile (I'm on 10.6, obviously). I get a bunch of error messages along these lines in the console before the whole thing crashes: Class OC_NSBundleHack is implemented in both /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC/objc/_objc.so and /System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/PyObjC/objc/_objc.so. One of the two will be used. Which one is undefined. Any ideas how I can get my C API plugin and the third party py2app plugin to live happily in the same Python interpreter? I'm pretty sure this is a simple problem of the Python environment being setup differently by py2app and my C API code, but I'm not sure what types of things I might need to change to fix the problem. Thanks for any suggestions you can give me! Ian |
From: Orestis M. <or...@or...> - 2010-01-21 16:52:57
|
On 21 Jan 2010, at 17:38, Ronald Oussoren wrote: > This now works on my machine: > > import objc > > > NSObject = objc.lookUpClass('NSObject') > NSKeyValueObservingOptionNew = 0x01 > NSKeyValueObservingOptionOld = 0x02 > > > > class Observer (NSObject): > def init(self): > self = super(Observer, self).init() > self.keys = [] > return self > > def dealloc(self): > for o, k in self.keys: > o.removeObserver_forKeyPath_(self, k) > > def observeValueForKeyPath_ofObject_change_context_(self, path, object, change, context): > print "===> %s\t\t%s"%(path, change) > > def register(self, object, keypath): > object.addObserver_forKeyPath_options_context_( > self, keypath, > NSKeyValueObservingOptionNew|NSKeyValueObservingOptionOld, > 0) > self.keys.append((object, keypath)) > > > class Person (NSObject): > def _init(self): > self = objc.super(Person, self).init() > self.firstName = None > self.lastName = None > return self > > firstName = objc.object_property() > lastName = objc.object_property() > > fullName = objc.object_property(read_only=True, ivar=objc.NULL) > fullName.depends_on(u'firstName') > fullName.depends_on(u'lastName') > > @fullName.getter > def fullName(self): > return "%s %s"%(self.firstName, self.lastName) > > obs = Observer.alloc().init() > pers = Person.alloc().init() > obs.register(pers, "fullName") > obs.register(pers, "firstName") > obs.register(pers, "lastName") > > pers.firstName = "Ronald" > pers.lastName = "Oussoren" > > print "done" > print pers.fullName > > > That is, I can define something that behaves like a python property for Python code, but is implemented using ObjC-style getter/setter methods and therefore participates properly in key-value observations. > > What makes me really happy is that adding some hooks to the bridge allowed me to write class objc_property in Python, which should make it a lot more convenient to add simular properties that represent an array or set. > > I haven't committed this to the repository yet, I have to add unittests and documentation before I do that. That looks brilliant! Great job, thanks for all your efforts on PyObjC. Orestis > Ronald------------------------------------------------------------------------------ > Throughout its 18-year history, RSA Conference consistently attracts the > world's best and brightest in the field, creating opportunities for Conference > attendees to learn about information security's most important issues through > interactions with peers, luminaries and emerging and established companies. > http://p.sf.net/sfu/rsaconf-dev2dev_______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
From: Ronald O. <ron...@ma...> - 2010-01-21 15:38:45
|
This now works on my machine: import objc NSObject = objc.lookUpClass('NSObject') NSKeyValueObservingOptionNew = 0x01 NSKeyValueObservingOptionOld = 0x02 class Observer (NSObject): def init(self): self = super(Observer, self).init() self.keys = [] return self def dealloc(self): for o, k in self.keys: o.removeObserver_forKeyPath_(self, k) def observeValueForKeyPath_ofObject_change_context_(self, path, object, change, context): print "===> %s\t\t%s"%(path, change) def register(self, object, keypath): object.addObserver_forKeyPath_options_context_( self, keypath, NSKeyValueObservingOptionNew|NSKeyValueObservingOptionOld, 0) self.keys.append((object, keypath)) class Person (NSObject): def _init(self): self = objc.super(Person, self).init() self.firstName = None self.lastName = None return self firstName = objc.object_property() lastName = objc.object_property() fullName = objc.object_property(read_only=True, ivar=objc.NULL) fullName.depends_on(u'firstName') fullName.depends_on(u'lastName') @fullName.getter def fullName(self): return "%s %s"%(self.firstName, self.lastName) obs = Observer.alloc().init() pers = Person.alloc().init() obs.register(pers, "fullName") obs.register(pers, "firstName") obs.register(pers, "lastName") pers.firstName = "Ronald" pers.lastName = "Oussoren" print "done" print pers.fullName That is, I can define something that behaves like a python property for Python code, but is implemented using ObjC-style getter/setter methods and therefore participates properly in key-value observations. What makes me really happy is that adding some hooks to the bridge allowed me to write class objc_property in Python, which should make it a lot more convenient to add simular properties that represent an array or set. I haven't committed this to the repository yet, I have to add unittests and documentation before I do that. Ronald |
From: Ronald O. <ron...@ma...> - 2010-01-20 21:55:21
|
On 20 Jan, 2010, at 22:52, Virgil Dupras wrote: > On Wed, Jan 20, 2010 at 10:50 PM, Leonardo Santagada > <san...@gm...> wrote: >> >> On Jan 20, 2010, at 7:45 PM, Ronald Oussoren wrote: >> >>> On 20 Jan, 2010, at 12:30, Virgil Dupras wrote: >>> >>>> Hi there, >>>> >>>> I recently started to use PyObjC 2.2 (after having use 1.4 for a long >>>> time), mainly for 64-bit support, and the biggest problem I have with >>>> it is bridge support's memory usage. One of my applications which used >>>> to use 22mb of memory on launch when built with pyobjc 1.4 used 48mb >>>> when built with pyobjc 2.2. >>> >>> Ouch. >> >> Can it be that a good part of this doubling in size is just from pointers going from 32 to 64bits? >> >> -- >> Leonardo Santagada >> santagada at gmail.com >> >> >> >> > > No, 48mb is in 32bit mode. When in 64-bit mode, it's 95mb This definitly needs time with a measurement tool then, I wouldn't have expected that the amount of memory used would actually double in 64-bit mode. Ronald |
From: Virgil D. <hs...@ha...> - 2010-01-20 21:52:10
|
On Wed, Jan 20, 2010 at 10:50 PM, Leonardo Santagada <san...@gm...> wrote: > > On Jan 20, 2010, at 7:45 PM, Ronald Oussoren wrote: > >> On 20 Jan, 2010, at 12:30, Virgil Dupras wrote: >> >>> Hi there, >>> >>> I recently started to use PyObjC 2.2 (after having use 1.4 for a long >>> time), mainly for 64-bit support, and the biggest problem I have with >>> it is bridge support's memory usage. One of my applications which used >>> to use 22mb of memory on launch when built with pyobjc 1.4 used 48mb >>> when built with pyobjc 2.2. >> >> Ouch. > > Can it be that a good part of this doubling in size is just from pointers going from 32 to 64bits? > > -- > Leonardo Santagada > santagada at gmail.com > > > > No, 48mb is in 32bit mode. When in 64-bit mode, it's 95mb -- Virgil Dupras Hardcoded Software http://www.hardcoded.net |
From: Ronald O. <ron...@ma...> - 2010-01-20 21:51:44
|
On 20 Jan, 2010, at 16:33, Mani Ghasemlou wrote: > Hi everyone, > > I have a couple hopefully simple questions about PyObjC, and would highly appreciate your responses! > > - If I build a (standard Xcode template) PyObjC app on a Leopard 10.5 machine (with all the system updates), would this app use the version of PyObjC installed on the build system (2.0), or would it use the version of PyObjC on the system it is being run on? i.e. PyObjC 2.2 on SL. It would use the system version of PyObjC. > > - Is it safe to upgrade to PyObjC 2.2 on my Leopard machine (I'd like to do this to see if it resolves some serious memory leaks in my app)? If so, what is the correct way to do so? I have tried 'sudo easy_install pyobjc==2.2', to no avail, it keeps telling me to upgrade my version of setuptools to 0.6c7, when in fact I have 0.6c11 installed, and running easy_install -U setuptools doesn't resolve the issue (this is probably a bug). I advise against replacing PyObjC in the system install of Python because 2.2 isn't 100% compatible with the version in Leopard and you might therefore break parts of your system by replacing PyObjC. What you can do is install Python from python.org website and then install PyObjC into that. The xcode template should then link to that copy of python. But be warned that the app bundle than requires that your users also install Python.org's python (that is, unless you start using py2app). Ronald |
From: Leonardo S. <san...@gm...> - 2010-01-20 21:51:03
|
On Jan 20, 2010, at 7:45 PM, Ronald Oussoren wrote: > On 20 Jan, 2010, at 12:30, Virgil Dupras wrote: > >> Hi there, >> >> I recently started to use PyObjC 2.2 (after having use 1.4 for a long >> time), mainly for 64-bit support, and the biggest problem I have with >> it is bridge support's memory usage. One of my applications which used >> to use 22mb of memory on launch when built with pyobjc 1.4 used 48mb >> when built with pyobjc 2.2. > > Ouch. Can it be that a good part of this doubling in size is just from pointers going from 32 to 64bits? -- Leonardo Santagada santagada at gmail.com |
From: Ronald O. <ron...@ma...> - 2010-01-20 21:45:42
|
On 20 Jan, 2010, at 12:30, Virgil Dupras wrote: > Hi there, > > I recently started to use PyObjC 2.2 (after having use 1.4 for a long > time), mainly for 64-bit support, and the biggest problem I have with > it is bridge support's memory usage. One of my applications which used > to use 22mb of memory on launch when built with pyobjc 1.4 used 48mb > when built with pyobjc 2.2. Ouch. > > I have read that other thread about it and Ronald mentioned that this > was because of bridge support code which he didn't have enough time to > work on. I plan to try to tackle the issue soon and I'd appreciate > your feedback, Ronald, so I can know early if I'm just on a fool's > errand. I haven't had time yet to measure where memory is going, although I have done some micro-optimizations (such as making sure that all strings are interned). I'm currently working on a py3k port and some other changes, although much slower than I'd like. I haven't managed to spent more than on hour or two a week on PyObjC this year :-(. > > As a stopgap measure, I plan to simply clone the Cocoa and Foundation > packages and remove everything I don't use from the bridgeSupport xml > files. My guess is that it will greatly enhance loading speed and > memory usage since I only use a tiny fraction of Foundation and > AppKit. That would certainly help in the short term, but isn't a workable solution in the longer turn. > > Then, I noticed that Foundation and AppKit bridgesupport files are > huge, not really because there's a lot of symbols in them (there are, > however), but because the XML file format has so much redudancy in it > (For example, funtion arguments elements require way too much crap. > the types could be one string for 32 bit and one string for 64 bit > instead of being this long list of <arg> element). What I'm thinking > about is to convert those bridge support files to a more concise > format, maybe in YAML or something. This wouldn't help memory usage, > but it might help loading speed. I don't think that replacing the XML by an YAML file would help, unless there is a memory leak in the XML parsing code (and that should then be solved by fixing that memory leak). I am thinking of "compiling" the bridgesupport files into some other format though, such as a python or C file. That's mostly to get rid of the dependency on libxml, but could also help to reduce overhead (why parse an XML file when you can also load an .pyc file). Compiling into C would make it possible to create pre-constructed objects, at the cost of much greater coupling between pyobjc-core and the framework wrappers. That would only be useful when there is clear evidence that such a route could save a lot of memory and/or time. > > Last, the most important part of my super plan, would be smart > importers. I don't know much about them, but I keep seeing that Brett > Canon keeps writing article about custom imports and stuff. Maybe that > by using this, we could make PyObjC only load the requested elements. > If, for example, someone would type "from AppKit import symbol1, > symbol2" instead of "from AppKit import *", then only symbol1 and > symbol2 would be loaded from the bridge support. > > So, what do you think? Is that plan realistic, will there be a > show-stopper down the road? One problem with that is that the framework wrappers themself use 'from Foo import *' to ensure that imports behave simularly to ObjC includes. Changing that for most wrappers wouldn't be much of a problem, but it would be for a more complex one like the Quartz wrappers. We'll only know for sure once someone measures what's going on, but my gut feeling is that it is possible to reduce the amount of memory used by PyObjC and that it is also possible to reduce the amount of time that it takes to import a framework wrapper. BTW. One possible source of memory use is the proxy for NSString objects: for compatiblity with the rest of python that proxy is a subclass of Python's unicode type and therefore contains a copy of the content of the string (with 16-bits per character in the string regardless of how the string is represented in ObjC). BTW2. Measuring where memory has gone will be harder than I'd like due to Python's memory management routines: Python has its own malloc-like allocator which means that the Instruments won't be very helpfull to do the measurements. With some luck a Python build with '--without-pymalloc' still works... Ronald > -- > Virgil Dupras > Hardcoded Software > http://www.hardcoded.net > > ------------------------------------------------------------------------------ > Throughout its 18-year history, RSA Conference consistently attracts the > world's best and brightest in the field, creating opportunities for Conference > attendees to learn about information security's most important issues through > interactions with peers, luminaries and emerging and established companies. > http://p.sf.net/sfu/rsaconf-dev2dev > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
From: Mani G. <ma...@tu...> - 2010-01-20 16:01:22
|
Hi everyone, I have a couple hopefully simple questions about PyObjC, and would highly appreciate your responses! - If I build a (standard Xcode template) PyObjC app on a Leopard 10.5 machine (with all the system updates), would this app use the version of PyObjC installed on the build system (2.0), or would it use the version of PyObjC on the system it is being run on? i.e. PyObjC 2.2 on SL. - Is it safe to upgrade to PyObjC 2.2 on my Leopard machine (I'd like to do this to see if it resolves some serious memory leaks in my app)? If so, what is the correct way to do so? I have tried 'sudo easy_install pyobjc==2.2', to no avail, it keeps telling me to upgrade my version of setuptools to 0.6c7, when in fact I have 0.6c11 installed, and running easy_install -U setuptools doesn't resolve the issue (this is probably a bug). Thanks in advance, Mani |
From: Virgil D. <hs...@ha...> - 2010-01-20 11:58:34
|
Hi there, I recently started to use PyObjC 2.2 (after having use 1.4 for a long time), mainly for 64-bit support, and the biggest problem I have with it is bridge support's memory usage. One of my applications which used to use 22mb of memory on launch when built with pyobjc 1.4 used 48mb when built with pyobjc 2.2. I have read that other thread about it and Ronald mentioned that this was because of bridge support code which he didn't have enough time to work on. I plan to try to tackle the issue soon and I'd appreciate your feedback, Ronald, so I can know early if I'm just on a fool's errand. As a stopgap measure, I plan to simply clone the Cocoa and Foundation packages and remove everything I don't use from the bridgeSupport xml files. My guess is that it will greatly enhance loading speed and memory usage since I only use a tiny fraction of Foundation and AppKit. Then, I noticed that Foundation and AppKit bridgesupport files are huge, not really because there's a lot of symbols in them (there are, however), but because the XML file format has so much redudancy in it (For example, funtion arguments elements require way too much crap. the types could be one string for 32 bit and one string for 64 bit instead of being this long list of <arg> element). What I'm thinking about is to convert those bridge support files to a more concise format, maybe in YAML or something. This wouldn't help memory usage, but it might help loading speed. Last, the most important part of my super plan, would be smart importers. I don't know much about them, but I keep seeing that Brett Canon keeps writing article about custom imports and stuff. Maybe that by using this, we could make PyObjC only load the requested elements. If, for example, someone would type "from AppKit import symbol1, symbol2" instead of "from AppKit import *", then only symbol1 and symbol2 would be loaded from the bridge support. So, what do you think? Is that plan realistic, will there be a show-stopper down the road? -- Virgil Dupras Hardcoded Software http://www.hardcoded.net |
From: SourceForge.net <no...@so...> - 2010-01-18 02:05:03
|
Bugs item #2934055, was opened at 2010-01-18 02:05 Message generated for change (Tracker Item Submitted) made by glyf You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=114534&aid=2934055&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: Glyph Lefkowitz (glyf) Assigned to: Nobody/Anonymous (nobody) Summary: objc.inject no longer works Initial Comment: On both the version released with Snow Leopard and the current svn trunk, objc.inject results in the following traceback: File "<stdin>", line 1, in <module> File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC/objc/_functions.py", line 18, in inject raise NotImplementedError("objc.inject is only supported on Mac OS X 10.3 and later") NotImplementedError: objc.inject is only supported on Mac OS X 10.3 and later If there's still a way to get mach_inject working with an installed copy of pyobjc, then the traceback should tell you that; otherwise it should provide an explanation of the *real* reason that it's not supported, which I don't think is because I'm running MacOS X 10.2. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=114534&aid=2934055&group_id=14534 |
From: Orestis M. <or...@or...> - 2010-01-16 21:07:41
|
On 16 Jan 2010, at 22:28, Jep Hill wrote: > Hello everyone, > > I'm looking for a way to write custom metadata key/value pairs to a quicktime(object) via QTKit and python. > > Doing a 'help(QTKit.QTmovie)' I found several methods that appear to be promising: > > addUserData_ofType_() #<--- what are valid 'Types'? > > setUserData_ofType_() > setUserData_ofType_atIndex_() > > setAnnotation_ofType_() > setAnnotations_() > > setMovieAttributes_() > > > Can anyone shed light on the proper way to use these methods? Your best bet is to have a look at the QTMovie class reference: http://developer.apple.com/mac/library/documentation/QuickTime/Reference/QTKitFramework/Classes/QTMovie_Class/Reference/Reference.html It's a complicated beast, that's for sure. Orestis > > Very much appreciated, > Jep > ------------------------------------------------------------------------------ > Throughout its 18-year history, RSA Conference consistently attracts the > world's best and brightest in the field, creating opportunities for Conference > attendees to learn about information security's most important issues through > interactions with peers, luminaries and emerging and established companies. > http://p.sf.net/sfu/rsaconf-dev2dev > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
From: Jep H. <je...@gm...> - 2010-01-16 20:57:08
|
Great suggestion for a starting point to get more familiar with the QTMovie class. The items I asked about are actually not covered on that page — I'm secretly hoping they are used to get around the use of the metadata API. Regarding the valid Types, I think they *may* be referring to this: inDataType A data type from the following list: kQTMetaDataTypeBinary = 0, kQTMetaDataTypeUTF8 = 1, kQTMetaDataTypeUTF16BE = 2, kQTMetaDataTypeMacEncodedText = 3, kQTMetaDataTypeSignedIntegerBE = 21, kQTMetaDataTypeUnsignedIntegerBE = 22, kQTMetaDataTypeFloat32BE = 23, kQTMetaDataTypeFloat64BE = 24 (from: http://developer.apple.com/legacy/mac/library/documentation/QuickTime/Conceptual/QT7UpdateGuide/Chapter03/03QT7_Update_Guide.html#//apple_ref/doc/uid/TP40001163-CH314-BCIIDGHE) Thank you for the help. Jep On Jan 16, 2010, at 3:42 PM, Orestis Markou wrote: >> Doing a 'help(QTKit.QTmovie)' I found several methods that appear to be promising: >> >> addUserData_ofType_() #<--- what are valid 'Types'? >> >> setUserData_ofType_() >> setUserData_ofType_atIndex_() >> >> setAnnotation_ofType_() >> setAnnotations_() >> >> Can anyone shed light on the proper way to use these methods? > > Your best bet is to have a look at the QTMovie class reference: > http://developer.apple.com/mac/library/documentation/QuickTime/Reference/QTKitFramework/Classes/QTMovie_Class/Reference/Reference.html > > It's a complicated beast, that's for sure. > > Orestis |