pyobjc-dev Mailing List for PyObjC (Page 188)
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: Winston W. <cj...@ob...> - 2004-05-08 05:59:04
|
That's one thing I don't understand. In Obj C, I would call [NSBundle loadNibNamed: "myModelPanel owner: self] and this will connect 'self' to the outlets and actions for the nib. I.e. 'self' is the owner of the NIB. But with Python, you don't specify any owner. How do you choose which object gets to be the owner of the NIB file? For example, if I have: NibClassBuilder.extractClasses("MyModalPanel") myModal = MyModalPanel.alloc().init() Now MyModelPanel is a NIB file which specifies a MyModelPanelController object. So when the NIB file is unfrozen, it will create an instance of MyModelPanelController. First of all, where exactly is the NIB file unfrozen? Is it in extractClasses() or in MyModelPanel.alloc().init()? Second, how do I get a reference to MyModelPanelController? Normally I would say you attach it to an outlet of the NIB File's Owner, but where do I get a reference to the Owner? Does this make any sense? -winston On May 7, 2004, at 8:07 PM, b.bum wrote: > On May 7, 2004, at 7:06 PM, Bob Ippolito wrote: >> The showMyModalPanel looks suspicious otherwise, because if this is >> something coming from interface builder with outlets and such then >> you shouldn't be creating the objects yourself, they should be coming >> from the nib. > > In this case, I think the problem is that the second NIB file isn't > actually loaded (unless there is some code missing). > > The line of code that reads.... > >> NibClassBuilder.extractClasses("MyModalPanel") > > ... doesn't actually load the NIB itself, it just makes sure the > various classes found in the NIB are defined within the runtime. > > You will still need something like... > > if not NSBundle.loadNibNamed_owner_("MyModalPanel", self): > print "nib loading error" > > ... which is the normal Cocoa way of loading NIBs and lets you load > the NIB multiple times if you need to display multiple instances of > the NIBs contents (multiple document applications work this way). > > What Bob said about calling init() does definitely hold. If you are > just doing alloc().init(), I would recommend simply using new() to > minimize code and confusion: > > foo = MyClass.new() # same as foo = MyClass.alloc().init() > > b.bum > > > > ------------------------------------------------------- > This SF.Net email is sponsored by Sleepycat Software > Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to > deliver > higher performing products faster, at low TCO. > http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3 > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
From: b.bum <bb...@ma...> - 2004-05-08 03:07:33
|
On May 7, 2004, at 7:06 PM, Bob Ippolito wrote: > The showMyModalPanel looks suspicious otherwise, because if this is > something coming from interface builder with outlets and such then you > shouldn't be creating the objects yourself, they should be coming from > the nib. In this case, I think the problem is that the second NIB file isn't actually loaded (unless there is some code missing). The line of code that reads.... > NibClassBuilder.extractClasses("MyModalPanel") ... doesn't actually load the NIB itself, it just makes sure the various classes found in the NIB are defined within the runtime. You will still need something like... if not NSBundle.loadNibNamed_owner_("MyModalPanel", self): print "nib loading error" ... which is the normal Cocoa way of loading NIBs and lets you load the NIB multiple times if you need to display multiple instances of the NIBs contents (multiple document applications work this way). What Bob said about calling init() does definitely hold. If you are just doing alloc().init(), I would recommend simply using new() to minimize code and confusion: foo = MyClass.new() # same as foo = MyClass.alloc().init() b.bum |
From: Bob I. <bo...@re...> - 2004-05-08 02:07:11
|
I'm not sure. That code is not correct. You can't do this: myModal = MyModalPanel.alloc() myModal.init() You must do this instead: myModal = MyModalPanel.alloc().init() Or this: myModal = MyModalPanel.alloc() myModal = myModal.init() This shouldn't be unfamiliar, this is how ObjC typically works too. The showMyModalPanel looks suspicious otherwise, because if this is something coming from interface builder with outlets and such then you shouldn't be creating the objects yourself, they should be coming from the nib. Otherwise you should produce a minimal example and one of us will take a look at it. If this is a bug, then it may already be fixed as there have been a lot of changes recently, and there is a release right around the corner. -bob On May 7, 2004, at 9:27 PM, Winston Wolff wrote: > Has anybody responded to this? I'm having the same problem. > > -winston > >> I"m trying to set up a second NIB for a modal dialog to display >> progress >> while my application does some processing in my Mac OS X app. We >> are using >> Python 2.3 with PyObjC 1.1b1. However, the "magic" that loads the >> classes >> from the NIB file doesn"t seem to work for me. (That"s the problem >> with >> magic - it is somewhat obscure 8-) ). My guess is that I"m missing >> some >> important step, but I can"t figure out what it is and I don"t see an >> example >> that covers this. >> >> In my main application, when it is time to show the modal dialog, I >> have: >> >> from mymodalpanelclass import MyModalPanel >> >> def showMyModalPanel(self): >> myModal = MyModalPanel.alloc() >> myModal.init() >> myModal.showDialog(application) >> while <more-work-to-do>: >> <do-some-work> >> myModal.runDialog() >> myModal.closeDialog() >> >> In a secondary NIB file called "MyModalPanel.nib" I created an >> NSPanel >> window, set the class of "File"s Owner" to MyModalPanelController, >> created >> an outlet "myModalPanel" and connected it to the NSPanel window. >> >> In the file that implements MyModalPanel, I have: >> >> from PyObjCTools import NibClassBuilder >> NibClassBuilder.extractClasses("MyModalPanel") >> >> class MyModalPanelController(NibClassBuilder.AutoBaseClass): >> # the actual base class is NSObject >> # the following outlets are added to the class: >> # myModalPanel >> >> def showDialog(self, application): >> self.application = application >> self.myModalPanel.setWorksWhenModal(True) >> self._modalSession = >> self.application.beginModalSessionForWindow_(self.myModalPanel) >> >> def closeDialog(self): >> self.application.endModalSession_(self._modalSession) >> >> def runDialog(self): >> self.application.runModalSession_(self._modalSession) >> >> However, when I run this code, I find that self.myModalPanel is None >> and of >> course, nothing works. My impression was that the Panel would be >> created >> automatically when I created the MyModalPanelController instance. >> What do I >> need to do to get the NSPanel created? |
From: Winston W. <cj...@ob...> - 2004-05-08 01:27:51
|
Has anybody responded to this? I'm having the same problem. -winston > I"m trying to set up a second NIB for a modal dialog to display > progress > while my application does some processing in my Mac OS X app. We are > using > Python 2.3 with PyObjC 1.1b1. However, the "magic" that loads the > classes > from the NIB file doesn"t seem to work for me. (That"s the problem > with > magic - it is somewhat obscure 8-) ). My guess is that I"m missing > some > important step, but I can"t figure out what it is and I don"t see an > example > that covers this. > > In my main application, when it is time to show the modal dialog, I > have: > > from mymodalpanelclass import MyModalPanel > > def showMyModalPanel(self): > myModal = MyModalPanel.alloc() > myModal.init() > myModal.showDialog(application) > while <more-work-to-do>: > <do-some-work> > myModal.runDialog() > myModal.closeDialog() > > In a secondary NIB file called "MyModalPanel.nib" I created an NSPanel > window, set the class of "File"s Owner" to MyModalPanelController, > created > an outlet "myModalPanel" and connected it to the NSPanel window. > > In the file that implements MyModalPanel, I have: > > from PyObjCTools import NibClassBuilder > NibClassBuilder.extractClasses("MyModalPanel") > > class MyModalPanelController(NibClassBuilder.AutoBaseClass): > # the actual base class is NSObject > # the following outlets are added to the class: > # myModalPanel > > def showDialog(self, application): > self.application = application > self.myModalPanel.setWorksWhenModal(True) > self._modalSession = > self.application.beginModalSessionForWindow_(self.myModalPanel) > > def closeDialog(self): > self.application.endModalSession_(self._modalSession) > > def runDialog(self): > self.application.runModalSession_(self._modalSession) > > However, when I run this code, I find that self.myModalPanel is None > and of > course, nothing works. My impression was that the Panel would be > created > automatically when I created the MyModalPanelController instance. > What do I > need to do to get the NSPanel created? > > Thanks! > - Bob |
From: b.bum <bb...@ma...> - 2004-05-05 18:17:50
|
On May 5, 2004, at 11:13 AM, Ronald Oussoren wrote: > I'm going to look at your patch, it probably saner than assuming that > all methods whose name starts with init followed by an uppercase > letter (or whose name is init) are initializers. +1 |
From: Ronald O. <ron...@ma...> - 2004-05-05 18:13:11
|
On 5-mei-04, at 19:55, Bob Ippolito wrote: > Update of /cvsroot/pyobjc/pyobjc/Lib/objc/test > In directory > sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9036/Lib/objc/test > > Modified Files: > test_keyvalue.py > Log Message: > Contrive a bizarre really hard to debug situation that works with the > new > initializer pattern but not the old. > > p.s. Ronald, turn on -O0 before even trying to track it down .. ;) Thanks, that's really helpful. The initializer flag has another side effect that I forgot about, the bridge "knows" that they return self, and that probably causes problems here (and even if it wouldn't this is obviously incorrect for methods that return an object but are not an initializer..., e.g. -(id)initialValue;. We need to recognize that an object is initialized, because of class clusters (e.g. release-ing the result of NSArray.alloc() is not good for your health). I'm going to look at your patch, it probably saner than assuming that all methods whose name starts with init followed by an uppercase letter (or whose name is init) are initializers. > def setBar_(self, value): > + self.initiateDestructionSequence() # to_objc(self) == nil at this point > self._kvo_bar = value > setBar_ = objc.accessor(setBar_) I can't wait until we can write this as 'def setBar_(self, value) [obj.accessor]:'. Ronald -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 |
From: Paul D. <pa...@do...> - 2004-05-03 18:19:20
|
Hi, I'm using the Cocoa-Python Application template to develop an application in Xcode. pyobjc/Xcode/Project Templates/00README.txt mentions an 'Install' target that can be used to build an application bundle containing the pyobjc modules required to make the application run on a stock 10.3 machine. Now, either I'm being dumb, or the Install target has been lost in the transition from ProjectBuilder to Xcode. Could someone point me at it, or tell me (in easy steps) how to create one? Cheers, Paul |
From: Ronald O. <ron...@ma...> - 2004-05-03 15:10:07
|
On 3-mei-04, at 16:12, Bob Ippolito wrote: > On May 3, 2004, at 5:52 AM, <mat...@da...> > wrote: > >> So I played around with KVB using PyObjc 1.0. Unfortunetely, it did >> not >> really work well (I ran into segmentation faults) , so I gave >> PyObjc-1.1b2 >> >> a try. The nasty segmentation faults went away and all seemed to work >> as >> expected, but now I've got problems with access to Objective-C >> variables >> (outlets in particular). The normal way, e.g. 'obj.outlet', does no >> longer >> >> work. Apparently as soon as some controller watches 'obj'. However, >> I >> can use PyObjCTools.KeyValueCoding.getKey to obtain access. > > Not bleeding edge enough. Key Value Observing was fixed post-1.1b2. > Please check out CVS HEAD and try that. > I hope cut the 1.1 release next weekend, I had planned to do that yesterday but ran into a problem on Jaguar :-( Ronald -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 |
From: Bob I. <bo...@re...> - 2004-05-03 14:12:18
|
On May 3, 2004, at 5:52 AM, <mat...@da...> wrote: > So I played around with KVB using PyObjc 1.0. Unfortunetely, it did not > really work well (I ran into segmentation faults) , so I gave > PyObjc-1.1b2 > > a try. The nasty segmentation faults went away and all seemed to work > as > expected, but now I've got problems with access to Objective-C > variables > (outlets in particular). The normal way, e.g. 'obj.outlet', does no > longer > > work. Apparently as soon as some controller watches 'obj'. However, I > can use PyObjCTools.KeyValueCoding.getKey to obtain access. Not bleeding edge enough. Key Value Observing was fixed post-1.1b2. Please check out CVS HEAD and try that. -bob |
From: <mat...@da...> - 2004-05-03 09:54:54
|
Greetings, This is my first post to this group, possibly because only recently I've touched the bleeding edge of PyObjc on Panther ;-). Otherwise, I'm greatly impressed by the bridge and its huge (magically working) functionality. It means I can now continue my NEXTSTEP 3.3 style programming (yes, yes I still have an Intel box running), yet under much better conditions. Though Objective-C is not that bad for GUI programming (at least it is much better suited than C++), Python offers even more pleasures. First of all, many thanks especially to Bill, Bob, Jack and Ronald, to name only the four prominent names that come up to my mind. Sorry that I can't mention all the many others explicitly. Thank you all! Here comes my problem: Last week I dipped my nose a little into Apple's key-kalue binding (KVB) paradigm offered on Panther. Though documentation is scarce by now, it appears to me that this is indeed a major advance compared to the AppKit of the good old NEXTSTEP days. I mean advance in the sense of "simplifying your own code and reducing the time to create it". So I played around with KVB using PyObjc 1.0. Unfortunetely, it did not really work well (I ran into segmentation faults) , so I gave PyObjc-1.1b2 a try. The nasty segmentation faults went away and all seemed to work as expected, but now I've got problems with access to Objective-C variables (outlets in particular). The normal way, e.g. 'obj.outlet', does no longer work. Apparently as soon as some controller watches 'obj'. However, I can use PyObjCTools.KeyValueCoding.getKey to obtain access. Here are instructions to create a barebones example that exhibit the problem: Create a new Cocoa-Python Application called 'Test' in Project Builder Open Main.nib in Interface Builder Drag an object controller instance from the palette to the applicationn's nib file. Connect the contoller's 'content' outlet to the application's delegate. Add key 'buttonName' to the controller keys. Drag a button to the application's window. Select 'Bindings' in the inspector. Unfold parameters 'title'. Select 'buttonName' from the model key path pulldown menu. Edit the class 'TestApplicationDelegate' in Interface Builder by adding an outlet 'myOutlet'. Connect the outlet 'myOutlet' of the TestApplicationDelegate instance to the button in the main window. Edit the file TestAppDelegate.py to contain the following: from Foundation import NSLog from PyObjCTools import NibClassBuilder from PyObjCTools.KeyValueCoding import getKey NibClassBuilder.extractClasses("MainMenu") class TestAppDelegate(NibClassBuilder.AutoBaseClass): def applicationDidFinishLaunching_(self, aNotification): print "usual attribute access" try: print "myOutlet:", self.myOutlet except Exception, what: print print what print "access using getKey" print "myOutlet:", getKey(self, 'myOutlet') NSLog( "Application did finish launching." ) def buttonName(self): return 'Hello' Save the nib file, build and run the application The button shows the name 'Hello', thanks to key/value binding'. However, I can't access outlets in the usual way anymore. I get the following output in the console: usual attribute access myOutlet: 'NSNotifying_PyKVBAppDelegate' object has no attribute 'myOutlet' access using getKey myOutlet: <NSButton: 0x3d23a0> 2004-05-03 09:32:56.488 PyKVB[4196] Application did finish launching. In order to demonstrate that this unexpected behavior has to to with KVB, I can uncheck the 'Bind' feature for the button's title. After I saved the nib file and restarted the application, I now get: usual attribute access myOutlet: <NSButton: 0x3d1ff0> access using getKey myOutlet: <NSButton: 0x3d1ff0> 2004-05-03 09:53:14.638 PyKVB[4202] Application did finish launching. Of course, the name of the button is no longer 'Hello', because key value observing is now inactive. I've somewhere encounterd the term 'isa-swizzling'. Maybe the problem has to do with that. Regards, Matthias -- Matthias Oberlaender DaimlerChrysler AG Research and Technology Information and Communication RIC/AP (Machine Perception) P.O. Box 2360 D-89013 Ulm |
From: Rui C. <rui...@ac...> - 2004-05-02 23:54:59
|
Hi there, I'm trying to put together a small set of Python utility classes to splice into a few cross-platform scripts I'm writing, and picked up PyObjC to give my scripts a minimal GUI. I'm perusing the examples, but there are two things I'm trying to do that don't seem to be covered: a palette/utility window and a transparent "floater" - like the rounded rectangle that holds the Cmd+TAB task switcher, but mine would be a low-key alert with automatic dismissal - think "Mail.appetizer". Are there any pointers on how to go about doing this? I'd be glad to submit the end results as sample code for the PyObjC distribution. Regards, Rui Carmo http://the.taoofmac.com |
From: link <li...@be...> - 2004-05-01 02:43:18
|
Dear Webmaster, =09=09=09=09=09=09=09=09=09=09=09=09=09=09 I am writing you today regarding reciprocal linking of our website= s=2E The name of our website is www=2Ebestfranchiseopportunities=2Ecom The reasons for linki= ng are beneficial to=20 both parties=2E We are a highly visited website with a current page rank o= f between four and=20 five which means we are a valid link partner for you=2E The focus of our w= ebsite is business=20 and franchise opportunities=2E If you are interested you may reach me thr= ough email at=20 linkexchange@best=2Ebestfranchiseopportunities=2Ecom =2E I would be more t= hen happy to answer any=20 questions or further discuss how this can be beneficial for both parties=2E= Once you have=20 decided to exchange links with us please email me your site information so= that I can have=20 someone in my IT staff add your link, and also please let me know where I = can find my link=20 on your site=2E Sincerely, ELIZABETH MAZUR PS- This Message has been sent in Accordance with New Legislation regardin= g email correspondance=2E If you would like to be removed from my Contacts= please send a removal request to sendnomore@bestfranchiseopportunities=2E= com with your email address in the subject line and I will remove you fro= m my contacts file at once=2E Thank you! |
From: Bob I. <bo...@re...> - 2004-04-29 20:43:25
|
On Apr 29, 2004, at 4:05 PM, burris ewell wrote: > How do I get my pyobjc app to run on both Jaugar and Panther? Develop it on Jaguar. -bob |
From: burris e. <bu...@gi...> - 2004-04-29 20:05:57
|
How do I get my pyobjc app to run on both Jaugar and Panther? thanks, burris |
From: E-Ticket-Marketing.com <no...@e-...> - 2004-04-29 16:53:46
|
No text version was provided |
From: Bob I. <bo...@re...> - 2004-04-27 20:14:29
|
On Apr 27, 2004, at 4:04 PM, Pierce T.Wetter III wrote: > > On Apr 27, 2004, at 12:52 PM, Ronald Oussoren wrote: > >> >> On 27-apr-04, at 21:19, Pierce T.Wetter III wrote: >> >>> >>> So this line is giving me an error: >>> >>> qual= ObjectModel.EOQualifier.qualifierWithQualifierFormat_('fund = >>> %@ and date >= %@',fund,now60) >>> >>> TypeError: Need 1 arguments, got 3 >>> >>> (1.1 b2 downloaded about 15 minutes ago) >>> >>> Presumably because qualifierWithQualifierFormat takes a variable >>> number of arguments. >>> >>> Is there some sort of voodoo I can do to get this to work? >> >> The easiest solution is to do the formatting on the python side: >> >> qual= ObjectModel.EOQualifier.qualifierWithQualifierFormat_('fund = >> %s and date >= %s'%(fund,now60)) >> >> It is possible to write C code that would allow you to pass in a >> variable number of arguments, but you would have to implement most of >> the format-string parsing in the wrapper. > > Yeah, that doesn't work, because it just looks like a format string, > its actually parsed. For instance, an AND in the string produces an > EOAndQualifier etc. > > What I did instead was add this in a category to EOQualifier: > > + (EOQualifier *) qualifierWithQualifierFormat: (NSString *) string > arg1: (id) arg1 arg2:(id) arg2 > { > > return [self qualifierWithQualifierFormat: string,arg1,arg2]; > } > > Though that's a hack obviously. > > I wonder if it would be possible to do something like this: > > objc.makeVarArgsCall(ObjectModel.EOQualfier,"qualifierWithQualifierForm > at_",('fund = %s and date >= %s',fund,now60)) > > That is, add a method to the objc module that takes an object, a > selector and a list of arguments and makes the call? The difficulty is that many varargs functions, like +[NSString stringWithFormat], NSLog, printf, etc. take arbitrary types.. %s would be a c string, %@ would be an objc object, %d would be an integer. Python has to know about that in order to do the type conversion. It's probably possible to tokenize the string from python and build a one-off selector+signature for that call. In this case your function seems like it only takes ids so it's probably possible to do this kind of bridge without tokenizing the string at all. -bob |
From: Pierce T.W. I. <pi...@tw...> - 2004-04-27 20:04:55
|
On Apr 27, 2004, at 12:52 PM, Ronald Oussoren wrote: > > On 27-apr-04, at 21:19, Pierce T.Wetter III wrote: > >> >> So this line is giving me an error: >> >> qual= ObjectModel.EOQualifier.qualifierWithQualifierFormat_('fund = >> %@ and date >= %@',fund,now60) >> >> TypeError: Need 1 arguments, got 3 >> >> (1.1 b2 downloaded about 15 minutes ago) >> >> Presumably because qualifierWithQualifierFormat takes a variable >> number of arguments. >> >> Is there some sort of voodoo I can do to get this to work? > > The easiest solution is to do the formatting on the python side: > > qual= ObjectModel.EOQualifier.qualifierWithQualifierFormat_('fund = %s > and date >= %s'%(fund,now60)) > > It is possible to write C code that would allow you to pass in a > variable number of arguments, but you would have to implement most of > the format-string parsing in the wrapper. Yeah, that doesn't work, because it just looks like a format string, its actually parsed. For instance, an AND in the string produces an EOAndQualifier etc. What I did instead was add this in a category to EOQualifier: + (EOQualifier *) qualifierWithQualifierFormat: (NSString *) string arg1: (id) arg1 arg2:(id) arg2 { return [self qualifierWithQualifierFormat: string,arg1,arg2]; } Though that's a hack obviously. I wonder if it would be possible to do something like this: objc.makeVarArgsCall(ObjectModel.EOQualfier,"qualifierWithQualifierForma t_",('fund = %s and date >= %s',fund,now60)) That is, add a method to the objc module that takes an object, a selector and a list of arguments and makes the call? Pierce |
From: Ronald O. <ron...@ma...> - 2004-04-27 19:52:42
|
On 27-apr-04, at 21:19, Pierce T.Wetter III wrote: > > So this line is giving me an error: > > qual= ObjectModel.EOQualifier.qualifierWithQualifierFormat_('fund = %@ > and date >= %@',fund,now60) > > TypeError: Need 1 arguments, got 3 > > (1.1 b2 downloaded about 15 minutes ago) > > Presumably because qualifierWithQualifierFormat takes a variable > number of arguments. > > Is there some sort of voodoo I can do to get this to work? The easiest solution is to do the formatting on the python side: qual= ObjectModel.EOQualifier.qualifierWithQualifierFormat_('fund = %s and date >= %s'%(fund,now60)) It is possible to write C code that would allow you to pass in a variable number of arguments, but you would have to implement most of the format-string parsing in the wrapper. Ronald -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 |
From: Pierce T.W. I. <pi...@tw...> - 2004-04-27 19:20:02
|
So this line is giving me an error: qual= ObjectModel.EOQualifier.qualifierWithQualifierFormat_('fund = %@ and date >= %@',fund,now60) TypeError: Need 1 arguments, got 3 (1.1 b2 downloaded about 15 minutes ago) Presumably because qualifierWithQualifierFormat takes a variable number of arguments. Is there some sort of voodoo I can do to get this to work? Pierce |
From: <ng...@t-...> - 2004-04-23 13:15:25
|
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1251"> </head> <BODY> <font color="#F<rnddg[1]>F<rnddg[1]>F<rnddg[1]>" size="2"><cryptemail[CryptMe]><rndmx[10]><rndlt[10]><rnddg[10]></font> <table cellspacing="0" cellpadding="0" width="650px"> <tr> <td width="100%" align="left" valign="top"> <font face="Times New Roman"><P align=center><B><FONT color=purple size=4><I>Компания</I> <U><FONT color=black>"USTIKO-XXI ВЕК"</FONT></U><I> предоставляет спектр юридических услуг.</I></FONT></B> </P> <TABLE style="BORDER-COLLAPSE: collapse" borderColor=#000000 cellPadding=4 width="100%" border=1><TR> <TD style="WIDTH: 65%; TEXT-ALIGN: center" vAlign=center> <UL> <LI> <DIV align=left><b><FONT color=#000080>Готовые ООО</FONT> - 9 900 рублей </b></DIV> <LI> <DIV align=left><b><FONT color=#000080>Потребительское Общество</FONT> - 18 000 рублей </b></DIV> <LI> <DIV align=left><b><FONT color=#000080>Регистрация ООО, ЗАО, НО, ЧОП</FONT> -от 7 500 рублей </b></DIV> <LI> <DIV align=left><b><FONT color=#000080>Регистрация акций (ФКЦБ)</FONT> - 9 000 рублей </b></DIV> <LI> <DIV align=left><b><FONT color=#000080>Юридические адреса </FONT></b></DIV> <LI> <DIV align=left><b><FONT color=#000080>Лицензирование </FONT></b></DIV> <LI> <DIV align=left><b><FONT color=#000080>Внесение изменений в учредительные <br> документы</FONT> - 6 000 рублей </b></DIV> <LI> <DIV align=left><b><FONT color=#000080>Ликвидация юридических лиц </FONT></b></DIV> <LI> <DIV align=left><b><FONT color=#000080>Карточка ПВУ</FONT> - 6 000 руб. </b></DIV> <LI> <DIV align=left><b><FONT color=#000080>Аккредитация иностранных представительств </FONT></b></DIV> <LI> <DIV align=left><b><FONT color=#000080>Получение информационного письма МосГорКомСтат</FONT> - 1 500 рублей </b></DIV> <LI> <DIV align=left><b><FONT color=#000080>Бухгалтерское сопровождение. </FONT></b></DIV> <LI> <DIV align=left><b><FONT color=#000080>Регистрация товарных знаков. </FONT></b></DIV> <LI> <DIV align=left><b><FONT color=#000080>Оценка имущества</FONT></b></DIV></LI></UL></TD> <TD style="WIDTH: 35%; TEXT-ALIGN: center" vAlign=center> <P><FONT color=#000000 size=4><b>(095) 915-66-57<br> (095) 748-82-38</b></FONT></P> <P><FONT color=#000000 size=4><b>Москва, м. Таганская<br> 1-ый Гончарный пер. д.7</b></FONT></P> <P><b><FONT color=#000080>(5 минут от метро, в сторону магазина "НУМИЗМАТ", крыльцо с надписью "ТО Гончарная слобода-2")</FONT></b></P> <P><FONT color=#000000><br> <b><i><FONT color=red size=4><U>БЕСПЛАТНЫЙ ВЫЕЗД КУРЬЕРА!</U></FONT></i></b><br> </FONT></P></TD></TR></TABLE> </font> </td> </tr> </table> <font color="#F<rnddg[1]>F<rnddg[1]>F<rnddg[1]>" size="2"><cryptemail[CryptMe]><rndmx[10]><rndlt[10]><rnddg[10]></font> </BODY> </html> |
From: Akhar <ak...@gm...> - 2004-04-23 11:57:44
|
I was able to fix the script loading problem it was not due to that type which is in the email not the actual code. The problem I now have is with persistance of the python object. I am trying to have a customView call the python code programmatically so I inited pythonglue and my script in the init of the customView (no problem there ) but if I call it from the - keydown method it doesn't work ; I put a trace to see what the object's class were at init they are seen as the proper <PythonGlu> and <pyScript> but in - keydown are seen as (null). It looks like the objects are not retained somehow or something else is happenning and i do not know what. Any ideas? Cheers Stephane NB: I seem to have been able to fix my problem by taking out (pyScript) : %%%%%%%%%%%%%%%%%%%%%%%%%%%% ----Script.m, #import "Script.h" @implementation Script(pyScript) //<- offending line + instantiateSubclassNamed:(NSString*) aClassName { Class aClass = NSClassFromString(aClassName); return [[aClass alloc] init]; } @end BUT i do get another error which is : creating object *** -[scr test]: selector not recognized An uncaught exception was raised *** -[scr test]: selector not recognized *** Uncaught exception: <NSInvalidArgumentException> *** -[scr test]: selector not recognized QuickShell has exited due to signal 5 (SIGTRAP). %%%%%%%%%%%%%% passing nil from objective c code like "[scr test:nil];" solved the problem On 23-Apr-04, at 1:55 AM, Ronald Oussoren wrote: > > On 21-apr-04, at 1:40, Akhar wrote: >> >> Script = lookUpClass("Scipt") > > There's a typo in this line, the argument to lookUpClass is missing an > 'r'. > > Ronald > -- > X|support bv http://www.xsupport.nl/ > T: +31 610271479 F: +31 204416173 |
From: Ronald O. <ron...@ma...> - 2004-04-23 05:56:05
|
On 21-apr-04, at 1:40, Akhar wrote: > > Script = lookUpClass("Scipt") There's a typo in this line, the argument to lookUpClass is missing an 'r'. Ronald -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 |
From: Akhar <ak...@gm...> - 2004-04-23 05:05:05
|
passing nil in objective C seems to let the code run, but the pythonglue object and my python instance of an object do not get retained!? I have to recreate them at every use !? is this normal? Stephane |
From: <da...@pr...> - 2004-04-22 09:43:37
|
<html> <body> <div align="center"> <center> <table border="0" cellspacing="1" width="65%" cellpadding="3"> <tr> <td width="3%" bgcolor="#E0C1FF"> </td> <td width="100%"> <hr noshade color="#E0C1FF"> <p style="margin-top: 0; margin-bottom: 0"><b><i><font color="#0000FF">Уважаемые дамы и господа!</font></i></b><font size="2"><br> <br> Специалисты нашего медицинского Центра мануальной терапии и косметологии, члены Европейской Ассоциации мануальных терапевтов, разработали уникальную программу <font color="#FF0000"><b> «ДЕЛОВАЯ АКТИВНОСТЬ»</b></font>.</font></p> <ul type="square"> <li> <p style="margin-top: 0; margin-bottom: 0"><font size="2">Все свое время вы отводите своему бизнесу?</font></li> <li> <p style="margin-top: 0; margin-bottom: 0"><font size="2">Постоянно находите в состоянии напряжения? </font></li> <li> <p style="margin-top: 0; margin-bottom: 0"><font size="2">Время от времени возникающие стрессовые ситуации мешают нормально уснуть? </font></li> <li> <p style="margin-top: 0; margin-bottom: 0"><font size="2">Все чаще возникает мучительная головная боль? </font></li> <li> <p style="margin-top: 0; margin-bottom: 0"><font size="2">Все мышцы будто скованы?</font></li> </ul> <p style="margin-top: 0; margin-bottom: 0"><font size="2"> Тогда программа <font color="#FF0000"><b> «ДЕЛОВАЯ АКТИВНОСТЬ</b><b>»</b></font> разработана специально для Вас. <br> Она включает в себя ряд оздоровительных процедур, направленных на снятие мышечного напряжения, устранение головных болей, нормализацию сна. Для каждого из наших пациентов подбирается индивидуальный комплекс процедур, разрабатываются рекомендации для поддержания отличного самочувствия.<br> Вашему вниманию также предлагаются высокоэффективные профессиональные </font><b><font color="#FF0000"> программы по коррекции фигуры</font></b><font size="2">, которые не только помогут вернуть былую стройность, но и нормализуют обмен веществ, обогатят кровь кислородом, улучшат состояние кожи.<br> Доверьте свое лицо нашим косметологам, которые подберут для Вас индивидуальные процедуры. Всего за 1,5 часа настоящего счастья, в течение которых вы расслабитесь, получите незабываемое удовольствие и Ваша кожа получит все, что ей нужно: увлажнение, чистоту и сияющий эффект.<br> <br> Вы хотите, чтобы любимое дело приносило только удовлетворение? <br> Не желаете, чтобы Ваш бизнес становился лишь источником головной боли? <br> Тогда звоните и записывайтесь на бесплатную консультацию к специалистам нашего медицинского Центра! <br> </font><font color="#FF0000"><b> Внимание!</b> Если Вы позвоните до 1 мая, то для Вас разработают систему упражнений, способный всего за несколько минут снизить ощущение усталости и скованности в мышцах и суставах.<br> При прохождении лечения </font><i><b><font color="#008080"> вы получаете в подарок</font></b></i><font color="#FF0000"> комплекс витаминов группы «В» укрепляющие нервную систему.</font><font size="2"><br> <br> </font><font color="#0000FF"><b><i>Мы работаем без выходных с 8:OO до 23:OO.<br> Телефоны для записи: [O95] 9I7-II-20, 9I7-98-O4</i></b></font></p> <hr noshade color="#E0C1FF"> </td> </tr> </table> </center> </div> <p align="center"> </p> <p align="center"><font color="#FDFDFD" size="1">colors</font></p> <p align="center"><font color="#FDFDFD" size="1">netscapenavigatorпозволяетвамчерезпротоколftpпересылатьфайлына</font></p> <p align="center"><font color="#FDFDFD" size="1">понятной форме описаны тонкости, хитрости и секреты глобальной компьютерной</font></p> <p align="center"><font color="#FDFDFD" size="1">орудийные залпы. Утром примчался вестовой с приказом -- остаться на месте,</font></p> </body> </html> |