aetypes.py 14.7 KB
Newer Older
1 2
"""aetypes - Python objects representing various AE types."""

3
from warnings import warnpy3k
Benjamin Peterson's avatar
Benjamin Peterson committed
4
warnpy3k("In 3.x, the aetypes module is removed.", stacklevel=2)
5

6
from Carbon.AppleEvents import *
7 8 9 10 11 12 13 14
import struct
from types import *
import string

#
# convoluted, since there are cyclic dependencies between this file and
# aetools_convert.
#
15
def pack(*args, **kwargs):
Jack Jansen's avatar
Jack Jansen committed
16 17
    from aepack import pack
    return pack( *args, **kwargs)
18

19
def nice(s):
Jack Jansen's avatar
Jack Jansen committed
20 21 22
    """'nice' representation of an object"""
    if type(s) is StringType: return repr(s)
    else: return str(s)
23 24

class Unknown:
Jack Jansen's avatar
Jack Jansen committed
25
    """An uninterpreted AE object"""
26

Jack Jansen's avatar
Jack Jansen committed
27 28 29
    def __init__(self, type, data):
        self.type = type
        self.data = data
30

Jack Jansen's avatar
Jack Jansen committed
31
    def __repr__(self):
32
        return "Unknown(%r, %r)" % (self.type, self.data)
33

Jack Jansen's avatar
Jack Jansen committed
34 35
    def __aepack__(self):
        return pack(self.data, self.type)
36 37

class Enum:
Jack Jansen's avatar
Jack Jansen committed
38
    """An AE enumeration value"""
39

Jack Jansen's avatar
Jack Jansen committed
40 41
    def __init__(self, enum):
        self.enum = "%-4.4s" % str(enum)
42

Jack Jansen's avatar
Jack Jansen committed
43
    def __repr__(self):
44
        return "Enum(%r)" % (self.enum,)
45

Jack Jansen's avatar
Jack Jansen committed
46 47
    def __str__(self):
        return string.strip(self.enum)
48

Jack Jansen's avatar
Jack Jansen committed
49 50
    def __aepack__(self):
        return pack(self.enum, typeEnumeration)
51 52

def IsEnum(x):
Jack Jansen's avatar
Jack Jansen committed
53
    return isinstance(x, Enum)
54 55

def mkenum(enum):
Jack Jansen's avatar
Jack Jansen committed
56 57
    if IsEnum(enum): return enum
    return Enum(enum)
58

59 60
# Jack changed the way this is done
class InsertionLoc:
Jack Jansen's avatar
Jack Jansen committed
61 62 63
    def __init__(self, of, pos):
        self.of = of
        self.pos = pos
64

Jack Jansen's avatar
Jack Jansen committed
65
    def __repr__(self):
66
        return "InsertionLoc(%r, %r)" % (self.of, self.pos)
67

Jack Jansen's avatar
Jack Jansen committed
68 69 70
    def __aepack__(self):
        rec = {'kobj': self.of, 'kpos': self.pos}
        return pack(rec, forcetype='insl')
71

72 73
# Convenience functions for dsp:
def beginning(of):
Jack Jansen's avatar
Jack Jansen committed
74
    return InsertionLoc(of, Enum('bgng'))
75

76
def end(of):
Jack Jansen's avatar
Jack Jansen committed
77
    return InsertionLoc(of, Enum('end '))
78

79
class Boolean:
Jack Jansen's avatar
Jack Jansen committed
80
    """An AE boolean value"""
81

Jack Jansen's avatar
Jack Jansen committed
82 83
    def __init__(self, bool):
        self.bool = (not not bool)
84

Jack Jansen's avatar
Jack Jansen committed
85
    def __repr__(self):
86
        return "Boolean(%r)" % (self.bool,)
87

Jack Jansen's avatar
Jack Jansen committed
88 89 90 91 92
    def __str__(self):
        if self.bool:
            return "True"
        else:
            return "False"
93

Jack Jansen's avatar
Jack Jansen committed
94 95
    def __aepack__(self):
        return pack(struct.pack('b', self.bool), 'bool')
96 97

def IsBoolean(x):
Jack Jansen's avatar
Jack Jansen committed
98
    return isinstance(x, Boolean)
99 100

def mkboolean(bool):
Jack Jansen's avatar
Jack Jansen committed
101 102
    if IsBoolean(bool): return bool
    return Boolean(bool)
103 104

class Type:
Jack Jansen's avatar
Jack Jansen committed
105
    """An AE 4-char typename object"""
106

Jack Jansen's avatar
Jack Jansen committed
107 108
    def __init__(self, type):
        self.type = "%-4.4s" % str(type)
109

Jack Jansen's avatar
Jack Jansen committed
110
    def __repr__(self):
111
        return "Type(%r)" % (self.type,)
112

Jack Jansen's avatar
Jack Jansen committed
113 114
    def __str__(self):
        return string.strip(self.type)
115

Jack Jansen's avatar
Jack Jansen committed
116 117
    def __aepack__(self):
        return pack(self.type, typeType)
118 119

def IsType(x):
Jack Jansen's avatar
Jack Jansen committed
120
    return isinstance(x, Type)
121 122

def mktype(type):
Jack Jansen's avatar
Jack Jansen committed
123 124
    if IsType(type): return type
    return Type(type)
125 126 127


class Keyword:
Jack Jansen's avatar
Jack Jansen committed
128
    """An AE 4-char keyword object"""
129

Jack Jansen's avatar
Jack Jansen committed
130 131
    def __init__(self, keyword):
        self.keyword = "%-4.4s" % str(keyword)
132

Jack Jansen's avatar
Jack Jansen committed
133
    def __repr__(self):
134
        return "Keyword(%r)" % `self.keyword`
135

Jack Jansen's avatar
Jack Jansen committed
136 137
    def __str__(self):
        return string.strip(self.keyword)
138

Jack Jansen's avatar
Jack Jansen committed
139 140
    def __aepack__(self):
        return pack(self.keyword, typeKeyword)
141 142

def IsKeyword(x):
Jack Jansen's avatar
Jack Jansen committed
143
    return isinstance(x, Keyword)
144 145

class Range:
Jack Jansen's avatar
Jack Jansen committed
146
    """An AE range object"""
147

Jack Jansen's avatar
Jack Jansen committed
148 149 150
    def __init__(self, start, stop):
        self.start = start
        self.stop = stop
151

Jack Jansen's avatar
Jack Jansen committed
152
    def __repr__(self):
153
        return "Range(%r, %r)" % (self.start, self.stop)
154

Jack Jansen's avatar
Jack Jansen committed
155 156
    def __str__(self):
        return "%s thru %s" % (nice(self.start), nice(self.stop))
157

Jack Jansen's avatar
Jack Jansen committed
158 159
    def __aepack__(self):
        return pack({'star': self.start, 'stop': self.stop}, 'rang')
160 161

def IsRange(x):
Jack Jansen's avatar
Jack Jansen committed
162
    return isinstance(x, Range)
163 164

class Comparison:
Jack Jansen's avatar
Jack Jansen committed
165
    """An AE Comparison"""
166

Jack Jansen's avatar
Jack Jansen committed
167 168 169 170
    def __init__(self, obj1, relo, obj2):
        self.obj1 = obj1
        self.relo = "%-4.4s" % str(relo)
        self.obj2 = obj2
171

Jack Jansen's avatar
Jack Jansen committed
172
    def __repr__(self):
173
        return "Comparison(%r, %r, %r)" % (self.obj1, self.relo, self.obj2)
174

Jack Jansen's avatar
Jack Jansen committed
175 176
    def __str__(self):
        return "%s %s %s" % (nice(self.obj1), string.strip(self.relo), nice(self.obj2))
177

Jack Jansen's avatar
Jack Jansen committed
178 179 180 181 182
    def __aepack__(self):
        return pack({'obj1': self.obj1,
                 'relo': mkenum(self.relo),
                 'obj2': self.obj2},
                'cmpd')
183 184

def IsComparison(x):
Jack Jansen's avatar
Jack Jansen committed
185
    return isinstance(x, Comparison)
186

187
class NComparison(Comparison):
Jack Jansen's avatar
Jack Jansen committed
188
    # The class attribute 'relo' must be set in a subclass
189

Jack Jansen's avatar
Jack Jansen committed
190 191
    def __init__(self, obj1, obj2):
        Comparison.__init__(obj1, self.relo, obj2)
192 193

class Ordinal:
Jack Jansen's avatar
Jack Jansen committed
194
    """An AE Ordinal"""
195

Jack Jansen's avatar
Jack Jansen committed
196 197 198
    def __init__(self, abso):
#       self.obj1 = obj1
        self.abso = "%-4.4s" % str(abso)
199

Jack Jansen's avatar
Jack Jansen committed
200
    def __repr__(self):
201
        return "Ordinal(%r)" % (self.abso,)
202

Jack Jansen's avatar
Jack Jansen committed
203 204
    def __str__(self):
        return "%s" % (string.strip(self.abso))
205

Jack Jansen's avatar
Jack Jansen committed
206 207
    def __aepack__(self):
        return pack(self.abso, 'abso')
208 209

def IsOrdinal(x):
Jack Jansen's avatar
Jack Jansen committed
210
    return isinstance(x, Ordinal)
211

212
class NOrdinal(Ordinal):
Jack Jansen's avatar
Jack Jansen committed
213
    # The class attribute 'abso' must be set in a subclass
214

Jack Jansen's avatar
Jack Jansen committed
215 216
    def __init__(self):
        Ordinal.__init__(self, self.abso)
217 218

class Logical:
Jack Jansen's avatar
Jack Jansen committed
219
    """An AE logical expression object"""
220

Jack Jansen's avatar
Jack Jansen committed
221 222 223
    def __init__(self, logc, term):
        self.logc = "%-4.4s" % str(logc)
        self.term = term
224

Jack Jansen's avatar
Jack Jansen committed
225
    def __repr__(self):
226
        return "Logical(%r, %r)" % (self.logc, self.term)
227

Jack Jansen's avatar
Jack Jansen committed
228 229 230 231 232 233 234
    def __str__(self):
        if type(self.term) == ListType and len(self.term) == 2:
            return "%s %s %s" % (nice(self.term[0]),
                                 string.strip(self.logc),
                                 nice(self.term[1]))
        else:
            return "%s(%s)" % (string.strip(self.logc), nice(self.term))
235

Jack Jansen's avatar
Jack Jansen committed
236 237
    def __aepack__(self):
        return pack({'logc': mkenum(self.logc), 'term': self.term}, 'logi')
238 239

def IsLogical(x):
Jack Jansen's avatar
Jack Jansen committed
240
    return isinstance(x, Logical)
241 242

class StyledText:
Jack Jansen's avatar
Jack Jansen committed
243
    """An AE object respresenting text in a certain style"""
244

Jack Jansen's avatar
Jack Jansen committed
245 246 247
    def __init__(self, style, text):
        self.style = style
        self.text = text
248

Jack Jansen's avatar
Jack Jansen committed
249
    def __repr__(self):
250
        return "StyledText(%r, %r)" % (self.style, self.text)
251

Jack Jansen's avatar
Jack Jansen committed
252 253
    def __str__(self):
        return self.text
254

Jack Jansen's avatar
Jack Jansen committed
255 256
    def __aepack__(self):
        return pack({'ksty': self.style, 'ktxt': self.text}, 'STXT')
257 258

def IsStyledText(x):
Jack Jansen's avatar
Jack Jansen committed
259
    return isinstance(x, StyledText)
260 261

class AEText:
Jack Jansen's avatar
Jack Jansen committed
262
    """An AE text object with style, script and language specified"""
263

Jack Jansen's avatar
Jack Jansen committed
264 265 266 267
    def __init__(self, script, style, text):
        self.script = script
        self.style = style
        self.text = text
268

Jack Jansen's avatar
Jack Jansen committed
269
    def __repr__(self):
270
        return "AEText(%r, %r, %r)" % (self.script, self.style, self.text)
271

Jack Jansen's avatar
Jack Jansen committed
272 273
    def __str__(self):
        return self.text
274

Jack Jansen's avatar
Jack Jansen committed
275 276 277
    def __aepack__(self):
        return pack({keyAEScriptTag: self.script, keyAEStyles: self.style,
                 keyAEText: self.text}, typeAEText)
278 279

def IsAEText(x):
Jack Jansen's avatar
Jack Jansen committed
280
    return isinstance(x, AEText)
281 282

class IntlText:
Jack Jansen's avatar
Jack Jansen committed
283
    """A text object with script and language specified"""
284

Jack Jansen's avatar
Jack Jansen committed
285 286 287 288
    def __init__(self, script, language, text):
        self.script = script
        self.language = language
        self.text = text
289

Jack Jansen's avatar
Jack Jansen committed
290
    def __repr__(self):
291
        return "IntlText(%r, %r, %r)" % (self.script, self.language, self.text)
292

Jack Jansen's avatar
Jack Jansen committed
293 294
    def __str__(self):
        return self.text
295

Jack Jansen's avatar
Jack Jansen committed
296 297 298
    def __aepack__(self):
        return pack(struct.pack('hh', self.script, self.language)+self.text,
            typeIntlText)
299 300

def IsIntlText(x):
Jack Jansen's avatar
Jack Jansen committed
301
    return isinstance(x, IntlText)
302 303

class IntlWritingCode:
Jack Jansen's avatar
Jack Jansen committed
304
    """An object representing script and language"""
305

Jack Jansen's avatar
Jack Jansen committed
306 307 308
    def __init__(self, script, language):
        self.script = script
        self.language = language
309

Jack Jansen's avatar
Jack Jansen committed
310
    def __repr__(self):
311
        return "IntlWritingCode(%r, %r)" % (self.script, self.language)
312

Jack Jansen's avatar
Jack Jansen committed
313 314
    def __str__(self):
        return "script system %d, language %d"%(self.script, self.language)
315

Jack Jansen's avatar
Jack Jansen committed
316 317 318
    def __aepack__(self):
        return pack(struct.pack('hh', self.script, self.language),
            typeIntlWritingCode)
319 320

def IsIntlWritingCode(x):
Jack Jansen's avatar
Jack Jansen committed
321
    return isinstance(x, IntlWritingCode)
322 323

class QDPoint:
Jack Jansen's avatar
Jack Jansen committed
324
    """A point"""
325

Jack Jansen's avatar
Jack Jansen committed
326 327 328
    def __init__(self, v, h):
        self.v = v
        self.h = h
329

Jack Jansen's avatar
Jack Jansen committed
330
    def __repr__(self):
331
        return "QDPoint(%r, %r)" % (self.v, self.h)
332

Jack Jansen's avatar
Jack Jansen committed
333 334
    def __str__(self):
        return "(%d, %d)"%(self.v, self.h)
335

Jack Jansen's avatar
Jack Jansen committed
336 337 338
    def __aepack__(self):
        return pack(struct.pack('hh', self.v, self.h),
            typeQDPoint)
339 340

def IsQDPoint(x):
Jack Jansen's avatar
Jack Jansen committed
341
    return isinstance(x, QDPoint)
342 343

class QDRectangle:
Jack Jansen's avatar
Jack Jansen committed
344
    """A rectangle"""
345

Jack Jansen's avatar
Jack Jansen committed
346 347 348 349 350
    def __init__(self, v0, h0, v1, h1):
        self.v0 = v0
        self.h0 = h0
        self.v1 = v1
        self.h1 = h1
351

Jack Jansen's avatar
Jack Jansen committed
352
    def __repr__(self):
353
        return "QDRectangle(%r, %r, %r, %r)" % (self.v0, self.h0, self.v1, self.h1)
354

Jack Jansen's avatar
Jack Jansen committed
355 356
    def __str__(self):
        return "(%d, %d)-(%d, %d)"%(self.v0, self.h0, self.v1, self.h1)
357

Jack Jansen's avatar
Jack Jansen committed
358 359 360
    def __aepack__(self):
        return pack(struct.pack('hhhh', self.v0, self.h0, self.v1, self.h1),
            typeQDRectangle)
361 362

def IsQDRectangle(x):
Jack Jansen's avatar
Jack Jansen committed
363
    return isinstance(x, QDRectangle)
364 365

class RGBColor:
Jack Jansen's avatar
Jack Jansen committed
366
    """An RGB color"""
367

Jack Jansen's avatar
Jack Jansen committed
368 369 370 371
    def __init__(self, r, g, b):
        self.r = r
        self.g = g
        self.b = b
372

Jack Jansen's avatar
Jack Jansen committed
373
    def __repr__(self):
374
        return "RGBColor(%r, %r, %r)" % (self.r, self.g, self.b)
375

Jack Jansen's avatar
Jack Jansen committed
376 377
    def __str__(self):
        return "0x%x red, 0x%x green, 0x%x blue"% (self.r, self.g, self.b)
378

Jack Jansen's avatar
Jack Jansen committed
379 380 381
    def __aepack__(self):
        return pack(struct.pack('hhh', self.r, self.g, self.b),
            typeRGBColor)
382 383

def IsRGBColor(x):
Jack Jansen's avatar
Jack Jansen committed
384
    return isinstance(x, RGBColor)
385 386

class ObjectSpecifier:
387

Jack Jansen's avatar
Jack Jansen committed
388
    """A class for constructing and manipulation AE object specifiers in python.
389

Jack Jansen's avatar
Jack Jansen committed
390
    An object specifier is actually a record with four fields:
391

Jack Jansen's avatar
Jack Jansen committed
392 393
    key type    description
    --- ----    -----------
394

Jack Jansen's avatar
Jack Jansen committed
395 396
    'want'  type    4-char class code of thing we want,
            e.g. word, paragraph or property
397

Jack Jansen's avatar
Jack Jansen committed
398 399
    'form'  enum    how we specify which 'want' thing(s) we want,
            e.g. by index, by range, by name, or by property specifier
400

Jack Jansen's avatar
Jack Jansen committed
401 402
    'seld'  any which thing(s) we want,
            e.g. its index, its name, or its property specifier
403

Jack Jansen's avatar
Jack Jansen committed
404 405
    'from'  object  the object in which it is contained,
            or null, meaning look for it in the application
406

Jack Jansen's avatar
Jack Jansen committed
407 408 409
    Note that we don't call this class plain "Object", since that name
    is likely to be used by the application.
    """
410

Jack Jansen's avatar
Jack Jansen committed
411 412 413 414 415
    def __init__(self, want, form, seld, fr = None):
        self.want = want
        self.form = form
        self.seld = seld
        self.fr = fr
416

Jack Jansen's avatar
Jack Jansen committed
417
    def __repr__(self):
418
        s = "ObjectSpecifier(%r, %r, %r" % (self.want, self.form, self.seld)
Jack Jansen's avatar
Jack Jansen committed
419
        if self.fr:
420
            s = s + ", %r)" % (self.fr,)
Jack Jansen's avatar
Jack Jansen committed
421 422 423
        else:
            s = s + ")"
        return s
424

Jack Jansen's avatar
Jack Jansen committed
425 426 427 428 429 430
    def __aepack__(self):
        return pack({'want': mktype(self.want),
                 'form': mkenum(self.form),
                 'seld': self.seld,
                 'from': self.fr},
                'obj ')
431 432

def IsObjectSpecifier(x):
Jack Jansen's avatar
Jack Jansen committed
433
    return isinstance(x, ObjectSpecifier)
434 435


Georg Brandl's avatar
Georg Brandl committed
436
# Backwards compatibility, sigh...
437 438
class Property(ObjectSpecifier):

Jack Jansen's avatar
Jack Jansen committed
439 440
    def __init__(self, which, fr = None, want='prop'):
        ObjectSpecifier.__init__(self, want, 'prop', mktype(which), fr)
441

Jack Jansen's avatar
Jack Jansen committed
442 443
    def __repr__(self):
        if self.fr:
444
            return "Property(%r, %r)" % (self.seld.type, self.fr)
Jack Jansen's avatar
Jack Jansen committed
445
        else:
446
            return "Property(%r)" % (self.seld.type,)
447

Jack Jansen's avatar
Jack Jansen committed
448 449 450 451 452
    def __str__(self):
        if self.fr:
            return "Property %s of %s" % (str(self.seld), str(self.fr))
        else:
            return "Property %s" % str(self.seld)
453 454 455


class NProperty(ObjectSpecifier):
Jack Jansen's avatar
Jack Jansen committed
456 457 458 459 460 461 462 463 464 465
    # Subclasses *must* self baseclass attributes:
    # want is the type of this property
    # which is the property name of this property

    def __init__(self, fr = None):
        #try:
        #   dummy = self.want
        #except:
        #   self.want = 'prop'
        self.want = 'prop'
466
        ObjectSpecifier.__init__(self, self.want, 'prop',
Jack Jansen's avatar
Jack Jansen committed
467 468 469
                    mktype(self.which), fr)

    def __repr__(self):
470
        rv = "Property(%r" % (self.seld.type,)
Jack Jansen's avatar
Jack Jansen committed
471
        if self.fr:
472
            rv = rv + ", fr=%r" % (self.fr,)
Jack Jansen's avatar
Jack Jansen committed
473
        if self.want != 'prop':
474
            rv = rv + ", want=%r" % (self.want,)
Jack Jansen's avatar
Jack Jansen committed
475
        return rv + ")"
476

Jack Jansen's avatar
Jack Jansen committed
477 478 479 480 481
    def __str__(self):
        if self.fr:
            return "Property %s of %s" % (str(self.seld), str(self.fr))
        else:
            return "Property %s" % str(self.seld)
482 483 484


class SelectableItem(ObjectSpecifier):
485

Jack Jansen's avatar
Jack Jansen committed
486 487 488 489 490 491 492 493 494 495 496 497 498 499 500
    def __init__(self, want, seld, fr = None):
        t = type(seld)
        if t == StringType:
            form = 'name'
        elif IsRange(seld):
            form = 'rang'
        elif IsComparison(seld) or IsLogical(seld):
            form = 'test'
        elif t == TupleType:
            # Breakout: specify both form and seld in a tuple
            # (if you want ID or rele or somesuch)
            form, seld = seld
        else:
            form = 'indx'
        ObjectSpecifier.__init__(self, want, form, seld, fr)
501 502 503


class ComponentItem(SelectableItem):
Jack Jansen's avatar
Jack Jansen committed
504 505 506 507 508 509 510 511
    # Derived classes *must* set the *class attribute* 'want' to some constant
    # Also, dictionaries _propdict and _elemdict must be set to map property
    # and element names to the correct classes

    _propdict = {}
    _elemdict = {}
    def __init__(self, which, fr = None):
        SelectableItem.__init__(self, self.want, which, fr)
512

Jack Jansen's avatar
Jack Jansen committed
513 514
    def __repr__(self):
        if not self.fr:
515 516
            return "%s(%r)" % (self.__class__.__name__, self.seld)
        return "%s(%r, %r)" % (self.__class__.__name__, self.seld, self.fr)
517

Jack Jansen's avatar
Jack Jansen committed
518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533
    def __str__(self):
        seld = self.seld
        if type(seld) == StringType:
            ss = repr(seld)
        elif IsRange(seld):
            start, stop = seld.start, seld.stop
            if type(start) == InstanceType == type(stop) and \
               start.__class__ == self.__class__ == stop.__class__:
                ss = str(start.seld) + " thru " + str(stop.seld)
            else:
                ss = str(seld)
        else:
            ss = str(seld)
        s = "%s %s" % (self.__class__.__name__, ss)
        if self.fr: s = s + " of %s" % str(self.fr)
        return s
534

Jack Jansen's avatar
Jack Jansen committed
535 536 537 538 539 540 541 542
    def __getattr__(self, name):
        if self._elemdict.has_key(name):
            cls = self._elemdict[name]
            return DelayedComponentItem(cls, self)
        if self._propdict.has_key(name):
            cls = self._propdict[name]
            return cls(self)
        raise AttributeError, name
543 544


545
class DelayedComponentItem:
Jack Jansen's avatar
Jack Jansen committed
546 547 548
    def __init__(self, compclass, fr):
        self.compclass = compclass
        self.fr = fr
549

Jack Jansen's avatar
Jack Jansen committed
550 551
    def __call__(self, which):
        return self.compclass(which, self.fr)
552

Jack Jansen's avatar
Jack Jansen committed
553
    def __repr__(self):
554
        return "%s(???, %r)" % (self.__class__.__name__, self.fr)
555

Jack Jansen's avatar
Jack Jansen committed
556 557
    def __str__(self):
        return "selector for element %s of %s"%(self.__class__.__name__, str(self.fr))
558 559 560 561 562 563 564 565 566 567 568 569 570 571

template = """
class %s(ComponentItem): want = '%s'
"""

exec template % ("Text", 'text')
exec template % ("Character", 'cha ')
exec template % ("Word", 'cwor')
exec template % ("Line", 'clin')
exec template % ("paragraph", 'cpar')
exec template % ("Window", 'cwin')
exec template % ("Document", 'docu')
exec template % ("File", 'file')
exec template % ("InsertionPoint", 'cins')