def buildFramer(self, command, tokens, index):
        """Create a new framer and make it the current one

           framework framername [be (active, inactive, aux, slave)] [at period]
                                [first frame] [via (main, mine, inode)]
           framework framername be active at 0.0
           framework framername
        """
        if not self.currentHouse:
            msg = "Error building %s. No current house." % (command,)
            raise excepting.ParseError(msg, tokens, index)

        if not self.currentStore:
            msg = "Error building %s. No current store." % (command,)
            raise excepting.ParseError(msg, tokens, index)

        try:
            name = tokens[index]
            index +=1

            self.verifyName(name, command, tokens, index)

            schedule = INACTIVE  #globaling.py
            order = MID #globaling.py
            period = 0.0
            frame = ''
            inode = ''


            while index < len(tokens): #options
                connective = tokens[index]
                index += 1

                if connective == 'at':
                    period = max(0.0, Convert2Num(tokens[index]))
                    index +=1

                elif connective == 'be':
                    option = tokens[index]
                    index +=1

                    if option not in ScheduleValues:
                        msg = "Error building %s. Bad scheduled option got %s." %\
                                (command, option)
                        raise excepting.ParseError(msg, tokens, index)

                    schedule = ScheduleValues[option] #replace text with value

                elif connective == 'in':
                    order = tokens[index]
                    index +=1
                    if order not in OrderValues:
                        msg = "Error building %s. Bad order got %s." %\
                                (command, order,)
                        raise excepting.ParseError(msg, tokens, index)
                    order = OrderValues[order] #convert to order value

                elif connective == 'first':
                    frame = tokens[index]
                    index +=1

                    self.verifyName(frame, command, tokens, index)

                elif connective == 'via':
                    inode, index = self.parseIndirect(tokens, index, node=True)

                else:
                    msg = "Error building %s. Bad connective got %s." %\
                            (command, connective)
                    raise excepting.ParseError(msg, tokens, index)

            if name in framing.Framer.Names:
                msg = "Error building %s. Framer or Task %s already exists." %\
                        (command, name)
                raise excepting.ParseError(msg, tokens, index)
            else:
                framer = framing.Framer(name = name,
                                        store = self.currentStore,
                                        period = period)
                framer.schedule = schedule
                framer.first = frame #need to resolve later
                framer.inode = inode

                self.currentHouse.taskers.append(framer)
                self.currentHouse.framers.append(framer)

                if schedule == SLAVE:
                    self.currentHouse.slaves.append(framer)
                elif schedule == AUX:
                    self.currentHouse.auxes.append(framer)
                elif schedule == MOOT:
                    self.currentHouse.moots.append(framer)
                else: #taskable active or inactive
                    if order == FRONT:
                        self.currentHouse.fronts.append(framer)
                    elif order == BACK:
                        self.currentHouse.backs.append(framer)
                    else:
                        self.currentHouse.mids.append(framer)

                self.currentFramer = framer
                self.currentFramer.assignFrameRegistry()
                self.currentFrame = None #changed current Framer so no current Frame

                console.profuse("     Created Framer named '{0}' at period {1:0.4f} be {2} first {3}\n".format(
                    framer.name, framer.period, ScheduleNames[framer.schedule], framer.first))

                console.profuse("     Added Framer '{0}' to House '{1}', Assigned frame registry\n".format(
                    framer.name, self.currentHouse.name))


        except __HOLE__:
            msg = "Error building %s. Not enough tokens." % (command,)
            raise excepting.ParseError(msg, tokens, index)

        if index != len(tokens):
            msg = "Error building %s. Unused tokens." % (command,)
            raise excepting.ParseError(msg, tokens, index)

        return True
dataset/ETHPy150Open ioflo/ioflo/ioflo/base/building.py/Builder.buildFramer