72
If the
arguments
dictionary contains an entry for
key
convert the value for that entry
according to dictionary
edict
. This converts human-readable Python enumeration
names to the OSA 4-character codes. Used by the generated suite packages.
The
aetools
module defines the following class:
class
aetools.
TalkTo
(
[
signature=None, start=0, timeout=0
]
)
Base class for the proxy used to talk to an application.
signature
overrides the class
attribute
_signature
(which is usually set by subclasses) and is the 4-char creator
code defining the application to talk to.
start
can be set to true to enable running the
application on class instantiation.
timeout
can be specified to change the default
timeout used while waiting for an AppleEvent reply.
TalkTo.
_start
()
Test whether the application is running, and attempt to start it if not.
TalkTo.
send
(
code, subcode
[
, parameters, attributes
]
)
Create the AppleEvent
Carbon.AE.AEDesc
for the verb with the OSA designation
code,
subcode
(which are the usual 4-character strings), pack the
parameters
and
attributes
into it, send it to the target application, wait for the reply, unpack the reply
with
unpackevent
and return the reply appleevent, the unpacked return values as a
dictionary and the return attributes.
index
modules |
next |
previous |
Python » Python v2.7.6 documentation » The Python Standard Library » 37. MacPython
OSA Modules »
© Copyright
1990-2013, Python Software Foundation.
The Python Software Foundation is a non-profit corporation. Please donate.
Last updated on Nov 10, 2013. Found a bug
?
Created using Sphinx
1.0.7.
Online Change your PDF file Permission Settings easy as possible to change your PDF file permission settings. You can receive the locked PDF by simply clicking download and you are good to go!. Web Security.
add security to pdf file; convert locked pdf to word online
68
index
modules |
next |
previous |
37.3.
aepack
— Conversion between Python
variables and AppleEvent data containers
Platforms: Mac
The
aepack
module defines functions for converting (packing) Python variables to
AppleEvent descriptors and back (unpacking). Within Python the AppleEvent descriptor is
handled by Python objects of built-in type
AEDesc
, defined in module
Carbon.AE
.
Note: This module has been removed in Python 3.x.
The
aepack
module defines the following functions:
aepack.
pack
(
x
[
, forcetype
]
)
Returns an
AEDesc
object containing a conversion of Python value x. If forcetype is
provided it specifies the descriptor type of the result. Otherwise, a default mapping of
Python types to Apple Event descriptor types is used, as follows:
Python type
descriptor type
FSSpec
typeFSS
FSRef
typeFSRef
Alias
typeAlias
integer
typeLong (32 bit integer)
float
typeFloat (64 bit floating
point)
string
typeText
unicode
typeUnicodeText
list
typeAEList
dictionary
typeAERecord
instance
see below
If x is a Python instance then this function attempts to call an
__aepack__()
method.
This method should return an
AEDesc
object.
If the conversion x is not defined above, this function returns the Python string
representation of a value (the repr() function) encoded as a text descriptor.
Python » Python v2.7.6 documentation » The Python Standard Library » 37. MacPython
OSA Modules »
59
aepack.
unpack
(
x
[
, formodulename
]
)
x must be an object of type
AEDesc
. This function returns a Python object
representation of the data in the Apple Event descriptor x. Simple AppleEvent data
types (integer, text, float) are returned as their obvious Python counterparts. Apple
Event lists are returned as Python lists, and the list elements are recursively
unpacked. Object references (ex.
line 3 of document 1
) are returned as instances
o f
aetypes.ObjectSpecifier
, unless
formodulename
is specified. AppleEvent
descriptors with descriptor type typeFSS are returned as
FSSpec
objects. AppleEvent
record descriptors are returned as Python dictionaries, with 4-character string keys
and elements recursively unpacked.
The optional
formodulename
argument is used by the stub packages generated by
gensuitemodule
, and ensures that the OSA classes for object specifiers are looked up
in the correct module. This ensures that if, say, the Finder returns an object specifier
for a window you get an instance of
Finder.Window
and not a generic
aetypes.Window
. The former knows about all the properties and elements a window
has in the Finder, while the latter knows no such things.
See also:
Module
Carbon.AE
Built-in access to Apple Event Manager routines.
Module
aetypes
Python definitions of codes for Apple Event descriptor types.
index
modules |
next |
previous |
Python » Python v2.7.6 documentation » The Python Standard Library » 37. MacPython
OSA Modules »
© Copyright
1990-2013, Python Software Foundation.
The Python Software Foundation is a non-profit corporation. Please donate.
Last updated on Nov 10, 2013. Found a bug
?
Created using Sphinx
1.0.7.
Online Remove password from protected PDF file If we need a password from you, it will not be read or stored. To hlep protect your PDF document in C# project, XDoc.PDF provides some PDF security settings.
copy from locked pdf; decrypt pdf online
72
index
modules |
next |
previous |
37.4.
aetypes
— AppleEvent objects
Platforms: Mac
The
aetypes
defines classes used to represent Apple Event data descriptors and Apple
Event object specifiers.
Apple Event data is contained in descriptors, and these descriptors are typed. For many
descriptors the Python representation is simply the corresponding Python type:
typeText
in OSA is a Python string,
typeFloat
is a float, etc. For OSA types that have no direct
Python counterpart this module declares classes. Packing and unpacking instances of
these classes is handled automatically by
aepack
.
An object specifier is essentially an address of an object implemented in a Apple Event
server. An Apple Event specifier is used as the direct object for an Apple Event or as the
argument of an optional parameter. The
aetypes
module contains the base classes for
OSA classes and properties, which are used by the packages generated by
gensuitemodule
to populate the classes and properties in a given suite.
For reasons of backward compatibility, and for cases where you need to script an
application for which you have not generated the stub package this module also contains
object specifiers for a number of common OSA classes such as
Document
,
Window
,
Character
, etc.
Note: This module has been removed in Python 3.x.
The
AEObjects
module defines the following classes to represent Apple Event descriptor
data:
class
aetypes.
Unknown
(
type, data
)
The representation of OSA descriptor data for which the
aepack
and
aetypes
modules
have no support, i.e. anything that is not represented by the other classes here and
that is not equivalent to a simple Python value.
class
aetypes.
Enum
(
enum
)
An enumeration value with the given 4-character string value.
class
aetypes.
InsertionLoc
(
of, pos
)
Python » Python v2.7.6 documentation » The Python Standard Library » 37. MacPython
OSA Modules »
C# HTML5 Viewer: Deployment on AzureCloudService RasterEdge.XDoc.PDF.HTML5Editor.dll. system.webServer> <validation validateIntegratedModeConfiguration="false"/> <security> <requestFiltering
decrypt pdf with password; change pdf document security properties C# HTML5 Viewer: Deployment on ASP.NET MVC RasterEdge.XDoc.PDF.HTML5Editor.dll. system.webServer> <validation validateIntegratedModeConfiguration="false"/> <security> <requestFiltering
pdf security settings; create secure pdf
110
Position
pos
in object
of
.
class
aetypes.
Boolean
(
bool
)
A boolean.
class
aetypes.
StyledText
(
style, text
)
Text with style information (font, face, etc) included.
class
aetypes.
AEText
(
script, style, text
)
Text with script system and style information included.
class
aetypes.
IntlText
(
script, language, text
)
Text with script system and language information included.
class
aetypes.
IntlWritingCode
(
script, language
)
Script system and language information.
class
aetypes.
QDPoint
(
v, h
)
A quickdraw point.
class
aetypes.
QDRectangle
(
v0, h0, v1, h1
)
A quickdraw rectangle.
class
aetypes.
RGBColor
(
r, g, b
)
A color.
class
aetypes.
Type
(
type
)
An OSA type value with the given 4-character name.
class
aetypes.
Keyword
(
name
)
An OSA keyword with the given 4-character name.
class
aetypes.
Range
(
start, stop
)
A range.
class
aetypes.
Ordinal
(
abso
)
Non-numeric absolute positions, such as
"firs"
, first, or
"midd"
, middle.
class
aetypes.
Logical
(
logc, term
)
The logical expression of applying operator
logc
to
term
.
class
aetypes.
Comparison
(
obj1, relo, obj2
)
68
The comparison
relo
of
obj1
to
obj2
.
The following classes are used as base classes by the generated stub packages to
represent AppleScript classes and properties in Python:
class
aetypes.
ComponentItem
(
which
[
, fr
]
)
Abstract baseclass for an OSA class. The subclass should set the class attribute
want
to the 4-character OSA class code. Instances of subclasses of this class are
equivalent to AppleScript Object Specifiers. Upon instantiation you should pass a
selector in
which
, and optionally a parent object in
fr
.
class
aetypes.
NProperty
(
fr
)
Abstract baseclass for an OSA property. The subclass should set the class attributes
want
and
which
to designate which property we are talking about. Instances of
subclasses of this class are Object Specifiers.
class
aetypes.
ObjectSpecifier
(
want, form, seld
[
, fr
]
)
Base class of
ComponentItem
and
NProperty
, a general OSA Object Specifier. See the
Apple Open Scripting Architecture documentation for the parameters. Note that this
class is not abstract.
index
modules |
next |
previous |
Python » Python v2.7.6 documentation » The Python Standard Library » 37. MacPython
OSA Modules »
© Copyright
1990-2013, Python Software Foundation.
The Python Software Foundation is a non-profit corporation. Please donate.
Last updated on Nov 10, 2013. Found a bug
?
Created using Sphinx
1.0.7.
73
index
modules |
next |
previous |
37.5.
MiniAEFrame
— Open Scripting
Architecture server support
Platforms: Mac
The module
MiniAEFrame
provides a framework for an application that can function as an
Open Scripting Architecture (OSA) server, i.e. receive and process AppleEvents. It can
be used in conjunction with
FrameWork
or standalone. As an example, it is used in
PythonCGISlave.
The
MiniAEFrame
module defines the following classes:
class
MiniAEFrame.
AEServer
A class that handles AppleEvent dispatch. Your application should subclass this class
together with either
MiniApplication
or
FrameWork.Application
. Your
__init__()
method should call the
__init__()
method for both classes.
class
MiniAEFrame.
MiniApplication
A class that is more or less compatible with
FrameWork.Application
but with less
functionality. Its event loop supports the apple menu, command-dot and AppleEvents;
other events are passed on to the Python interpreter and/or Sioux. Useful if your
application wants to use
AEServer
but does not provide its own windows, etc.
37.5.1. AEServer Objects
AEServer.
installaehandler
(
classe, type, callback
)
Installs an AppleEvent handler. classe and type are the four-character OSA Class and
Type designators,
'****'
wildcards are allowed. When a matching AppleEvent is
received the parameters are decoded and your callback is invoked.
AEServer.
callback
(
_object, **kwargs
)
Your callback is called with the OSA Direct Object as first positional parameter. The
other parameters are passed as keyword arguments, with the 4-character designator
as name. Three extra keyword parameters are passed:
_class
and
_type
are the
Class and Type designators and
_attributes
is a dictionary with the AppleEvent
attributes.
Python » Python v2.7.6 documentation » The Python Standard Library » 37. MacPython
OSA Modules »
21
The return value of your method is packed with
aetools.packevent()
and sent as
reply.
Note that there are some serious problems with the current design. AppleEvents which
have non-identifier 4-character designators for arguments are not implementable, and it
is not possible to return an error to the originator. This will be addressed in a future
release.
index
modules |
next |
previous |
Python » Python v2.7.6 documentation » The Python Standard Library » 37. MacPython
OSA Modules »
© Copyright
1990-2013, Python Software Foundation.
The Python Software Foundation is a non-profit corporation. Please donate.
Last updated on Nov 10, 2013. Found a bug
?
Created using Sphinx
1.0.7.
72
index
modules |
next |
previous |
38. SGI IRIX Specific Services
The modules described in this chapter provide interfaces to features that are unique to
SGI’s IRIX operating system (versions 4 and 5).
38.1.
al
— Audio functions on the SGI
38.1.1. Configuration Objects
38.1.2. Port Objects
38.2.
AL
— Constants used with the
al
module
38.3.
cd
— CD-ROM access on SGI systems
38.3.1. Player Objects
38.3.2. Parser Objects
38.4.
fl
— FORMS library for graphical user interfaces
38.4.1. Functions Defined in Module
fl
38.4.2. Form Objects
38.4.3. FORMS Objects
38.5.
FL
— Constants used with the
fl
module
38.6.
flp
— Functions for loading stored FORMS designs
38.7.
fm
— Font Manager interface
38.8.
gl
— Graphics Library interface
38.9.
DEVICE
— Constants used with the
gl
module
38.10.
GL
— Constants used with the
gl
module
38.11.
imgfile
— Support for SGI imglib files
38.12.
jpeg
— Read and write JPEG files
index
modules |
next |
previous |
Python » Python v2.7.6 documentation » The Python Standard Library »
Python » Python v2.7.6 documentation » The Python Standard Library »
© Copyright
1990-2013, Python Software Foundation.
The Python Software Foundation is a non-profit corporation. Please donate.
Last updated on Nov 10, 2013. Found a bug
?
Created using Sphinx
1.0.7.
Documents you may be interested
Documents you may be interested