Пример #1
0
def mkobject(dict):
    want = dict['want'].type
    form = dict['form'].enum
    seld = dict['seld']
    fr = dict['from']
    if form in ('name', 'indx', 'rang', 'test'):
        if want == 'text':
            return aetypes.Text(seld, fr)
        if want == 'cha ':
            return aetypes.Character(seld, fr)
        if want == 'cwor':
            return aetypes.Word(seld, fr)
        if want == 'clin':
            return aetypes.Line(seld, fr)
        if want == 'cpar':
            return aetypes.Paragraph(seld, fr)
        if want == 'cwin':
            return aetypes.Window(seld, fr)
        if want == 'docu':
            return aetypes.Document(seld, fr)
        if want == 'file':
            return aetypes.File(seld, fr)
        if want == 'cins':
            return aetypes.InsertionPoint(seld, fr)
    return aetypes.Property(
        seld.type, fr) if want == 'prop' and form == 'prop' and aetypes.IsType(
            seld) else aetypes.ObjectSpecifier(want, form, seld, fr)
Пример #2
0
"""Tools for use in AppleEvent clients and servers: