示例#1
0
 def replaceSlots(self, runinfo, start, end = None) :
     """ Replaces the subrange between a slot with id of start up to but
         not including a slot with id of end (if specified, else the end
         of the run), with the given runinfo.
         Returns the two indices for (start, end) on the input run before
         editing."""
     fin = len(self)
     ini = 0
     for (i, s) in enumerate(self) :
         if s.id == start :
             ini = i
         elif s.id == end :
             fin = i
     res = []
     for slotinfo in runinfo :
         slot = Slot(slotinfo)
         res.append(slot)
     self[ini:fin] = res
     for (i, slot) in enumerate(self) :
         slot.index = i
     return (ini, fin)
示例#2
0
 def getCollisionAnnot(self, key) :
     value = self.collisionProps[key]
     if key == "flags" :
         value = Slot.colFlagsAnnot(value)
     return value
示例#3
0
文件: glyph.py 项目: silnrsi/graide
 def getCollisionAnnot(self, key) :
     value = self.collisionProps[key]
     if key == "flags" :
         value = Slot.colFlagsAnnot(value)
     return value
示例#4
0
 def addSlots(self, runinfo, flipDir = False) :
     for slotinfo in runinfo :
         slot = Slot(slotinfo)
         self.append(slot)
         slot.index = len(self) - 1