Re: [Pythonmac-SIG] Having trouble installing Panther python packages

2005-03-24 Thread nmadnani
Hi Everyone I was able to fix the problem as Robert said. Thanks so much for all your suggestions !! Nitin On Mar 24, 2005, at 8:33 PM, Robert Kern wrote: Bob Ippolito wrote: On Mar 24, 2005, at 6:14 PM, Martina Oefelein wrote: Everytime I unzip the file and install the .mpkg file, I get the fol

Re: [Pythonmac-SIG] Having trouble installing Panther python packages

2005-03-24 Thread Robert Kern
Bob Ippolito wrote: On Mar 24, 2005, at 6:14 PM, Martina Oefelein wrote: Everytime I unzip the file and install the .mpkg file, I get the following error: "The InstallationCheck tool is either not exectutable or not readable." did you use unzip to decompress the archive? Apparently unzip doesn't

Re: [Pythonmac-SIG] Having trouble installing Panther python packages

2005-03-24 Thread Bob Ippolito
On Mar 24, 2005, at 6:14 PM, Martina Oefelein wrote: Everytime I unzip the file and install the .mpkg file, I get the following error: "The InstallationCheck tool is either not exectutable or not readable." did you use unzip to decompress the archive? Apparently unzip doesn't preserve "execute"

Re: [Pythonmac-SIG] XML handler design

2005-03-24 Thread Martina Oefelein
Hi Henning, My first attempt used DOM, but I get a cleaner, more readable, better extendable code with SAX. If you want a cleaner coder, you give might one of the more "pythonic" XML APIs, like ElementTree or XIST a try. ElementTree: http://effbot.org/zone/element-index.htm XIST: http://www.livin

Re: [Pythonmac-SIG] Having trouble installing Panther python packages

2005-03-24 Thread Martina Oefelein
Hi Nitin! Everytime I unzip the file and install the .mpkg file, I get the following error: "The InstallationCheck tool is either not exectutable or not readable." did you use unzip to decompress the archive? Apparently unzip doesn't preserve "execute" rights. Try another decompressor. Stuffit Ex

Re: [Pythonmac-SIG] Copying to clipboard (pasteboard)

2005-03-24 Thread Bob Ippolito
On Mar 24, 2005, at 9:57 AM, Jeremy Conlin wrote: I figured out how to do this with a lot of trial and error. You can use Carbon or AppKit/Foundation. - import Carbon.Scrap, AppKit, Foundation def clipcopy(arg): Carbon.Scrap.ClearCurrentScr

RE: [Pythonmac-SIG] Copying to clipboard (pasteboard)

2005-03-24 Thread Schollnick, Benjamin
> > import Carbon.Scrap, AppKit, Foundation > > > > def clipcopy(arg): > > Carbon.Scrap.ClearCurrentScrap() > > scrap = Carbon.Scrap.GetCurrentScrap() > > scrap.PutScrapFlavor('TEXT', 0, arg) > That worked! Thanks a bunch. > (Now I get to show what kind of a newbie I am.) Why should

Re: [Pythonmac-SIG] Copying to clipboard (pasteboard)

2005-03-24 Thread Jeremy Conlin
I figured out how to do this with a lot of trial and error. You can use Carbon or AppKit/Foundation. - import Carbon.Scrap, AppKit, Foundation def clipcopy(arg): Carbon.Scrap.ClearCurrentScrap() scrap = Carbon.Scrap.GetCurrentScrap(

Re: [Pythonmac-SIG] XML handler design

2005-03-24 Thread Eric Nieuwland
<[EMAIL PROTECTED]> wrote: As you see my get methods aren't much more than redirections to the object's own methods - one could access them directly via MyHandler.pages[12] or MyHandler.pages,getSortedArray() Yes, I see it. What I tried to explain is that I use the factory pattern (well, sort of)

RE: [Pythonmac-SIG] XML handler design

2005-03-24 Thread Henning.Ramm
def getPages(self): return self.pages.getSortedArray() def getPage(self, no): return self.pages[no] >My style is to create/build a data structure in the parser and have a >single get... method that will give me the result. >Your getPage/getPages would be part of t

RE: [Pythonmac-SIG] XML handler design

2005-03-24 Thread Henning.Ramm
>> And where should the "output" go to? >> All examples use print statements in the element handlers. >I'm not certain we are clear. Instead of output statements you >store the data in some instance variable - in your case it appears >self.pages is your instance variable containing the data. Rig

Re: [Pythonmac-SIG] XML handler design

2005-03-24 Thread Eric Nieuwland
<[EMAIL PROTECTED]> wrote: def startElement(self, name, attrs): self._queue.append(name) # keep the order of processed tags handler = str('_start_'+name) if hasattr(self, handler): self.__class__.__dict__[handler](self, attrs) Is there a better syntax for self.__class__.__dict_

RE: [Pythonmac-SIG] XML handler design

2005-03-24 Thread Henning.Ramm
>> Is there a better syntax for self.__class__.__dict__[handler]? >how about: > handler = getattr(self, str('_start_'+name),None) ># fetch the actual bound method > if handler is not None: > handler( attrs ) That's good, I think. Thank you. >or so

Re: [Pythonmac-SIG] XML handler design

2005-03-24 Thread David Reed
On Mar 24, 2005, at 8:35 AM, [EMAIL PROTECTED] wrote: David Reed wrote: There's probably a better mailing list with XML parsing experts. I'm certainly not an expert but have done a little XML parsing. I've always followed the pattern of using startElement, characters and endElement to grab all the

Re: [Pythonmac-SIG] XML handler design

2005-03-24 Thread Steve Spicklemire
Hi Henning, def startElement(self, name, attrs): self._queue.append(name) # keep the order of processed tags handler = str('_start_'+name) if hasattr(self, handler): self.__class__.__dict__[handler](self, attrs) Is there a better syntax for self.__class__.__dict__[handler]? ho

RE: [Pythonmac-SIG] XML handler design

2005-03-24 Thread Henning.Ramm
David Reed wrote: >There's probably a better mailing list with XML parsing experts. I'm >certainly not an expert but have done a little XML parsing. >I've always >followed the pattern of using startElement, characters and endElement >to grab all the data. In the startElement method you set a i

[Pythonmac-SIG] Embedding with CW6

2005-03-24 Thread Steve Spicklemire
Hi Folks, Back in the pretty old days (python 1.5 or so I think) I developed a Macromedia Director (MMD) scripting Xtra that allowed Lingo scripts to use python as an embedded language. It worked great... but I moved on and haven't done anything Carbon in years. Now I find myself in a situation

[Pythonmac-SIG] XML handler design

2005-03-24 Thread Henning.Ramm
Hi there! I just wrote a SAX handler for XML files that describe a newspaper issue (list of pages etc.); I'd like to know if I could do it better. def startElement(self, name, attrs): """call an own handler method named _start_Something for a Something element if it exists, to avoid