2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
:mod:`gensuitemodule` --- Generate OSA stub packages
|
|
|
|
====================================================
|
|
|
|
|
|
|
|
.. module:: gensuitemodule
|
|
|
|
:platform: Mac
|
|
|
|
:synopsis: Create a stub package from an OSA dictionary
|
|
|
|
.. sectionauthor:: Jack Jansen <Jack.Jansen@cwi.nl>
|
Merged revisions 59605-59624 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r59606 | georg.brandl | 2007-12-29 11:57:00 +0100 (Sat, 29 Dec 2007) | 2 lines
Some cleanup in the docs.
........
r59611 | martin.v.loewis | 2007-12-29 19:49:21 +0100 (Sat, 29 Dec 2007) | 2 lines
Bug #1699: Define _BSD_SOURCE only on OpenBSD.
........
r59612 | raymond.hettinger | 2007-12-29 23:09:34 +0100 (Sat, 29 Dec 2007) | 1 line
Simpler documentation for itertools.tee(). Should be backported.
........
r59613 | raymond.hettinger | 2007-12-29 23:16:24 +0100 (Sat, 29 Dec 2007) | 1 line
Improve docs for itertools.groupby(). The use of xrange(0) to create a unique object is less obvious than object().
........
r59620 | christian.heimes | 2007-12-31 15:47:07 +0100 (Mon, 31 Dec 2007) | 3 lines
Added wininst-9.0.exe executable for VS 2008
Integrated bdist_wininst into PCBuild9 directory
........
r59621 | christian.heimes | 2007-12-31 15:51:18 +0100 (Mon, 31 Dec 2007) | 1 line
Moved PCbuild directory to PC/VS7.1
........
r59622 | christian.heimes | 2007-12-31 15:59:26 +0100 (Mon, 31 Dec 2007) | 1 line
Fix paths for build bot
........
r59623 | christian.heimes | 2007-12-31 16:02:41 +0100 (Mon, 31 Dec 2007) | 1 line
Fix paths for build bot, part 2
........
r59624 | christian.heimes | 2007-12-31 16:18:55 +0100 (Mon, 31 Dec 2007) | 1 line
Renamed PCBuild9 directory to PCBuild
........
2007-12-31 12:14:33 -04:00
|
|
|
.. moduleauthor:: Jack Jansen
|
2007-08-15 11:28:22 -03:00
|
|
|
|
|
|
|
The :mod:`gensuitemodule` module creates a Python package implementing stub code
|
|
|
|
for the AppleScript suites that are implemented by a specific application,
|
|
|
|
according to its AppleScript dictionary.
|
|
|
|
|
|
|
|
It is usually invoked by the user through the :program:`PythonIDE`, but it can
|
|
|
|
also be run as a script from the command line (pass :option:`--help` for help on
|
|
|
|
the options) or imported from Python code. For an example of its use see
|
|
|
|
:file:`Mac/scripts/genallsuites.py` in a source distribution, which generates
|
|
|
|
the stub packages that are included in the standard library.
|
|
|
|
|
|
|
|
It defines the following public functions:
|
|
|
|
|
|
|
|
|
|
|
|
.. function:: is_scriptable(application)
|
|
|
|
|
|
|
|
Returns true if ``application``, which should be passed as a pathname, appears
|
|
|
|
to be scriptable. Take the return value with a grain of salt: :program:`Internet
|
|
|
|
Explorer` appears not to be scriptable but definitely is.
|
|
|
|
|
|
|
|
|
|
|
|
.. function:: processfile(application[, output, basepkgname, edit_modnames, creatorsignature, dump, verbose])
|
|
|
|
|
|
|
|
Create a stub package for ``application``, which should be passed as a full
|
|
|
|
pathname. For a :file:`.app` bundle this is the pathname to the bundle, not to
|
|
|
|
the executable inside the bundle; for an unbundled CFM application you pass the
|
|
|
|
filename of the application binary.
|
|
|
|
|
|
|
|
This function asks the application for its OSA terminology resources, decodes
|
|
|
|
these resources and uses the resultant data to create the Python code for the
|
|
|
|
package implementing the client stubs.
|
|
|
|
|
|
|
|
``output`` is the pathname where the resulting package is stored, if not
|
|
|
|
specified a standard "save file as" dialog is presented to the user.
|
|
|
|
``basepkgname`` is the base package on which this package will build, and
|
|
|
|
defaults to :mod:`StdSuites`. Only when generating :mod:`StdSuites` itself do
|
|
|
|
you need to specify this. ``edit_modnames`` is a dictionary that can be used to
|
|
|
|
change modulenames that are too ugly after name mangling. ``creator_signature``
|
|
|
|
can be used to override the 4-char creator code, which is normally obtained from
|
|
|
|
the :file:`PkgInfo` file in the package or from the CFM file creator signature.
|
|
|
|
When ``dump`` is given it should refer to a file object, and ``processfile``
|
|
|
|
will stop after decoding the resources and dump the Python representation of the
|
|
|
|
terminology resources to this file. ``verbose`` should also be a file object,
|
|
|
|
and specifying it will cause ``processfile`` to tell you what it is doing.
|
|
|
|
|
|
|
|
|
|
|
|
.. function:: processfile_fromresource(application[, output, basepkgname, edit_modnames, creatorsignature, dump, verbose])
|
|
|
|
|
|
|
|
This function does the same as ``processfile``, except that it uses a different
|
|
|
|
method to get the terminology resources. It opens ``application`` as a resource
|
|
|
|
file and reads all ``"aete"`` and ``"aeut"`` resources from this file.
|
|
|
|
|