Re: [Pythonmac-SIG] appscript help - supposed to work?

2005-07-15 Thread has
Nicholas Riley wrote:

> > I seem to remember this used to work... I tried with a couple of
>> other apps too; same problem.
>
>And five seconds after sending that, I realize you're supposed to use
>foo.help() instead.  It would be nice if help() didn't barf quite as
>badly though.

Yep. Though I dunno if there's much can be done beyond squelching the 
pydoc-triggered error message. I'll patch this in the next release, though I 
don't think it really helps since you still won't get any help info from it. 
Pydoc makes assumptions about an object's structure that don't work very well 
on 'magic' objects like appscript's. Only solution I can think of would be to 
put in a feature request for a new magic method, __help__, that objects could 
optionally implement when they want to supply pydoc with their own choice of 
help data instead of it scraping this info itself.

has
-- 
http://freespace.virgin.net/hamish.sanderson/
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] appscript help - supposed to work?

2005-07-14 Thread Nicholas Riley
On Fri, Jul 15, 2005 at 01:20:58AM -0500, Nicholas Riley wrote:
> I seem to remember this used to work... I tried with a couple of
> other apps too; same problem.

And five seconds after sending that, I realize you're supposed to use
foo.help() instead.  It would be nice if help() didn't barf quite as
badly though.

-- 
Nicholas Riley <[EMAIL PROTECTED]> | 
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


[Pythonmac-SIG] appscript help - supposed to work?

2005-07-14 Thread Nicholas Riley
I just installed the appscript 0.13.0 and its multitude of
dependencies, and tried to get docs on Preview's scripting support; I
was rewarded with the following:

>>> from appscript import *
>>> p = app('Preview')
>>> help(p)
Traceback (most recent call last):
  File "", line 1, in ?
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site.py",
 line 308, in __call__
return pydoc.help(*args, **kwds)
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/pydoc.py",
 line 1547, in __call__
self.help(request)
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/pydoc.py",
 line 1583, in help
else: doc(request, 'Help on %s:')
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/pydoc.py",
 line 1368, in doc
object, name = resolve(thing, forceload)
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/pydoc.py",
 line 1363, in resolve
return thing, getattr(thing, '__name__', None)
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/appscript/specifier.py",
 line 257, in __getattr__
raise RuntimeError, "Unknown property, element or command: %r" % name
RuntimeError: Unknown property, element or command: '__name__'

I seem to remember this used to work... I tried with a couple of
other apps too; same problem.

-- 
Nicholas Riley <[EMAIL PROTECTED]> | 
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig