예제 #1
0
    def convertScript(self, script):
        """

        @param script:
        @return:
        """
        lijst = script.split(',')

        eventList = [(0, event.start())]
        for eventStr in lijst:
            events = self.parseEventStr(eventStr)
            eventList.extend(events)

        #Replace the last phase ends with mission ends
        lastEvent = eventList[-1][1]
        if isinstance(lastEvent,event.phaseEnds):
            lastPhaseNumber = lastEvent.getPhaseNumber()
            for time, eventItem in eventList:
                if isinstance(eventItem, event.phaseEnds):
                    if eventItem.getPhaseNumber() == lastPhaseNumber:
                        eventItem.convertToEndMission()

        else:
            print 'ERROR, the last event is not a phase end!'


        return eventList
예제 #2
0
파일: app.py 프로젝트: jklgithub/jkl_pi
def events():
    eventsInit()
    event.start(60)