Exemplo n.º 1
0
    def showUserInputHint(self):
        """ Show user input hint
        """

        for i in range(0, len(self.commitIDs)):
            commitID = self.commitIDs[i]
            comment = self.comments[i]
            print "  %s %s" % (Paint.bold(commitID), comment)

        deviceName = self.baseDevice.name()
        oneCommit = Paint.bold(self.commitIDs[0])
        twoCommits = "%s %s" % (Paint.bold(
            self.commitIDs[-1]), Paint.bold(self.commitIDs[0]))
        print "  ________________________________________________________________________________________"
        print "                                                                                          "
        print "  Each 7 bits SHA1 code identify a commit on %s," % Paint.blue(
            deviceName),
        print "  You could input:                                                                        "
        print "  - Only one single commit, like: %s" % oneCommit
        print "    will porting changes between the selected and the latest from %s to your device" % Paint.blue(
            deviceName)
        print "  - Two commits as a range, like: %s" % twoCommits
        print "    will porting changes between the two selected from %s to your device" % Paint.blue(
            deviceName)
        print "  ________________________________________________________________________________________"
        print "                                                                                          "
Exemplo n.º 2
0
    def doAction(self, action):
        action = " ".join(action)
        print Paint.blue(">>> %s" % action)

        status = 0

        phase = self.workflow.getPhase(action)
        if phase != None:
            for cmd in phase.cmds:
                status = Shell.run(cmd)
                if status != 0: break
        else:
            cmd = "make %s" % action
            status = Shell.run(cmd)

        help.show(status, action)

        if status == 0:
            print Paint.blue("<<< %s succeed" % action)
            return True
        else:
            print Paint.red("<<< %s failed" % action)
            return False
Exemplo n.º 3
0
    def doAction(self, action):
        print "\n"
        print Paint.blue(">>> In phase %s" % action)

        status = 0

        phase = self.workflow.getPhase(action)
        if phase != None:
            for cmd in phase.cmds:
                status = Shell.run(cmd)
                if status != 0: break
        else:
            print Paint.red('Error: Unknown command "%s"' % action)
            # Set status code to be 255, show the tale
            status = 255

        HelpPresenter.showdetail(status, action)

        if status == 0:
            print Paint.blue("<<< phase %s succeed" % action)
            return True
        else:
            print Paint.red("<<< phase %s failed" % action)
            return False