pyobjc-dev Mailing List for PyObjC (Page 229)
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: Chris R. <cp...@em...> - 2003-06-30 13:42:41
|
Uh-oh--can you explain to the uninitiates why these two code sequences aren't identical? On Monday, June 30, 2003, at 05:27 AM, Just van Rossum wrote: > Ronald Oussoren wrote: > >> This seems to be a reference counting issue, maybe NSApplication >> doesn't retain its delegate. > > It doesn't. (It seems that delegates are not retained in general.) > >> If you change the code to: >> dgate = AppDelegate.alloc().init() >> NSApp.setDelegate_(dgate) >> >> instead of 'NSApp.setDelegate_(AppDelegate.alloc().init())' the >> example works as expected. > > I'll check in a similar fix. > > Just > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/ > 01 > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > > Cheers! --Chris Ryland / Em Software, Inc. / www.emsoftware.com |
From: Just v. R. <ju...@le...> - 2003-06-30 10:00:16
|
Ronald Oussoren wrote: > This seems to be a reference counting issue, maybe NSApplication > doesn't retain its delegate. It doesn't. (It seems that delegates are not retained in general.) > If you change the code to: > dgate = AppDelegate.alloc().init() > NSApp.setDelegate_(dgate) > > instead of 'NSApp.setDelegate_(AppDelegate.alloc().init())' the > example works as expected. I'll check in a similar fix. Just |
From: Ronald O. <ous...@ci...> - 2003-06-30 07:41:47
|
On Monday, Jun 30, 2003, at 09:30 Europe/Amsterdam, Jim Tittsler wrote: > I succeeded in updating to the CVS version of Python 2.3 and > pyobjc by deleting all of the old versions and starting over. > It must have been operator error or a mismatch with earlier > installed versions. Sorry for the noise. > > > Or at least I think I was successful. Most of the examples > work, but Examples/HelloWorld.py segfaults (while setting up > the hello button's target?). This seems to be a reference counting issue, maybe NSApplication doesn't retain its delegate. If you change the code to: dgate = AppDelegate.alloc().init() NSApp.setDelegate_(dgate) instead of 'NSApp.setDelegate_(AppDelegate.alloc().init())' the example works as expected. Ronald |
From: Jim T. <jw...@On...> - 2003-06-30 07:29:22
|
I succeeded in updating to the CVS version of Python 2.3 and pyobjc by deleting all of the old versions and starting over. It must have been operator error or a mismatch with earlier installed versions. Sorry for the noise. Or at least I think I was successful. Most of the examples work, but Examples/HelloWorld.py segfaults (while setting up the hello button's target?). |
From: SourceForge.net <no...@so...> - 2003-06-28 22:04:04
|
Bugs item #762519, was opened at 2003-06-28 18:04 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=762519&group_id=14534 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Bill Bumgarner (bbum) Assigned to: Nobody/Anonymous (nobody) Summary: Fix autogenerate files phase of build. Initial Comment: There are a couple of issues with the automatically generated files found within the build. Currently, the cocoa_generator.py script will be run even on systems that do not support it. Also, the autogenerated files are created in the source trees -- they should be moved to the build/ directory and included from there. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=114534&aid=762519&group_id=14534 |
From: Ronald O. <ous...@ci...> - 2003-06-28 21:09:09
|
On Saturday, Jun 28, 2003, at 22:58 Europe/Amsterdam, Ronald Oussoren wrote: > > On Saturday, Jun 28, 2003, at 22:41 Europe/Amsterdam, Jack Jansen > wrote: > >> >> On zaterdag, jun 28, 2003, at 15:01 Europe/Amsterdam, Ronald Oussoren >> wrote: >> >>> I've just checked in a patch that (amongst others) enables support >>> for the constants in the WebCore framework. To compile the current >>> CVS version you have to install the WebCore SDK. >>> >>> I have not yet check if the compiled version will work on a system >>> without Safari 1.0. I don't want to rely on optional applications, >>> so if the binary version does not work without Safari 1.0 I'll roll >>> back this part of the patch until we find a better solution. >> >> Purely by chance I have a machine that's still at Safari beta 2, and >> unfortunately PyObjC doesn't compile. I get a long string of error >> messages, starting with >> >> In file included from Modules/Foundation/_Foundation.m:233: >> Modules/Foundation/_Fnd_Enum.inc:103: >> `NSHTTPCookieAcceptPolicyAlways' undeclared here (not in a function) >> >> So I think we should leave this out. > I already suspected that this would be an issue. What is IMHO more > important is: does a PyObjC compiled on a system with WebKit work on > that system. I'll be testing that later on a machine at work. It doesn't. The only additions to Foundations are some constant definitions, including some NSStrings. I think those cause these problems. Maybe weak-linking will work for that. Ronald |
From: Ronald O. <ous...@ci...> - 2003-06-28 20:59:50
|
On Saturday, Jun 28, 2003, at 22:41 Europe/Amsterdam, Jack Jansen wrote: > > On zaterdag, jun 28, 2003, at 15:01 Europe/Amsterdam, Ronald Oussoren > wrote: > >> I've just checked in a patch that (amongst others) enables support >> for the constants in the WebCore framework. To compile the current >> CVS version you have to install the WebCore SDK. >> >> I have not yet check if the compiled version will work on a system >> without Safari 1.0. I don't want to rely on optional applications, so >> if the binary version does not work without Safari 1.0 I'll roll back >> this part of the patch until we find a better solution. > > Purely by chance I have a machine that's still at Safari beta 2, and > unfortunately PyObjC doesn't compile. I get a long string of error > messages, starting with > > In file included from Modules/Foundation/_Foundation.m:233: > Modules/Foundation/_Fnd_Enum.inc:103: `NSHTTPCookieAcceptPolicyAlways' > undeclared here (not in a function) > > So I think we should leave this out. I already suspected that this would be an issue. What is IMHO more important is: does a PyObjC compiled on a system with WebKit work on that system. I'll be testing that later on a machine at work. > > Just in case you come up with something bright I will not upgrade my > machine just yet, so if you think you have a workaround let me know > and I'll test. I have a machine without Safari at work, and can test there, don't let this issue keep you from upgrading to Safari 1.0 :-) Ronald |
From: Jack J. <Jac...@cw...> - 2003-06-28 20:50:03
|
On zaterdag, jun 28, 2003, at 15:01 Europe/Amsterdam, Ronald Oussoren wrote: > I've just checked in a patch that (amongst others) enables support for > the constants in the WebCore framework. To compile the current CVS > version you have to install the WebCore SDK. > > I have not yet check if the compiled version will work on a system > without Safari 1.0. I don't want to rely on optional applications, so > if the binary version does not work without Safari 1.0 I'll roll back > this part of the patch until we find a better solution. Purely by chance I have a machine that's still at Safari beta 2, and unfortunately PyObjC doesn't compile. I get a long string of error messages, starting with In file included from Modules/Foundation/_Foundation.m:233: Modules/Foundation/_Fnd_Enum.inc:103: `NSHTTPCookieAcceptPolicyAlways' undeclared here (not in a function) So I think we should leave this out. Just in case you come up with something bright I will not upgrade my machine just yet, so if you think you have a workaround let me know and I'll test. -- - Jack Jansen <Jac...@or...> http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - |
From: Ronald O. <ous...@ci...> - 2003-06-28 13:02:12
|
I've just checked in a patch that (amongst others) enables support for the constants in the WebCore framework. To compile the current CVS version you have to install the WebCore SDK. I have not yet check if the compiled version will work on a system without Safari 1.0. I don't want to rely on optional applications, so if the binary version does not work without Safari 1.0 I'll roll back this part of the patch until we find a better solution. Ronald |
From: Jim T. <jw...@On...> - 2003-06-28 06:14:14
|
I'm trying to build the current CVS on a 10.2.6 machine w/December tools and Python 2.3b1. I put the absolute path to the tree from gcc-libffi-snapshot20030119-patched.tar.gz in setup.py and tried to do: 'sudo python setup.py install' but it stops with: ld: build/libffi/lib/libffi.a(darwin_closure.o) has local relocation entries in non-writable section (__TEXT,__text) error: command 'gcc' failed with exit status 1 If I follow the INSTALL steps in the libffi tree, I appear to be able to build/test libffi correctly. Where am I going wrong with the pyobjc setup.py? |
From: Onida<Big...@ya...> - 2003-06-28 00:45:38
|
Hello, ***HERE IS AN OFFER YOU DON'T WANT TO MISS!*** Over 1,200 Books, Manuals, And Reports On CD-Rom! Full Reprint Rights! Sell The Entire Collection For As Much $$$ As You Like! Never Pay us any royalty fee! Read them, Sell them and bank the money! The best part is this... You can use all our web pages and marketing material (included) to make a fortune selling these amazing books, reports and manuals. It's a ready made business! You can even sell them on ebay and clean house! >>You will also get a second bonus CD ROM... Including 9 E-Books on how to advertise and start making some real money on the Internet! >>Plus yet another added Bonus... How to make serious money on ebay and other auction sites overnight! To find out more about this Risk Free Offer, Do not respond by email. Instead, Click the link below or copy and paste the web site address into your web browser. <br><A HREF="http://www.vvevvillmakeyoumoney.biz/reports.htm">Click Here For More Information</A><br> http://www.vvevvillmakeyoumoney.biz/reports.htm ______________________________________________________ Want to be REMOVED from our email list? You were sent this email because you used our Opt-in service. We hope you enjoy reading our messages. However, if you'd rather not receive future e-mails from us, Click on the link below. http://www.vvevvillmakeyoumoney.biz/removeme.htm Thank you for your cooperation. ________________________________________________________ |
From: Just v. R. <ju...@le...> - 2003-06-27 20:35:51
|
Chris Ryland wrote: > Apple announced at the WWDC this week that they're making the full > Quartz API (most at first, rest to follow) available as a Python > wrapper, Yeah, we heard that during EuroPython, and are extremely puzzled, since we've had (partial) support for Quartz in MacPython since 2.2, in the form of the Carbon.CG module. I really wish they'd communicate with us more. Just |
From: Chris R. <cp...@em...> - 2003-06-27 19:23:23
|
Apple announced at the WWDC this week that they're making the full Quartz API (most at first, rest to follow) available as a Python wrapper, and are supporting Python scripts as part of their PDF workflow (built into standard printing support). They also announced Xcode, the next generation of Project Builder, and it looks great. I talked to Ali Ozer (I think he's the main application frameworks technical guru) about supporting PyObjC in Xcode, and he said that they're pretty unlikely to support another language (beyond C/C++/Java/Obj-C), but that he'd heard good things about PyObjC and was planning to look into it. I enthused about it and it seems to perk up his interest. So now might be a good time to flood the Apple wishlists with requests for PyObjC support in Xcode. And, a friend of mine who's the new junior product manager for PyObjC hinted that more good things were coming w.r.t. Python support in Panther and later. For whatever it's worth... Cheers! --Chris Ryland / Em Software, Inc. / www.emsoftware.com |
From: Just v. R. <ju...@le...> - 2003-06-27 19:05:47
|
Btw. bundlebuilder has a --standalone option: - it finds (most) module dependencies from the main program, and include those modules - with Python2.2, it adds .pyc files to the app bundle (except for the main program, not for any particular reason though) - with Python2.3, it also includes all needed modules as .pyc files, but inside a zip file (this uses the new zipimport mechanism) Just |
From: Gary R. <gro...@tr...> - 2003-06-27 18:43:45
|
> The real question is what the heck do you have that is so proprietary > that you can't trust your users not to break the law. It's not like > you're even selling a consumer product (from what I could glean from > your company's website). We've got our reasons. ;) And we ARE shipping a consumer product on July 7. I'm not super-concerned about somebody getting at it who is determined and somewhat sophisticated. You can dissamble C, too, if you really want to. But there was no reason not to make it a bit more difficult than just reading the source if we could. --Gary -- Putting http://wecanstopspam.org in your email helps it pass through overzealous spam filters. Gary Robinson CEO Transpose, LLC gro...@tr... 207-942-3463 http://www.transpose.com http://radio.weblogs.com/0101454 |
From: Bob I. <bo...@re...> - 2003-06-27 18:02:29
|
Sorry to burst your bubble here... but any serious python developer that actually wants to see what your code does isn't going to have a problem doing so.. python compilation is a nearly reversible operation because the "assembly language" it basically has an opcode for each kind of syntax token, in-line documentation is preserved (except in .pyo), and the names of local scope variables (including function arguments) don't go away. Hell, you don't even lose LINE NUMBERS in compiled code. from input like this: def code(): heres_my_secret = 1234 heres_my_secret *= 4 return heres_my_secret | 2 Using the dis module that comes with python, you get output like this: >>> dis.disassemble(secret.code.func_code) 2 0 LOAD_CONST 1 (1234) 3 STORE_FAST 0 (heres_my_secret) 3 6 LOAD_FAST 0 (heres_my_secret) 9 LOAD_CONST 2 (4) 12 INPLACE_MULTIPLY 13 STORE_FAST 0 (heres_my_secret) 4 16 LOAD_FAST 0 (heres_my_secret) 19 LOAD_CONST 3 (2) 22 BINARY_OR 23 RETURN_VALUE 24 LOAD_CONST 0 (None) 27 RETURN_VALUE The number of parameters, names of parameters, keyword arguments, etc can be read from members of the secret.code function object.. The numbers to the left (2, 3, 4) correspond to line numbers in the secret.py file. It's rather easy to see that if you knew enough about this stuff you could write a disassembler that would output something nearly identical to the input code. The real question is what the heck do you have that is so proprietary that you can't trust your users not to break the law. It's not like you're even selling a consumer product (from what I could glean from your company's website). -bob On Friday, Jun 27, 2003, at 09:59 America/New_York, Bob Swerdlow wrote: > For anyone who is interested: I discovered the "compileall" module > (http://www.python.org/doc/current/lib/module-compileall.html) that > allowed > me to build the application the way I wanted. I just added it to the > top of > buildapp.py and changed the suffixes to *.pyc. > > From: "Bob Swerdlow" <rsw...@tr...> > To: <pyo...@li...> > Date: Thu, 26 Jun 2003 13:56:42 -0400 > Subject: [Pyobjc-dev] Don't want to ship sources > > Has anyone tried to create a PyObjC application that includes only > compiled > files rather than Python sources scripts? I'm preparing a PyObjC > application for distribution and we don't want to ship the source > files. > I've found that I can just change the buildapp.py to include *.pyc > files and > everything works fine - except that the python interpreter doesn't > want to > give me compiled files for every class. > > So, my question is - is there a way to force python to create compiled > files > for each class? My approach has been to add this code to the > buildapp.py > file: > > liststrFiles = [ fn[0 : len(fn-len(".py")] for fn in > os.listdir('.') if > fn.endswith('.py') and fn not in ('buildapp.py', "myApp.py") ] > for str in lststrFiles: > exec("import " + str) > > srcs = [ fn for fn in os.listdir('.') if fn.endswith(".pyc") ] > > and then to add srcs to the resources line in buildapp(). I don't > include > the main script "myApp.py" since python gets confused about the NIB > stuff. > > Anyway, this approach doesn't work because not all of the files get > compiled > into *.pyc files. Is there any way to force this or is there another > approach to building the app without sources? > > Thanks, > > Bob Swerdlow > COO > Transpose > rsw...@tr... > 207-781-8284 > http://www.transpose.com |
From: Bob S. <rsw...@tr...> - 2003-06-27 14:07:06
|
For anyone who is interested: I discovered the "compileall" module (http://www.python.org/doc/current/lib/module-compileall.html) that allowed me to build the application the way I wanted. I just added it to the top of buildapp.py and changed the suffixes to *.pyc. From: "Bob Swerdlow" <rsw...@tr...> To: <pyo...@li...> Date: Thu, 26 Jun 2003 13:56:42 -0400 Subject: [Pyobjc-dev] Don't want to ship sources Has anyone tried to create a PyObjC application that includes only compiled files rather than Python sources scripts? I'm preparing a PyObjC application for distribution and we don't want to ship the source files. I've found that I can just change the buildapp.py to include *.pyc files and everything works fine - except that the python interpreter doesn't want to give me compiled files for every class. So, my question is - is there a way to force python to create compiled files for each class? My approach has been to add this code to the buildapp.py file: liststrFiles = [ fn[0 : len(fn-len(".py")] for fn in os.listdir('.') if fn.endswith('.py') and fn not in ('buildapp.py', "myApp.py") ] for str in lststrFiles: exec("import " + str) srcs = [ fn for fn in os.listdir('.') if fn.endswith(".pyc") ] and then to add srcs to the resources line in buildapp(). I don't include the main script "myApp.py" since python gets confused about the NIB stuff. Anyway, this approach doesn't work because not all of the files get compiled into *.pyc files. Is there any way to force this or is there another approach to building the app without sources? Thanks, Bob Swerdlow COO Transpose rsw...@tr... 207-781-8284 http://www.transpose.com |
From: Ronald O. <ous...@ci...> - 2003-06-27 10:20:50
|
This is a feature of NSApplication, the NSApplicationMain function will never return, it calls the C exit function directly. You can call stopDaemons from the NSApplication delegate, there also is a notification that gets posted when the application is quiting. Ronald |
From: Ronald O. <ous...@ci...> - 2003-06-27 10:20:27
|
On Thursday, Jun 26, 2003, at 10:13 Europe/Amsterdam, Ronald Oussoren wrote: > > On Wednesday, Jun 25, 2003, at 20:26 Europe/Amsterdam, Kevin Marks > wrote: > >> >> On Wednesday, June 25, 2003, at 08:39 AM, bb...@ma... wrote: >> >>> (Sorry for the faulty repeat of Ronald's followup -- I'm on a >>> ****slow**** connection.) >>> >>> First, change the class name 'ircController' to 'IRCController' -- >>> it follows the Obj-C pattern and will reduce confusion (in that >>> ircController in the code below really should be ircController). >>> >>> I also noticed that you are using multiple inheritance... >>> >>> class ircController(NibClassBuilder.AutoBaseClass, irclib.irc) > > I completely missed the MI stuff when I first looked at this. You > shouldn't use MI with Cocoa classes, I'm actually suprised that this > works at all as your supposed to get an exception when you use > multiple inheritance. I guess I'll have to add a unittest and some > documentation for this. Please ignore this, my memory was playing up. You can use MI inheritance with ObjC classes, as long as only the first, and only the first, base class is an Objective-C class. However, if you add actions using mixins you code would not be as efficient as possible and I would advise against doing that. That doesn't seem to be a problem in this case. I'm typing this while away from an Internet connections (I'm at www.europython.org, and sporadicly check my mail between sessions), so maybe the problem is already solved. If it isn't, it would be very helpfull of you could create a minimal program that reproduces the problem. Ronald |
From: Bob S. <rsw...@tr...> - 2003-06-26 17:56:58
|
Has anyone tried to create a PyObjC application that includes only compiled files rather than Python sources scripts? I'm preparing a PyObjC application for distribution and we don't want to ship the source files. I've found that I can just change the buildapp.py to include *.pyc files and everything works fine - except that the python interpreter doesn't want to give me compiled files for every class. So, my question is - is there a way to force python to create compiled files for each class? My approach has been to add this code to the buildapp.py file: liststrFiles = [ fn[0 : len(fn-len(".py")] for fn in os.listdir('.') if fn.endswith('.py') and fn not in ('buildapp.py', "myApp.py") ] for str in lststrFiles: exec("import " + str) srcs = [ fn for fn in os.listdir('.') if fn.endswith(".pyc") ] and then to add srcs to the resources line in buildapp(). I don't include the main script "myApp.py" since python gets confused about the NIB stuff. Anyway, this approach doesn't work because not all of the files get compiled into *.pyc files. Is there any way to force this or is there another approach to building the app without sources? Thanks, Bob Swerdlow COO Transpose rsw...@tr... 207-781-8284 http://www.transpose.com ---------------------------------- Fight Spam! Add this link to your signature (as I did): http://wecanstopspam.org Click through to find out more. ---------------------------------- |
From: Bob S. <rsw...@tr...> - 2003-06-26 14:33:54
|
We have a Cocoa-based product using PyObjC that starts up some background processes. When the application quits, we want to stop them. As long as there are no errors, everything works fine - we create the processes in applicationDidFinishLaunching_ and kill them in applicationWillTerminate_ However, I noticed while debugging that if I got a python error that stopped the main process that the daemons would keep on running. applicationWillTerminate_ must not have been called. So, I decided to add a try/finally block in the main code: if __name__ == '__main__: try: AppHelper.runEventLoop() finally: MyController.stopDaemons() where MyController.stopDaemons() is a staticmethod that stops the background processes. However, I put print statements into stopDaemons and find that while it is called properly in applicationWillTerminate_, it does not seem to be called in the finally block when I quit the application. It is possible that quitting calls os._exit which according to Python in a Nutshell (p 274) does not invoke clean-up handlers. I'm not sure if this is the case, or if print cannot be called when the application is terminating. Is such a try/finally construct useful here? How do I ensure proper cleanup even on abnormal termination? Thanks for your help, Bob Swerdlow COO Transpose rsw...@tr... 207-781-8284 http://www.transpose.com ---------------------------------- Fight Spam! Add this link to your signature (as I did): http://wecanstopspam.org Click through to find out more. ---------------------------------- |
From: Ronald O. <ous...@ci...> - 2003-06-26 08:15:00
|
On Wednesday, Jun 25, 2003, at 20:26 Europe/Amsterdam, Kevin Marks wrote: > > On Wednesday, June 25, 2003, at 08:39 AM, bb...@ma... wrote: > >> (Sorry for the faulty repeat of Ronald's followup -- I'm on a >> ****slow**** connection.) >> >> First, change the class name 'ircController' to 'IRCController' -- it >> follows the Obj-C pattern and will reduce confusion (in that >> ircController in the code below really should be ircController). >> >> I also noticed that you are using multiple inheritance... >> >> class ircController(NibClassBuilder.AutoBaseClass, irclib.irc) I completely missed the MI stuff when I first looked at this. You shouldn't use MI with Cocoa classes, I'm actually suprised that this works at all as your supposed to get an exception when you use multiple inheritance. I guess I'll have to add a unittest and some documentation for this. The reason I don't want to allow multiple inheritance is twofold. First of all I want to keep 'Cocoa in Python' close to 'Cocoa in Objective-C' to make it easier to use existing Cocoa documentation. Furthermore, I haven't checked yet what I'd have to implement to cleanly support MI inherentence from Cocoa classes. This is harder than it might look, because we create "real" Objective-C classes. One other thing, if you call 'objc.setVerbose(1)' at the start of you script you'll get a traceback in the Console whenever PyObjC translates an exception from Python to Objective-C. That should give you some additional information that might allow you to pinpoint the problem your having. Ronald |
From: Kevin M. <kev...@ma...> - 2003-06-25 18:26:47
|
On Wednesday, June 25, 2003, at 08:39 AM, bb...@ma... wrote: > (Sorry for the faulty repeat of Ronald's followup -- I'm on a > ****slow**** connection.) > > First, change the class name 'ircController' to 'IRCController' -- it > follows the Obj-C pattern and will reduce confusion (in that > ircController in the code below really should be ircController). > > I also noticed that you are using multiple inheritance... > > class ircController(NibClassBuilder.AutoBaseClass, irclib.irc): > > .... but are initializing the irclib stuff in your connect method ... > > def connect_(self, sender): > irclib.irc.__init__(self) > > ... and would suggest an implementation pattern change to make the > code fall more in line with Model-View-Controller. Specifically, > create an instance of irclib.irc and store it as an instance variable > within your IRCConnection instance. > > If the end result works-- it should just as what you tried by adding > the argument should work (I think)-- then there would appear to be a > bug in the bridge related to multiple inheritance? > I'll try that, but that ends up with them both having pointers to each other, as the irc piece needs to call back into the Cocoa piece to show IRC messages. |
From: <bb...@ma...> - 2003-06-25 15:40:41
|
(Sorry for the faulty repeat of Ronald's followup -- I'm on a ****slow**** connection.) First, change the class name 'ircController' to 'IRCController' -- it follows the Obj-C pattern and will reduce confusion (in that ircController in the code below really should be ircController). I also noticed that you are using multiple inheritance... class ircController(NibClassBuilder.AutoBaseClass, irclib.irc): .... but are initializing the irclib stuff in your connect method ... def connect_(self, sender): irclib.irc.__init__(self) ... and would suggest an implementation pattern change to make the code fall more in line with Model-View-Controller. Specifically, create an instance of irclib.irc and store it as an instance variable within your IRCConnection instance. If the end result works-- it should just as what you tried by adding the argument should work (I think)-- then there would appear to be a bug in the bridge related to multiple inheritance? b.bum On Wednesday, Jun 25, 2003, at 02:51 US/Pacific, Kevin Marks wrote: > On Wednesday, June 25, 2003, at 02:39 AM, Ronald Oussoren wrote: >> >> Use 'def idle_(self, sender):', the colon at the end of the ObjC >> method name indicated that the method has an argument. > > that didn't help; > > 2003-06-25 02:46:40.712 iirc[2460] *** -[ircController idle:]: > selector not recognized > 2003-06-25 02:46:40.712 iirc[2460] *** NSTimer ignoring exception > 'NSInvalidArgumentException' (reason '*** -[ircController idle:]: > selector not recognized') that raised during posting of timer with > target 9057f0 and selector 'idle:' > > Omitting the argument and the colon gives: > > 2003-06-25 02:50:30.239 iirc[2464] *** -[ircController idle]: selector > not recognized > 2003-06-25 02:50:30.239 iirc[2464] *** NSTimer ignoring exception > 'NSInvalidArgumentException' (reason '*** -[ircController idle]: > selector not recognized') that raised during posting of timer with > target 9057f0 and selector 'idle' > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: INetU > Attention Web Developers & Consultants: Become An INetU Hosting > Partner. > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly > Commission! > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
From: <bb...@ma...> - 2003-06-25 15:31:36
|
On Tuesday, Jun 24, 2003, at 16:25 US/Pacific, Kevin Marks wrote: > self.timer = > NSTimer.scheduledTimerWithTimeInterval_target_selector_userInfo_repeats > _(1.0/30.0, self, 'idle:',0,1) > .... > def idle_(self): ... > Do I need to make a selector call? Try changing.... def idle_(self): .... ... to ... def idle_(self, userInfo): .... "idle:" requires two arguments -- for a method invoked by a timer, the second argument will be the userInfo object passed to the timer creation method. b.bum |