forked from AFPy/python-docs-fr
135 lines
5.1 KiB
Plaintext
135 lines
5.1 KiB
Plaintext
# SOME DESCRIPTIVE TITLE.
|
|
# Copyright (C) 1990-2016, Python Software Foundation
|
|
# This file is distributed under the same license as the Python package.
|
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
|
#
|
|
#, fuzzy
|
|
msgid ""
|
|
msgstr ""
|
|
"Project-Id-Version: Python 2.7\n"
|
|
"Report-Msgid-Bugs-To: \n"
|
|
"POT-Creation-Date: 2016-10-30 10:44+0100\n"
|
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
"MIME-Version: 1.0\n"
|
|
"Content-Type: text/plain; charset=UTF-8\n"
|
|
"Content-Transfer-Encoding: 8bit\n"
|
|
|
|
#: ../Doc/library/macosa.rst:6
|
|
msgid "MacPython OSA Modules"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/macosa.rst:8
|
|
msgid ""
|
|
"This chapter describes the current implementation of the Open Scripting "
|
|
"Architecture (OSA, also commonly referred to as AppleScript) for Python, "
|
|
"allowing you to control scriptable applications from your Python program, "
|
|
"and with a fairly pythonic interface. Development on this set of modules has "
|
|
"stopped."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/macosa.rst:14
|
|
msgid ""
|
|
"For a description of the various components of AppleScript and OSA, and to "
|
|
"get an understanding of the architecture and terminology, you should read "
|
|
"Apple's documentation. The \"Applescript Language Guide\" explains the "
|
|
"conceptual model and the terminology, and documents the standard suite. The "
|
|
"\"Open Scripting Architecture\" document explains how to use OSA from an "
|
|
"application programmers point of view. In the Apple Help Viewer these books "
|
|
"are located in the Developer Documentation, Core Technologies section."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/macosa.rst:22
|
|
msgid ""
|
|
"As an example of scripting an application, the following piece of "
|
|
"AppleScript will get the name of the frontmost :program:`Finder` window and "
|
|
"print it::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/macosa.rst:29
|
|
msgid "In Python, the following code fragment will do the same::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/macosa.rst:36
|
|
msgid ""
|
|
"As distributed the Python library includes packages that implement the "
|
|
"standard suites, plus packages that interface to a small number of common "
|
|
"applications."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/macosa.rst:39
|
|
msgid ""
|
|
"To send AppleEvents to an application you must first create the Python "
|
|
"package interfacing to the terminology of the application (what :program:"
|
|
"`Script Editor` calls the \"Dictionary\"). This can be done from within the :"
|
|
"program:`PythonIDE` or by running the :file:`gensuitemodule.py` module as a "
|
|
"standalone program from the command line."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/macosa.rst:45
|
|
msgid ""
|
|
"The generated output is a package with a number of modules, one for every "
|
|
"suite used in the program plus an :mod:`__init__` module to glue it all "
|
|
"together. The Python inheritance graph follows the AppleScript inheritance "
|
|
"graph, so if a program's dictionary specifies that it includes support for "
|
|
"the Standard Suite, but extends one or two verbs with extra arguments then "
|
|
"the output suite will contain a module :mod:`Standard_Suite` that imports "
|
|
"and re-exports everything from :mod:`StdSuites.Standard_Suite` but overrides "
|
|
"the methods that have extra functionality. The output of :mod:"
|
|
"`gensuitemodule` is pretty readable, and contains the documentation that was "
|
|
"in the original AppleScript dictionary in Python docstrings, so reading it "
|
|
"is a good source of documentation."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/macosa.rst:56
|
|
msgid ""
|
|
"The output package implements a main class with the same name as the package "
|
|
"which contains all the AppleScript verbs as methods, with the direct object "
|
|
"as the first argument and all optional parameters as keyword arguments. "
|
|
"AppleScript classes are also implemented as Python classes, as are "
|
|
"comparisons and all the other thingies."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/macosa.rst:62
|
|
msgid ""
|
|
"The main Python class implementing the verbs also allows access to the "
|
|
"properties and elements declared in the AppleScript class \"application\". "
|
|
"In the current release that is as far as the object orientation goes, so in "
|
|
"the example above we need to use ``f.get(f.window(1).name)`` instead of the "
|
|
"more Pythonic ``f.window(1).name.get()``."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/macosa.rst:68
|
|
msgid ""
|
|
"If an AppleScript identifier is not a Python identifier the name is mangled "
|
|
"according to a small number of rules:"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/macosa.rst:71
|
|
msgid "spaces are replaced with underscores"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/macosa.rst:73
|
|
msgid ""
|
|
"other non-alphanumeric characters are replaced with ``_xx_`` where ``xx`` is "
|
|
"the hexadecimal character value"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/macosa.rst:76
|
|
msgid "any Python reserved word gets an underscore appended"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/macosa.rst:78
|
|
msgid ""
|
|
"Python also has support for creating scriptable applications in Python, but "
|
|
"The following modules are relevant to MacPython AppleScript support:"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/macosa.rst:90
|
|
msgid ""
|
|
"In addition, support modules have been pre-generated for :mod:`Finder`, :mod:"
|
|
"`Terminal`, :mod:`Explorer`, :mod:`Netscape`, :mod:`CodeWarrior`, :mod:"
|
|
"`SystemEvents` and :mod:`StdSuites`."
|
|
msgstr ""
|