pyobjc-dev Mailing List for PyObjC (Page 57)
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
|
|
From: Orestis M. <or...@or...> - 2008-09-23 17:26:55
|
Forwarding our conversation back to the list - don't forget to Reply to All next time, so people can search the archives! -- or...@or... http://orestis.gr/ Begin forwarded message: > From: Łukasz Dziedzic <dzi...@al...> > Date: 19 September 2008 19:23:47 BST > To: Orestis Markou <or...@or...> > Subject: Re: [Pyobjc-dev] How to translate from Obj-C? > > Thank you very much for help! > > Wil be back. Soon! > > Ł > > On Sep 19, 2008, at 1:16 AM, Orestis Markou wrote: > >> I think I've spotted something; sharedToolPaletteController is both >> an variable and a method. So while you set in the body of the class >> sharedToolPaletteController to be a class attribute, you then >> overwrite the name with a method. Changing it to something like >> that will work: >> >> class DFGlyphToolPaletteController(NSWindowController): >> >> _sharedToolPaletteController = None >> >> @classmethod >> def sharedToolPaletteController(cls): >> print "sharedToolPaletteController is", >> cls._sharedToolPaletteController >> if cls._sharedToolPaletteController is None: >> print "SHOUT IF HERE" #Never gets here! >> cls._sharedToolPaletteController = >> DFGlyphToolPaletteController.allocWithZone_(None).init() >> return cls._sharedToolPaletteController >> >> >> class DreamFontAppDelegate(NSObject): >> def showOrHideToolPalette_(self, sender): >> print "showOrHideToolPalette [" >> >> DFGlyphToolPaletteController >> .sharedToolPaletteController().showWindow_(None) >> print "] showOrHideToolPalette" >> >> >> Let me explain the error messages you got. >> >> sharedToolPaletteController is <selector >> sharedToolPaletteController of <objective-c class >> DFGlyphToolPaletteController at 0x1f06050>> >> >> This means that the name 'sharedToolPaletteController' in that >> scope is a "selector" (in python they are called methods) of that >> class. >> >> <type 'exceptions.AttributeError'>: 'objc.python_selector' object >> has no attribute 'showWindow_' >> >> This a standard error saying that the attribute you are trying to >> access (showWindow_) does not exist in that object. You could get >> the same error by trying to do: >> >> class MyClass(object): >> pass >> >> c = MyClass() >> print c.something #raises error >> >> Regarding your use of self, you are a bit confused :). Self is >> needed in class definitions, not in calls. Example: >> >> class MyClass(object): >> def a_method(self, argument): >> self.argument = argument >> print argument >> >> c = MyClass() >> c.a_method("hello world") # will print "hello world" >> print c.argument # likewise >> >> >> So you have to use self to attach and access attributes inside a >> class, but when you are using a class, you already have a name for >> it - in the previous example, "c" is that name. Inside a class >> definition, there is no such name, and this is why you use "self". >> Other languages (like C#) use something similar ("this", I think), >> but do not require it explicitly as Python does. It is one of these >> things that may be initially confusing, but very useful and clear >> in the long run. >> >> Cheers, >> Orestis >> -- >> or...@or... >> http://orestis.gr/ >> >> >> >> >> On 18 Sep 2008, at 23:23, Łukasz Dziedzic wrote: >> >>> Thanks a lot! >>> >>> On Sep 18, 2008, at 11:15 PM, Orestis Markou wrote: >>> >>>> I hope I'm not misleading you, but I think that since the method >>>> you're trying to translate is a "static" method, you have to >>>> change it to be a classmethod in python: >>>> >>>> class SKTToolPaletteController(object): >>>> sharedToolPaletteController = None #this is shared between all >>>> instances >>>> >>>> @classmethod # this allows you to call that on a class rather >>>> than the instance >>>> def sharedToolPaletteController(cls): >>>> if cls.sharedToolPaletteController is None: >>>> cls.sharedToolPaletteController = >>>> SKTToolPaletteController.allocWithZone_(None).init() >>>> return cls.sharedToolPaletteController >>>> >>>> Remember that in python there are no "global/static" attributes, >>>> so everything must be qualified. Hence the explicit "self" that >>>> points to the instance, and in the above code, the explicit >>>> "cls" (class is a keyword) that points to the class. >>>> >>>> I really suggest you learn a bit about Python, because you will >>>> always hit this kind of snags when trying to translate obj-c into >>>> it. There a few very good tutorials out there, pick one that you >>>> like and stick with it, I promise that you'll find Python very >>>> enjoyable. >>> >>> I FOUND Python enjoyable: I'm graphic designer, with no fluent >>> english and i wrote lots of macros in python, maybe not nice but >>> working. My problem is I don't understand some meanings, and i >>> have no programmers around to ask, so learning is bit painful. >>> Best way for me - by practice, step by step. Slowly, but works. >>> >>> >>> >>>> >>>> >>>> Hope that helped, >>> >>> I learned something! >>> but still doesn't work. This is what I have (names changed): >>> >>> class DFGlyphToolPaletteController(NSWindowController): >>> >>> sharedToolPaletteController = None >>> >>> @classmethod >>> def sharedToolPaletteController(cls): >>> print "sharedToolPaletteController is", >>> cls.sharedToolPaletteController >>> if cls.sharedToolPaletteController is None: >>> print "SHOUT IF HERE" #Never gets here! >>> cls.sharedToolPaletteController = >>> DFGlyphToolPaletteController.allocWithZone_(None).init() >>> return cls.sharedToolPaletteController >>> >>> >>> class DreamFontAppDelegate(NSObject): >>> def showOrHideToolPalette_(self, sender): >>> print "showOrHideToolPalette [" >>> >>> DFGlyphToolPaletteController >>> .sharedToolPaletteController().showWindow_(None) >>> print "] showOrHideToolPalette" >>> >>> causes error: >>> showOrHideToolPalette [ >>> sharedToolPaletteController is <selector >>> sharedToolPaletteController of <objective-c class >>> DFGlyphToolPaletteController at 0x1f06050>> >>> 2008-09-19 00:15:57.983 DreamFont[6700:10b] <type >>> 'exceptions.AttributeError'>: 'objc.python_selector' object has no >>> attribute 'showWindow_' >>> >>> because of selector I tried used .self... >>> >>> >>> DFGlyphToolPaletteController >>> .sharedToolPaletteController().self.showWindow_(None) >>> >>> Baaad.. >>> >>> 2008-09-19 00:20:10.814 DreamFont[6718:10b] <type >>> 'exceptions.TypeError'>: Expecting instance of NSWindowController >>> as self, got one of NoneType >>> >>> Where is a trick???? >>> >>> Ł >>> >>>> >>>> Orestis Markou >>>> >>>> -- >>>> or...@or... >>>> http://orestis.gr/ >>>> >>>> >>>> >>>> >>>> On 18 Sep 2008, at 22:05, Łukasz Dziedzic wrote: >>>> >>>>> Great! >>>>> >>>>> So I know now – first part in app delegate i translated well. >>>>> But I'm lost in SKTToolPaletteController. >>>>> >>>>> + (id)sharedToolPaletteController { >>>>> static SKTToolPaletteController *sharedToolPaletteController = >>>>> nil; >>>>> >>>>> if (!sharedToolPaletteController) { >>>>> sharedToolPaletteController = [[SKTToolPaletteController >>>>> allocWithZone:NULL] init]; >>>>> } >>>>> >>>>> return sharedToolPaletteController; >>>>> } >>>>> >>>>> My code: >>>>> >>>>> def sharedToolPaletteController(self): >>>>> #static? There is no static in Python, right? >>>>> sharedToolPaletteController = None >>>>> #next makes me no sense at all >>>>> if not sharedToolPaletteController: >>>>> sharedToolPaletteController = super(SKTToolPaletteController, >>>>> self).allocWithZone_(None).init(); >>>>> return sharedToolPaletteController >>>>> >>>>> But doesn't matter what inside def, could be just >>>>> print "whatever" >>>>> I have "error "<class 'objc.error'>: " always >>>>> >>>>> It must be some trick – when called >>>>> >>>>> SKTToolPaletteController >>>>> .alloc().sharedToolPaletteController().showOrHideWindow() >>>>> there where no error, but sense too. >>>>> >>>>> Completely lost, >>>>> >>>>> Ł >>>>> >>>>> On Sep 18, 2008, at 10:45 PM, Orestis Markou wrote: >>>>> >>>>>> #needed imports >>>>>> >>>>>> @IBaction >>>>>> def showOrHideToolPalette_(self, sender): >>>>>> SKTToolPaletteController >>>>>> .sharedToolPaletteController().showOrHideWindow() >>>>>> >>>>>> Don't forget that in python, every class method must have >>>>>> "self" as the first argument. Next time, please post your >>>>>> source code for whatever you've done, so we can look at that >>>>>> rather than trying to guess. >>>>>> >>>>>> Hope that helped, >>>>>> Orestis >>>>>> -- >>>>>> or...@or... >>>>>> http://orestis.gr/ >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> On 18 Sep 2008, at 19:34, Łukasz Dziedzic wrote: >>>>>> >>>>>>> Hi Everybody! >>>>>>> >>>>>>> I'm trying to do my own toolbox in IB. I'm watching carefully >>>>>>> Obj-C >>>>>>> example Sketch, and I found in app delegate: >>>>>>> >>>>>>>> - (IBAction)showOrHideToolPalette:(id)sender { >>>>>>>> >>>>>>>> // We always show the same tool palette panel. Its controller >>>>>>>> doesn't get deallocated when the user closes it. >>>>>>>> [[SKTToolPaletteController sharedToolPaletteController] >>>>>>>> showOrHideWindow]; >>>>>>>> >>>>>>>> } >>>>>>>> >>>>>>> >>>>>>> and in SKTToolPaletteController >>>>>>> >>>>>>>> + (id)sharedToolPaletteController { >>>>>>>> static SKTToolPaletteController *sharedToolPaletteController = >>>>>>>> nil; >>>>>>>> >>>>>>>> if (!sharedToolPaletteController) { >>>>>>>> sharedToolPaletteController = [[SKTToolPaletteController >>>>>>>> allocWithZone:NULL] init]; >>>>>>>> } >>>>>>>> >>>>>>>> return sharedToolPaletteController; >>>>>>>> } >>>>>>> >>>>>>> >>>>>>> All my attempts generates error "<class 'objc.error'>: need self >>>>>>> argument" :-( >>>>>>> >>>>>>> Could somebody help me? >>>>>>> >>>>>>> Ł >>>>>>> >>>>>>> >>>>>>> ------------------------------------------------------------------------- >>>>>>> This SF.Net email is sponsored by the Moblin Your Move >>>>>>> Developer's challenge >>>>>>> Build the coolest Linux based applications with Moblin SDK & >>>>>>> win great prizes >>>>>>> Grand prize is a trip for two to an Open Source event anywhere >>>>>>> in the world >>>>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >>>>>>> _______________________________________________ >>>>>>> Pyobjc-dev mailing list >>>>>>> Pyo...@li... >>>>>>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >>>>>> >>>>> >>>> >>> >> > |
|
From: s s <li...@in...> - 2008-09-22 18:58:45
|
I'm creating a class in Python, inheriting from an objc base class using NSClassFromString(). I can't seem to access IBOutlets or ivars defined in the base class directly. I can use objc.get/setInstanceVariable to get at the ivars but IB can't see the parent class IBOutlets at all even though, if I try to redefine them I get an error that they're already defined. Is there any reason I should have to use a function to get at the ivars defined in the objc parent class? I've not been using PyObjc lately but I don't remember this being an issue before. Clues? Thanks, Steve |
|
From: Jeremy R. <ja...@ja...> - 2008-09-18 14:28:16
|
I'm wondering if anyone has used pyobjc for creating or manipulating disk images. I assume that because the system's DiskImages.framework is in /System/Library/PrivateFrameworks that it's not a good idea to use it for an app/script. But, has anyone done something else for disk images with pyobjc? I think I'd rather go that route for an idea I have, if it's tenable, than calling the command line utility "hdiutil." Thanks! -- Jeremy |
|
From: Orestis M. <or...@or...> - 2008-09-18 13:45:29
|
#needed imports
@IBaction
def showOrHideToolPalette_(self, sender):
SKTToolPaletteController
.sharedToolPaletteController().showOrHideWindow()
Don't forget that in python, every class method must have "self" as
the first argument. Next time, please post your source code for
whatever you've done, so we can look at that rather than trying to
guess.
Hope that helped,
Orestis
--
or...@or...
http://orestis.gr/
On 18 Sep 2008, at 19:34, Łukasz Dziedzic wrote:
> Hi Everybody!
>
> I'm trying to do my own toolbox in IB. I'm watching carefully Obj-C
> example Sketch, and I found in app delegate:
>
>> - (IBAction)showOrHideToolPalette:(id)sender {
>>
>> // We always show the same tool palette panel. Its controller
>> doesn't get deallocated when the user closes it.
>> [[SKTToolPaletteController sharedToolPaletteController]
>> showOrHideWindow];
>>
>> }
>>
>
> and in SKTToolPaletteController
>
>> + (id)sharedToolPaletteController {
>> static SKTToolPaletteController *sharedToolPaletteController =
>> nil;
>>
>> if (!sharedToolPaletteController) {
>> sharedToolPaletteController = [[SKTToolPaletteController
>> allocWithZone:NULL] init];
>> }
>>
>> return sharedToolPaletteController;
>> }
>
>
> All my attempts generates error "<class 'objc.error'>: need self
> argument" :-(
>
> Could somebody help me?
>
> Ł
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win
> great prizes
> Grand prize is a trip for two to an Open Source event anywhere in
> the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Pyobjc-dev mailing list
> Pyo...@li...
> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev
|
|
From: Łukasz D. <dzi...@al...> - 2008-09-18 11:34:55
|
Hi Everybody!
I'm trying to do my own toolbox in IB. I'm watching carefully Obj-C
example Sketch, and I found in app delegate:
> - (IBAction)showOrHideToolPalette:(id)sender {
>
> // We always show the same tool palette panel. Its controller
> doesn't get deallocated when the user closes it.
> [[SKTToolPaletteController sharedToolPaletteController]
> showOrHideWindow];
>
> }
>
and in SKTToolPaletteController
> + (id)sharedToolPaletteController {
> static SKTToolPaletteController *sharedToolPaletteController =
> nil;
>
> if (!sharedToolPaletteController) {
> sharedToolPaletteController = [[SKTToolPaletteController
> allocWithZone:NULL] init];
> }
>
> return sharedToolPaletteController;
> }
All my attempts generates error "<class 'objc.error'>: need self
argument" :-(
Could somebody help me?
Ł
|
|
From: Orestis M. <or...@or...> - 2008-09-12 14:28:01
|
Once you run your compiled application once, python will compile everything down to .pyc and then you can delete .py files from the bundle. Not sure if this is the right approach, or if py2app can actually handle this for you. -- or...@or... http://orestis.gr/ On 12 Sep 2008, at 15:21, Łukasz Dziedzic wrote: > Hi! > > (sorry for english) > Is it possible to compile PyObjC project in XCode and hide/deattach > all source files inside .app? > > Ł > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win > great prizes > Grand prize is a trip for two to an Open Source event anywhere in > the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
|
From: Łukasz D. <dzi...@al...> - 2008-09-12 14:21:16
|
Hi! (sorry for english) Is it possible to compile PyObjC project in XCode and hide/deattach all source files inside .app? Ł |
|
From: Chris S. <cj...@uo...> - 2008-09-07 07:05:42
|
Hi All, i'm fairly new at PyObjC, so bear with me. I'm trying to search the local FS for files using an MSMetadataQuery object. I've been looking at the PredicateEditorSample here on pyobjc.sourceforge.net, which I have based alot (read: all :) ) of my code from. Heres some code from the class: class SystemBridge(NSObject): #deleted some stuff query = objc.ivar() #deleted some more stuff def newQuery_(self, _filename, _filetype): self.query = NSMetadataQuery.alloc().init() #Create a notification so we can see what is happening with the search nf = NSNotificationCenter.defaultCenter() nf.addObserver_selector_name_object_(self, 'queryNotification:', None, self.query) #Create the query self.query.setSortDescriptors_([NSSortDescriptor.alloc().initWithKey_ascending_('kMDItemDisplayName', True)]) self.query.setDelegate_(self) #########Set the predicate, having problems here? #thePredicate = NSPredicate.predicateWithFormat_("(kMDItemDisplayName LIKE[cd] 'preso*') && (kMDItemContentType LIKE[cd] 'com.apple.iwork.keynote.key')") thePredicate = NSPredicate.predicateWithFormat_("(kMDItemDisplayName = '*')") keynotePredicate = NSPredicate.predicateWithFormat_("(kMDItemContentType = 'com.apple.iwork.keynote.key')") #Try a compound out instead of one just one of the above... don't need to do this but I was experimenting predicate = NSCompoundPredicate.andPredicateWithSubpredicates_([keynotePredicate, thePredicate]) #Start the search self.query.setPredicate_(predicate) self.query.startQuery() return def queryNotification_(self, note): #Find the query status by looking at the note if note.name() == NSMetadataQueryDidStartGatheringNotification: print "Starting Search" elif note.name() == NSMetadataQueryDidFinishGatheringNotification: print "Search Finished" getQueryResults_(note) elif note.name() == NSMetadataQueryGatheringProgressNotification: print "Searching..." elif note.name() == NSMetadataQueryDidUpdateNotification: print "Found something" def getQueryResults_(self, notif): results = notif.object().results() NSLog("Search count = %d", len(results)) The weird thing is, i get zero search results. I can use the predicate from this in another application (the Fortunes app example) and it searches just fine, so i'm not so sure if it is my predicates causing the problem. Ouput: Starting Search And thats it. I'm expecting a count of the results, there are several files that start with 'preso' that are keynote files, but no luck. Any ideas would be appreciated! Thanks. |
|
From: Leonardo S. <san...@gm...> - 2008-09-07 01:52:06
|
I just want to understand why there is no package for pyobjc 2? I tried to build it for python.org python 2.5.2 but after building it fail some tests so maybe i'm doing something wrong. -- Leonardo Santagada |
|
From: Nicolas R. <Nic...@lr...> - 2008-09-04 10:15:58
|
Hi,
Playing with CFRunLoops in python, I came across the following problem:
from CoreFoundation import *
s = CFSocketCreateWithNative(kCFAllocatorDefault, 0, 0, 0, 0)
Traceback (most recent call last):
File "/Users/roussel/Desktop/a.py", line 5, in <module>
s = CFSocketCreateWithNative(kCFAllocatorDefault, 0, 0, 0, 0)
internal_error: PyObjCRT_AlignOfType: Unhandled type '3f' ?
Note that this problem also happens when passing a callback as 4th
argument and/or a CFSocketContext as 5th argument.
All the arguments in the example above seem valid from a PyObjC point
of view, as far as I can tell from
CFSocketCreateWithNative.__metadata__(). I don't understand, however,
why there's a reference to CFXMLParserContext:
{
'retval': {'null_accepted': True, 'already_retained': True, 'type':
'^{__CFSocket=}', 'already_cfretained': False},
'arguments': (
{'null_accepted': True, 'already_retained': False, 'type':
'^{__CFAllocator=}', 'already_cfretained': False},
{'already_retained': False, 'type': 'i', 'already_cfretained':
False},
{'already_retained': False, 'type': 'L', 'already_cfretained':
False},
{'null_accepted': True, 'already_cfretained': False,
'callable': {'retval': {'already_retained': False, 'type': 'v',
'already_cfretained': False}, 'arguments': ({'null_accepted': True,
'already_retained': False, 'type': '^{__CFSocket=}',
'already_cfretained': False}, {'already_retained': False, 'type': 'L',
'already_cfretained': False}, {'null_accepted': True,
'already_retained': False, 'type': '^{__CFData=}',
'already_cfretained': False}, {'null_accepted': True,
'already_retained': False, 'type': '^v', 'already_cfretained': False},
{'null_accepted': True, 'already_retained': False, 'type': '^v',
'already_cfretained': False}), 'variadic': False}, 'already_retained':
False, 'type': 'n^?', 'callable_retained': True},
{'null_accepted': True, 'already_retained': False, 'type':
'n^{_CFXMLParserContext=i^v^?^?^?}', 'already_cfretained': False}
),
'variadic': False
}
The code in objc_support.m didn't help me understand all this...
Can someone explain how I can fix this and use CFSocketCreateWithNative?
Nicolas
---
Nicolas Roussel http://insitu.lri.fr/~roussel/
In Situ, Univ. Paris-Sud (LRI) & INRIA Saclay - Île-de-France
|
|
From: SourceForge.net <no...@so...> - 2008-08-27 22:59:53
|
Bugs item #2079347, was opened at 2008-08-27 19:00 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=114534&aid=2079347&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: doug (dougfritz) Assigned to: Nobody/Anonymous (nobody) Summary: no transform or sublayerTransform wrapping in CALayer Initial Comment: no transform or sublayerTransform wrapping in CALayer there is currently no way to set those properties in CALayer The closest one can do is use setAffineTransform and AffineTransforms can at times be nonequivalent to CATransforms ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=114534&aid=2079347&group_id=14534 |
|
From: Barry W. <bar...@gm...> - 2008-08-21 16:18:09
|
On Thu, Aug 21, 2008 at 8:13 AM, Ronald Oussoren <ron...@ma...> wrote: > > On 21 Aug, 2008, at 13:31, s s wrote: > >> >> On Aug 21, 2008, at 7:02 AM, Ronald Oussoren wrote: >> >>> The main problem at the moment is PyObjC: the code supports 4-way >>> builds (or rather, 3-way builds, libffi is broken on PPC64), but >>> the repository is not as stable as it should be. I want to do a >>> proper release of PyObjC, but progress is going very slowly at the >>> moment due to lack of time and due to the general suckiness of the >>> work that IMO must be done before a next release. >> >> Sorry if this is obvious but is there a list of these generally >> sucky parts? > > The most important things that should be done for PyObjC itself: > > 1) Modernize all sample projects. > > A signficant subset of the examples in the repository still use > PyObjCTools.NibClassBuilder. That module is deprecated and shouldn't > be used in new code (and doesn't work with IB3 at all), all examples > should be modified to work without NibClassBuilder. This means: > > - Add explicit base classes instead of NibClassBuilder.AutoBaseClass > - Add outlet definitions (objc.IBOutlet definitions) > - Add @objc.IBAction decorator to actions (needed for IB3) > > All examples should have a "readme.txt" and a "summary.txt", the > latter is used on the website in the list of examples. > > 2) There are a number of examples in the pyobjc-core project, those > should be moved to the most appropriate pyobjc-framework-* framework > wrapper > > 3) IMHO there should be sample code for all wrapped framework, if only > be translating an existing (Objective-)C example > > 4) All metadata (bridgesupport files) should be verified, see below > > 5) (very hard): Libffi is broken on PPC64 > > To be precise: the basic functionality works, but calls through libffi > break Objective-C exception handling. This totally breaks PyObjC and > fixing that probably requires help from a compiler guru. My gut > fealing is to ignore PPC64, fixing libffi is too much of an effort. > > 6) Port PyObjC to OSX 10.4. This should be fairly easy once step 4 is > finished, the code already contains the hooks that are necessary for > this port and has worked on 10.4 in the past. > > 7) Move pyobjc-core/Lib/objc/test to pyobjc-core/PyObjCTest. > > I've already moved the tests for framework wrappers out of the package > that is installed by distutils, the same should be done for pyobjc- > core. This can wait until a later release. > > > Py2app also needs some loving (proper egg support, testsuite), but > that can wait until after a release of PyObjC itself. > >> >> >>> I'm very, very slowly adding unittests for all global functions, >>> and other interesting items, in wrapped frameworks because that's >>> the only way to be sure that the wrappers work as advertised. I'm >>> also working on my own copy of the bridgesupport files that Apple >>> ships with Leopard, mostly because I ran into several issues with >>> those files and would prefer shipping my own, correct, version of >>> the metadata files rather than trying to work around the issues in >>> Apple's build. >>> >>> Writing these tests takes quite a lot of time and is not >>> intellectually rewarding, which results in slow progress. >> >> Again, is there a list? I could put in a bit of time on some of the >> mechanical tests if I had a place to find the checklist. > > There is no list, at least not outside of my head. > > I've just commited the current state of the tests for the Cocoa > frameworks, see > <https://svn.red-bean.com/pyobjc/trunk/pyobjc/pyobjc-framework-Cocoa/PyObjCTest/ > >. > > Adding tests for other frameworks should be a lot easier, most of them > should contain almost no entities for which tests are needed. > > I'd like to see tests for all: > * C functions (CGContextCreate, ...) > * All structs: are the right fields present > * All methods that have a custom wrapper (that is, anything with a > manually written wrapper in the Modules directory) > * All methods with pointer arguments > > The tests should check if the Python wrapper works and has the right > interface (as described in the PyObjC intro.txt document). Testing if > the framework functions correctly is not a goal, unless a OS bug > affects the functioning of PyObjC itself. > > During this task we might run into API's that we don't want to > support, or cannnot support, in Python. Those should be documented. > > I'm currently also adding tests that check the presence of global > variables (and values of enums), but those are less important. Could any of the testing gurus suggest a strategy for testing the regression described at http://sourceforge.net/tracker/index.php?func=detail&aid=1982104&group_id=14534&atid=114534? I would be happy to add a test for this regression so that it can (hopefully) be fixed in the future, but admit to being a bit stumped on where to start. I do have a demo app that exhibits the regression behavior. This regression forced us to rewrite a bunch of python plugins in Objective-C and I would really like to help get it fixed in future versions of pyobjc. Thanks, Barry > > Ronald > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > |
|
From: Ronald O. <ron...@ma...> - 2008-08-21 12:13:45
|
On 21 Aug, 2008, at 13:31, s s wrote: > > On Aug 21, 2008, at 7:02 AM, Ronald Oussoren wrote: > >> The main problem at the moment is PyObjC: the code supports 4-way >> builds (or rather, 3-way builds, libffi is broken on PPC64), but >> the repository is not as stable as it should be. I want to do a >> proper release of PyObjC, but progress is going very slowly at the >> moment due to lack of time and due to the general suckiness of the >> work that IMO must be done before a next release. > > Sorry if this is obvious but is there a list of these generally > sucky parts? The most important things that should be done for PyObjC itself: 1) Modernize all sample projects. A signficant subset of the examples in the repository still use PyObjCTools.NibClassBuilder. That module is deprecated and shouldn't be used in new code (and doesn't work with IB3 at all), all examples should be modified to work without NibClassBuilder. This means: - Add explicit base classes instead of NibClassBuilder.AutoBaseClass - Add outlet definitions (objc.IBOutlet definitions) - Add @objc.IBAction decorator to actions (needed for IB3) All examples should have a "readme.txt" and a "summary.txt", the latter is used on the website in the list of examples. 2) There are a number of examples in the pyobjc-core project, those should be moved to the most appropriate pyobjc-framework-* framework wrapper 3) IMHO there should be sample code for all wrapped framework, if only be translating an existing (Objective-)C example 4) All metadata (bridgesupport files) should be verified, see below 5) (very hard): Libffi is broken on PPC64 To be precise: the basic functionality works, but calls through libffi break Objective-C exception handling. This totally breaks PyObjC and fixing that probably requires help from a compiler guru. My gut fealing is to ignore PPC64, fixing libffi is too much of an effort. 6) Port PyObjC to OSX 10.4. This should be fairly easy once step 4 is finished, the code already contains the hooks that are necessary for this port and has worked on 10.4 in the past. 7) Move pyobjc-core/Lib/objc/test to pyobjc-core/PyObjCTest. I've already moved the tests for framework wrappers out of the package that is installed by distutils, the same should be done for pyobjc- core. This can wait until a later release. Py2app also needs some loving (proper egg support, testsuite), but that can wait until after a release of PyObjC itself. > > >> I'm very, very slowly adding unittests for all global functions, >> and other interesting items, in wrapped frameworks because that's >> the only way to be sure that the wrappers work as advertised. I'm >> also working on my own copy of the bridgesupport files that Apple >> ships with Leopard, mostly because I ran into several issues with >> those files and would prefer shipping my own, correct, version of >> the metadata files rather than trying to work around the issues in >> Apple's build. >> >> Writing these tests takes quite a lot of time and is not >> intellectually rewarding, which results in slow progress. > > Again, is there a list? I could put in a bit of time on some of the > mechanical tests if I had a place to find the checklist. There is no list, at least not outside of my head. I've just commited the current state of the tests for the Cocoa frameworks, see <https://svn.red-bean.com/pyobjc/trunk/pyobjc/pyobjc-framework-Cocoa/PyObjCTest/ >. Adding tests for other frameworks should be a lot easier, most of them should contain almost no entities for which tests are needed. I'd like to see tests for all: * C functions (CGContextCreate, ...) * All structs: are the right fields present * All methods that have a custom wrapper (that is, anything with a manually written wrapper in the Modules directory) * All methods with pointer arguments The tests should check if the Python wrapper works and has the right interface (as described in the PyObjC intro.txt document). Testing if the framework functions correctly is not a goal, unless a OS bug affects the functioning of PyObjC itself. During this task we might run into API's that we don't want to support, or cannnot support, in Python. Those should be documented. I'm currently also adding tests that check the presence of global variables (and values of enums), but those are less important. Ronald |
|
From: Dean S. <dea...@gm...> - 2008-08-16 22:35:34
|
Hello folks, I hope this is the appropriate list for such an inquiry. . .I'm having trouble installing pyobjc on one of my macs (intel mac mini w/ tiger). Didn't have the same problem on a macbook pro (w/ tiger). When I run: python setup.py bdist_mpkg --open Thing truck along as usual and then I get the following error message: writing entry points to Lib/pyobjc.egg-info/entry_points.txt Traceback (most recent call last): File "setup.py", line 755, in ? dependency_links = [], File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/distutils/core.py", line 149, in setup dist.run_commands() File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/distutils/dist.py", line 907, in run_commands self.run_command(cmd) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/distutils/dist.py", line 927, in run_command cmd_obj.run() File "build/bdist.darwin-8.9.1-i386/egg/bdist_mpkg/cmd_bdist_mpkg.py", line 420, in run File "build/bdist.darwin-8.9.1-i386/egg/bdist_mpkg/cmd_bdist_mpkg.py", line 261, in run_install File "build/bdist.linux-i686/egg/setuptools/command/install.py", line 56, in run File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/distutils/command/install.py", line 510, in run self.run_command(cmd_name) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/distutils/cmd.py", line 333, in run_command self.distribution.run_command(command) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/distutils/dist.py", line 927, in run_command cmd_obj.run() File "build/bdist.linux-i686/egg/setuptools/command/install_egg_info.py", line 29, in run File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/distutils/cmd.py", line 333, in run_command self.distribution.run_command(command) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/distutils/dist.py", line 927, in run_command cmd_obj.run() File "build/bdist.linux-i686/egg/setuptools/command/egg_info.py", line 171, in run File "build/bdist.linux-i686/egg/setuptools/command/egg_info.py", line 252, in find_sources File "build/bdist.linux-i686/egg/setuptools/command/egg_info.py", line 306, in run File "build/bdist.linux-i686/egg/setuptools/command/egg_info.py", line 333, in add_defaults File "build/bdist.linux-i686/egg/setuptools/command/sdist.py", line 45, in walk_revctrl File "build/bdist.linux-i686/egg/setuptools/command/sdist.py", line 52, in _default_revctrl File "build/bdist.linux-i686/egg/setuptools/command/sdist.py", line 98, in entries_finder NameError: global name 'log' is not defined I'm running python v2.3.5 (exactly the same version I'm running on the working computer.) Can anyone help? Thanks!! Dean |
|
From: Daniel A. <an...@cc...> - 2008-08-11 23:47:50
|
Indeed, that's the problem. When QTKit imported, I get both /Library/Frameworks/Python.framework/Versions/2.5/Python /System/Library/Frameworks/Python.framework/Versions/2.5/Python but without it, just the first one. What's the best method of preventing the double-load? Thanks, dan Jack Jansen wrote: > > On 11-Aug-2008, at 19:31 , Daniel Ashbrook wrote: > >> When I try to import QTKit and build and run my app, I get "Fatal Python >> error: Interpreter not initialized (version mismatch?)". Any ideas? > > One thing that could cause this is pulling in two different copies of > Python (the second one will be uninitialized and give that error). > > Try running from the command line, with DYLD_PRINT_LIBRARIES=1 in the > environment. This will print all dynamic libraries as they are loaded. > Then simply look through the output to see whether there's two Pythons > loaded. > > > > -- > > Jack Jansen, <Jac...@cw...>, http://www.cwi.nl/~jack > > If I can't dance I don't want to be part of your revolution -- Emma Goldman > > > |
|
From: Jack J. <Jac...@cw...> - 2008-08-11 21:01:12
|
On 11-Aug-2008, at 19:31 , Daniel Ashbrook wrote: > When I try to import QTKit and build and run my app, I get "Fatal > Python > error: Interpreter not initialized (version mismatch?)". Any ideas? One thing that could cause this is pulling in two different copies of Python (the second one will be uninitialized and give that error). Try running from the command line, with DYLD_PRINT_LIBRARIES=1 in the environment. This will print all dynamic libraries as they are loaded. Then simply look through the output to see whether there's two Pythons loaded. -- Jack Jansen, <Jac...@cw...>, http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman |
|
From: Daniel A. <an...@cc...> - 2008-08-11 17:31:13
|
When I try to import QTKit and build and run my app, I get "Fatal Python error: Interpreter not initialized (version mismatch?)". Any ideas? dan |
|
From: Orestis M. <or...@or...> - 2008-07-19 13:20:27
|
Hi Craig, I've responsed in the Python-Mac list as well, I'm just copying the message if anybody else is interested. The online Apple tutorials *are* outdated, but the bundled examples are not. You can have a look here: http://orestis.gr/en/blog/2008/05/17/pyobjc-hello-world/ and download the project. As I've said, you don't have to use Obj-C, you can do 99% of your development in PyObjC. Interface Builder will pick up your outlets/actions, if you have Xcode open. You can define an external editor if you don't like editing in XCode. Regards, -- Orestis Markou or...@or... http://orestis.gr/ On 18 Ιουλ 2008, at 4:58 ΜΜ, Craig Marshall wrote: > Hi - I'm new here, > > I'm not sure this is the correct place to ask the following question, > if it's not, apologies - please let me know and I'll ask elsewhere. > > Here's the tutorial I'm talking about: > http://pyobjc.sourceforge.net/documentation/pyobjc-core/tutorial/index.html > > I'm getting stuck at the step that says "Proceed with the instructions > as lined out in Apple's Developing Cocoa Objective-C Applications: a > Tutorial, chapter 3, just ..." > > It links to an apple cocoa tutorial which seems to have been heavily > updated since the pyobjc tutorial was written. I don't quite know > which sections I'm supposed to follow. Specifically, I don't know how > to link up / define the object "outlets". I'm thinking that I've got > to open up Xcode and delve into Obj-C (which is don't want to do, > hence the usage of pyobjc)... > > I hope this makes sense and that someone can help me. > > Thanks, > Craig Marshall > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win > great prizes > Grand prize is a trip for two to an Open Source event anywhere in > the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
|
From: s s <li...@in...> - 2008-07-18 16:09:25
|
Is the output possibly being done in a thread?
S
On Jul 18, 2008, at 11:18 AM, Nathan wrote:
> On Thu, Jul 17, 2008 at 8:06 AM, post <po...@ty...> wrote:
>> hi
>>
>> i want to be able to see a direct update of the log in console.app
>> when I "print 'something'" in my app.
>> The print statement only appears in console after i quit my app.
>> I also tried NSLog("something") but that also appears after I quit my
>> app.
>> Im using the 10.5 python.
>>
>> is there a way to see the print statement directly into the console?
>> thanks
>
> Have you tried sys.stdout.flush() after your print statements? (Just
> throwing out ideas...)
>
> ~ Nathan
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win
> great prizes
> Grand prize is a trip for two to an Open Source event anywhere in
> the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Pyobjc-dev mailing list
> Pyo...@li...
> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev
|
|
From: Craig M. <cr...@gm...> - 2008-07-18 16:05:40
|
Hi - I'm new here, I'm not sure this is the correct place to ask the following question, if it's not, apologies - please let me know and I'll ask elsewhere. Here's the tutorial I'm talking about: http://pyobjc.sourceforge.net/documentation/pyobjc-core/tutorial/index.html I'm getting stuck at the step that says "Proceed with the instructions as lined out in Apple's Developing Cocoa Objective-C Applications: a Tutorial, chapter 3, just ..." It links to an apple cocoa tutorial which seems to have been heavily updated since the pyobjc tutorial was written. I don't quite know which sections I'm supposed to follow. Specifically, I don't know how to link up / define the object "outlets". I'm thinking that I've got to open up Xcode and delve into Obj-C (which is don't want to do, hence the usage of pyobjc)... I hope this makes sense and that someone can help me. Thanks, Craig Marshall |
|
From: Nathan <nat...@gm...> - 2008-07-18 15:18:09
|
On Thu, Jul 17, 2008 at 8:06 AM, post <po...@ty...> wrote:
> hi
>
> i want to be able to see a direct update of the log in console.app
> when I "print 'something'" in my app.
> The print statement only appears in console after i quit my app.
> I also tried NSLog("something") but that also appears after I quit my
> app.
> Im using the 10.5 python.
>
> is there a way to see the print statement directly into the console?
> thanks
Have you tried sys.stdout.flush() after your print statements? (Just
throwing out ideas...)
~ Nathan
|
|
From: Orestis M. <or...@or...> - 2008-07-17 17:22:55
|
This should work as expected. Could you give more information about pyobjc
version, python version, any weird thing you might be doing :)?
Regards,
Orestis Markou
On Thu, Jul 17, 2008 at 3:06 PM, post <po...@ty...> wrote:
> hi
>
> i want to be able to see a direct update of the log in console.app
> when I "print 'something'" in my app.
> The print statement only appears in console after i quit my app.
> I also tried NSLog("something") but that also appears after I quit my
> app.
> Im using the 10.5 python.
>
> is there a way to see the print statement directly into the console?
> thanks
>
>
> gr Frederik
> www.typemytype.com
>
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Pyobjc-dev mailing list
> Pyo...@li...
> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev
>
--
Orestis Markou
or...@or...
http://orestis.gr
|
|
From: post <po...@ty...> - 2008-07-17 14:06:35
|
hi
i want to be able to see a direct update of the log in console.app
when I "print 'something'" in my app.
The print statement only appears in console after i quit my app.
I also tried NSLog("something") but that also appears after I quit my
app.
Im using the 10.5 python.
is there a way to see the print statement directly into the console?
thanks
gr Frederik
www.typemytype.com
|
|
From: David B. <db3...@gm...> - 2008-07-07 19:48:10
|
John Velman <ve...@co...> writes: > 1. Which is better to use for the sqlite interface, the Xcode interface to > sqlite, or the Python interface? If Xcode is better, how the heck can I > find some documentation? Googling or searching in the developer > documentation hasn't gotten me there yet. Probably because I don't know > the right search words. The amount of Apple documentation is enormous. Personally I use SQLAlchemy with a sqlite back-end - e.g., stay completely on the Python side of the equation for data management. For my application I didn't need any of the ORM features, so I'm just using the SQL generation layer of SQLAlchemy, but it's great for that. > 2. For display of tabular query results, is NSTableView the "best" way to > go? I've had a quick scan of the "Understanding the NSTableView Class, > and a look at one of the examples, and I'm overwhelmed. I don't need to > edit this in place. One alternative would appear to be formatting into > columns in Python, and use some form of NSBrowser or NSTextView. NSTableView is definitely my workhorse for presenting tabular information, even if only a single column. You just get too much behavior for free not to use it IMO. In terms of controlling the data flow, I've actually used multiple methods: First, I started out enamoured with data bindings, and used them a lot, even for an array source to a data controller driving an NSTableView. Re-assigning the entire array (to trigger the automatic PyObjC binding update) was sometimes a pain, particularly when I had other state in the array I wanted to keep, so in some cases I started controlling the notification myself, permitting mutation in place of the data - e.g., I called willChangeValueForKey_, then modified, then called didChangeValueForKey_). But as I went on, I found that although there was slightly more setup, creating an appropriate data source for the NSTableView was more flexible, particularly as the data changed, or if it was being retrieved incrementally, such as from the network or database. I still have a mixture of approaches in the main application I used this with, but if I were starting over, I'd probably use bindings for simple text fields and status information, but stick with data sources for the major table views. -- David |
|
From: John V. <ve...@co...> - 2008-07-06 22:20:28
|
On Sat, Jul 05, 2008 at 01:42:04PM -0700, Samantha Atkins wrote: > --snip-- > > Core Data is a general "document" / application data store Cocoa framework. > It covers both flat flie, XML and sqlite stores. Its API is the same on > all. Among other things this means that some capabilities of a RDBMS are > not exposed by Core Data. Core Data is more or less an ORM or rather an > OSM where the S is more generic store than just relational. As such it > imposes its own layout to the underlying sqlite tables to support a subset > of object persistence. I would not recommend that you programs attempt to > grok and correctly handle that layout directly. Instead for a Core Data > database you should use the Core Data framework from pyobjc. There are > some shortcuts that get around some of the Xcode and application centric > docs on Core Data. For one thing there is a "MOM" file for any Core Data > database and Core Data APIs that you can use to dynamically read a MOM, > parse out the types of Entities and Relationships and then go from there to > read any data in the Core Data db and show it any way you want. > > Hope that helps. Thanks, Samantha. This is a help. Best, John V. |