示例#1
0
    def __init__(self):
        msg("input()", 2, "Hbd_plugin.__init__()")
        self.name_label = input(color("Enter label: ", "red")).lower()
        self.name_text = input(color("Enter name: ", "yellow")).lower()

        self.mask = Image(64,16)
        self.mask.fill()

        self.bg = Image(64, 16)
        self.drawer = Drawer(self.bg)
        self.drawer.dot(0, 0)
        self.drawer.dot(0, 15)
        self.drawer.dot(63, 0)
        self.drawer.dot(63, 15)

        self.label = Text(text="§" + self.name_label + "§")
        self.name = Text(text=self.name_text)

        self.screen = Screen(matrix=True, show=True, fps=1.7, tty='/dev/ttyACM1')

        self.screen.add(self.bg, refresh=False)

        xloc_label = (64 - abs(self.label.width)) // 2
        self.screen.add(self.label, x=xloc_label, y=1, refresh=False)

        xloc_text = (64 - abs(self.name.width)) // 2
        self.screen.add(self.name, x=xloc_text, y=8, refresh=False)

        self.screen.add(self.mask, refresh=False, mode="invert")
示例#2
0
文件: screen.py 项目: tomsimonart/GLM
    def __str__(self):
        count = len(self.childs) - 1
        string = color("Screen", "green") + "\n"
        for n, child in enumerate(self.childs):
            if n < count:
                string += color('├─', 'blue')
            else:
                string += color('└─', 'blue')

            string += color(str(n), 'red')
            string += color("..", 'yellow')
            string += color(child[5], 'green', False, None, "Underline")
            if child[3]:
                string += "[" + color("1", "magenta", False) + "]"
            else:
                string += "[" + color("O", "magenta", False) + "]"
            string += "\n"
        return string
示例#3
0
 def get_info(self):
     """Get the current state and information of the plugin"""
     print(color(self.name, "red"),
           color(self.author, "green"),
           color(self.version, "magenta"),
           sep='\n')